Manual: Custom Action Plugin

Translating Custom Action Plugins

Starting with v1.3.3, you can translate custom actions by attaching translation files.

Translatable Parts

  • You can translate property names and tooltips for properties.
  • Class names (names displayed in the list) and group names cannot be translated, but their tooltips can be.

How to Implement Translations

Translation data is loaded by placing a CSV file created according to the specified format directly under the editor_translations folder within the plugin.

[Example Folder Structure]

res://addons/
└── custom_action_plugin/
├── custom_action.gd
└── editor_translations
└── custom_action.csv

  • The condition is that it must be located directly under editor_translations, which is at the same level as the custom action’s GDScript. It works regardless of whether it is in the addons folder or the custom_action_plugin folder, or any other location.
  • The name of the GDScript does not need to match the name of the CSV file.
  • One CSV file can be used for multiple GDScripts.

CSV File Sample

context,key,ja,en,ko,zh_CN,zh_TW,pt_BR,es_AR,de,ru
"CustomAction","Description","Custom Action: Tooltip","Custom Action: Tooltip","커스텀 액션: 툴팁","自定义动作:工具提示","自訂動作:工具提示","Ação personalizada: dica de ferramenta","Acción personalizada: descripción emergente","Benutzerdefinierte Aktion: Tooltip","Пользовательское действие: подсказка"
"CustomAction","group","Group","Group","그룹","组","群組","Grupo","Grupo","Gruppe","Группа"
"CustomAction:test_num","test_num(Number Tooltip)","Number tooltip","Number tooltip","숫자 툴팁","数值工具提示","數值工具提示","Dica de ferramenta do número","Descripción emergente del número","Zahlen-Tooltip","Подсказка для числа"
"CustomAction:test_num","test_num","Number","Number","숫자","数值","數值","Número","Número","Zahl","Число"
"CustomAction:test_elements","test_elements(Element Tooltip)","Element tooltip","Element tooltip","속성 툴팁","属性工具提示","屬性工具提示","Dica de ferramenta do elemento","Descripción emergente del elemento","Element-Tooltip","Подсказка для элемента"
"CustomAction:test_elements","test_elements","Element","Element","속성","属性","屬性","Elemento","Elemento","Element","Элемент"
"CustomAction:test_elements","Fire","Fire","Fire","불","火","火","Fogo","Fuego","Feuer","Огонь"
"CustomAction:test_elements","Water","Water","Water","물","水","水","Água","Agua","Wasser","Вода"
"CustomAction:test_elements","Earth","Earth","Earth","땅","土","土","Terra","Tierra","Erde","Земля"

*CSV only
custom_action.csv (1.7 KB)
*Sample configuration including the main plugin
custom_action_translation_sample.zip (2.2 KB)

Column Details

  • context specifies which property of the class it is associated with. However, descriptions returned by export_group and get_description() do not have associated properties, so they are omitted.
  • key specifies the identifier defined in the script.
  • The subsequent columns define text according to the language settings.

Tips for Writing CSVs

  1. The header (context,key,...) should not be quoted.
  2. From the second line onwards, enclose all items in double quotes.
  3. Use UTF-8 with BOM.
  4. Use CRLF line endings.
1 Like