Create Translation Files - lin-ycv/MultilingualGH GitHub Wiki
If the language you want does not exist here, you can create your own. Below are instructions and guidelines on how to create these files.
Translation Guidelines:
- Check here for status of translations to different languages, and record yourself on the list once you've started translating
- If someone is already working on a language, it is advised that you work on another language or collaborate with that translator;however, if you wish to do your own translations, it is still welcomed
- If the translation and English is the same, at the translator's discretion, that component may be removed from the translation file, since the plugin defaults to English when there's no translation
- If you're revising a translation, add your name behind the previous translator, separated with comma
,
- Do not discredit other by removing their names
- Save the translation as a .txt/.json file
- Do a pull request if you've done some translations; alternatively, send the translations to me thru email
JSON translation files (for versions 0.6.0 and after):
- Take a look at my Traditional Chinese translation
- File starts and ends with square brackets
[ ]
- Each component info is stored in curly brackets
{ }
- Each component have 2 necessary and 1 optional info, each starts with a label(as below) followed by a colon
:
and its value stored in double quotes" "
:- name: EXACT English full name of the component
- translation: translation/description of component
- category: the category of the component, ie: Params/Maths..etc, this is needed to differentiate between component of same name [Optional]
- Each info for a component is separated by a comma
,
- Each component is also separated by a comma
,
- Translator credits info is treated as a component without category:
- name: "*Translator*",
- translation: "Translator's Name"
Pure text translation files (for versions prior to 0.6.0):
For Component translations: Last line in translation file:
- This file type does NOT work with Version 2.X and onwards
- Take a look at my Traditional Chinese translation
- Each line is one component translation
- Each line starts with the EXACT English full name of the component
- An equal sign
=
directly follows the English full name, without any spaces in between - The translation directly follows the equal sign
=
, without any spaces in between - The last line in the file follows the format
*Translator*="Translator's Name"
General Translations
Follows the guidelines as above.
- These are for the native vanilla grasshopper components
- File name can be whatever you want (normally the language you're translating to), the exact wording will show in the language options
Plugin Specific Translations
Plugin translations follows the same guidelines as above with a few extras:
- Each translation file is one plugin
- File name MUST start with the
plugin name
(as displayed on the GH tab) followed by underscore_
, you're free to name it whatever after the underscore_
(normally the language you're translating to)- For example:
Weaverbird
shows up asWb
in GH tabs, so an example of the file name would beWb_Japanese
for translations to Japanese
- For example:
- Do NOT include category in translation data, as it's already in the filename
- An example here (translation for Robots plugin)
MGH UI Translations (UILang)
Translation for the UI of the plugin, tooltips, message...etc
- These are for Version 2.X onwards, for Version 1.X, scroll to the bottom
- File name MUST start with
UILang_
, you can name it whatever afterwards (normally the language you're translating to)- For example:
UILang_Japanese
for translations to Japanese
- For example:
- There are 20 translate-able UI elements:
Version
- Followed by numbers to indicate the version of the pluginTipEnable
- Tooltip of "Version" option, indicating its function when clickedLanguageUI
- Menu name for "UI Language"Methods
- Menu name for "Display Method"MBubble
- Label for "Bubble Annotation" optionMText
- Label for "Text Annotation" optionTextSize
- Menu name for "Text Size"ReAnnotate
- Label for "Refresh Annotation" optionSave
- Label for "Save As Default" optionReload
- Label for "Reload Files" optionExcludeDefault
- Label for "Default Exclusions" optionExcludeUser
- Label for "Custom Exclusions" optionShowEng
- Label for "Show English Below" optionDisplayName
- Menu name for "Display Name Type"DFull
- Label for "Full Name" optionDNick
- Label for "Nickname" optionDCustom
- Label for "Custom Name" optionDCustomFull
- Label for "Custom w/ Full Name" optionDCustomNick
- Label for "Custom w/ Nickname" optionMissing
- Dialog message displayed when a missing/invalid JSON file is selected.
- Example can be found here Image for reference:
Extra Tips/Recommendations
- As there are hundreds of components in grasshopper, it'll take a while to translate them all, do not feel obligated to translate every single one
- My Traditional Chinese translation file does not cover all the vanilla components, if you wish to add additional components, feel free to do so
- But do not mix vanilla components and downloaded plugin components in the same file
- You can start from the Pure Text Blank Template OR JSON Blank Template
- Alternatively you can create a JSON template using the Translators Tools, as seen in this demo here
- A pure text translation file can be converted to JSON by using the Translators Tools, as seen in this demo here
- Depending on your speed of translation, it's recommended that you upload you progress every 100 components or so, this will give the community a chance to review your translations in case of typos and such. This also creates visible activity and keeps the momentum going
- You can use this file to check your translations for RH7 vanilla components
For Older Version (1.X)
MGH UI Translations (UILang)
Translation for the UI of the plugin, tooltips, message...etc
- File name MUST start with
UILang_
, you can name it whatever afterwards (normally the language you're translating to)- For example:
UILang_Japanese
for translations to Japanese
- For example:
- There are 20 translate-able UI elements:
Version
- followed by numbers to indicate the version of the pluginDisabled
- shown underneath the MGH component when not enabledTranslationBy
- used where credits are shown, shown before translator namesCompDes
- Description of the MGH componentCompIn
- Name of the input of MGH componentCompInDes
- Description of the input of MGH componentUseTextLabel
- shown as the "Use Text Label" toggle text in the right click menu of MGH componentUseDefaultExclusions
- shown as the text of "Use Default Exclusions" toggleCustomExclusions
- shown as the text of "Custom Exclusions" toggle in the toolbar menuKeepAnnotations
- shown as the text of "Keep Annotations" toggleNoNickname
- shown as the text of "Show Full Names"NicknamePreferred
- shown as the text of "Prefer Nicknames"NicknameOnly
- shown as the text of "Only Custom Nicknames"ShowEnglish
- shown as the text of "Show English with Translation"SaveAsDefault
- shown as the text of "Save As Default" option in the toolbar menuSaveDeTooltip
- shown as tooltip of "Save As Default" option in the toolbar menuTooMany
- shown in a message box when user tries to use more than one MGH componentMenuDisabled
- shown as tooltip on the toolbar menu option when MGH component in useNoDoc
- shown as tooltip on the toolbar menu option when no GH document is openClickEnable
- shown as tooltip on the enable toggle in the toolbar menu
- Example can be found here Image for reference: