-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌎 Translation Support #118
Draft
mrfelipemartins
wants to merge
5
commits into
bitbrain:godot-4.x
Choose a base branch
from
mrfelipemartins:l10n
base: godot-4.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7e890e7
wip(l10n): added localization support to the addon
mrfelipemartins 743d826
Merge branch 'godot-4.x' into l10n
mrfelipemartins 1a2d9b7
wip(l10n): optimizations
mrfelipemartins ea0d9d2
Merge branch 'godot-4.x' into l10n
bitbrain 4c47bb9
Merge branch 'godot-4.x' into l10n
bitbrain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Pandora\n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"Language: en\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 3.3.2\n" | ||
|
||
msgid "ui.control_bar.create_category_button.tooltip" | ||
msgstr "Create Category" | ||
|
||
msgid "ui.control_bar.create_entity_button.tooltip" | ||
msgstr "Create Entity" | ||
|
||
msgid "ui.control_bar.regenerate_id_button.tooltip" | ||
msgstr "" | ||
"Generate a new ID for selected entry.\n" | ||
"Shift-click: generate new IDs for all entries." | ||
|
||
msgid "ui.control_bar.delete_button.tooltip" | ||
msgstr "Delete Selected Entry" | ||
|
||
msgid "ui.control_bar.save_button.tooltip" | ||
msgstr "Save Current Changes" | ||
|
||
msgid "ui.control_bar.reset_button.tooltip" | ||
msgstr "Reset Data" | ||
|
||
msgid "ui.control_bar.learn_link.text" | ||
msgstr "Learn" | ||
|
||
msgid "ui.control_bar.contribute_link.text" | ||
msgstr "Contribute" | ||
|
||
msgid "ui.control_bar.report_link.text" | ||
msgstr "🐛 Report a bug!" | ||
|
||
msgid "ui.entity_tree.entity_search.placeholder" | ||
msgstr "Search…" | ||
|
||
msgid "ui.property_editor.caption_label.text" | ||
msgstr "Properties" | ||
|
||
msgid "ui.property_editor.unselected_container_label.text" | ||
msgstr "Create or select a category or item to see its properties here." | ||
|
||
msgid "ui.property_editor.icon_label.text" | ||
msgstr "Icon" | ||
|
||
msgid "ui.property_editor.script_label.text" | ||
msgstr "Script" | ||
|
||
msgid "ui.property_editor.generate_id_class_label.text" | ||
msgstr "Generate ID Class" | ||
|
||
msgid "ui.property_editor.id_class_name_label.text" | ||
msgstr "ID Class Name" | ||
|
||
msgid "ui.property_editor.id_class_name_field.placeholder" | ||
msgstr "SomeClassName" | ||
|
||
msgid "ui.property_editor.property_settings.header_label.text" | ||
msgstr "Properties" | ||
|
||
msgid "ui.property_editor.property_settings.info_label.text" | ||
msgstr "Property Settings" | ||
|
||
msgid "Categories Only" | ||
msgstr "Categories Only" | ||
|
||
msgid "Sort List" | ||
msgstr "Sort List" | ||
|
||
msgid "Alphabetically" | ||
msgstr "Alphabetically" | ||
|
||
msgid "As-Is" | ||
msgstr "As-Is" | ||
|
||
msgid "property" | ||
msgstr "property" | ||
|
||
#~ msgid "ui.property_editor.property_default_name" | ||
#~ msgstr "Property" | ||
|
||
#~ msgid "ui.property_editor.property_settings.categories_only_label.text" | ||
#~ msgstr "Categories Only" | ||
|
||
#~ msgid "ui.property_editor.property_settings.category_filter_label.text" | ||
#~ msgstr "Category Filter" | ||
|
||
#~ msgid "ui.property_editor.property_settings.sort_list_label.text" | ||
#~ msgstr "Sort List" | ||
|
||
#~ msgid "ui.property_editor.property_settings.sort_list_menu.alphabetically" | ||
#~ msgstr "Alphabetically" | ||
|
||
#~ msgid "ui.property_editor.property_settings.sort_list_menu.as_is" | ||
#~ msgstr "As-is" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Pandora\n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"Language: pt_BR\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"X-Generator: Poedit 3.3.2\n" | ||
|
||
msgid "ui.control_bar.create_category_button.tooltip" | ||
msgstr "Nova Categoria" | ||
|
||
msgid "ui.control_bar.create_entity_button.tooltip" | ||
msgstr "Nova Entidade" | ||
|
||
msgid "ui.control_bar.regenerate_id_button.tooltip" | ||
msgstr "" | ||
"Gerar um novo ID para o registro selecionado.\n" | ||
"Shift-click: Gera um novo ID para todos os registros." | ||
|
||
msgid "ui.control_bar.delete_button.tooltip" | ||
msgstr "Deletar Registro Selecionado" | ||
|
||
msgid "ui.control_bar.save_button.tooltip" | ||
msgstr "Salvar Mudanças" | ||
|
||
msgid "ui.control_bar.reset_button.tooltip" | ||
msgstr "Desfazer Mudanças" | ||
|
||
msgid "ui.control_bar.learn_link.text" | ||
msgstr "Aprenda" | ||
|
||
msgid "ui.control_bar.contribute_link.text" | ||
msgstr "Contribua" | ||
|
||
msgid "ui.control_bar.report_link.text" | ||
msgstr "🐛 Reporte um bug!" | ||
|
||
msgid "ui.entity_tree.entity_search.placeholder" | ||
msgstr "Buscar…" | ||
|
||
msgid "ui.property_editor.caption_label.text" | ||
msgstr "Propriedades" | ||
|
||
msgid "ui.property_editor.unselected_container_label.text" | ||
msgstr "Crie um selecione uma categoria para visualizar suas propriedades" | ||
|
||
msgid "ui.property_editor.icon_label.text" | ||
msgstr "Ícone" | ||
|
||
msgid "ui.property_editor.script_label.text" | ||
msgstr "Script" | ||
|
||
msgid "ui.property_editor.generate_id_class_label.text" | ||
msgstr "Gerar Classe de IDs" | ||
|
||
msgid "ui.property_editor.id_class_name_label.text" | ||
msgstr "Nome da Classe de IDs" | ||
|
||
msgid "ui.property_editor.id_class_name_field.placeholder" | ||
msgstr "NomeDaClasse" | ||
|
||
msgid "ui.property_editor.property_settings.header_label.text" | ||
msgstr "Propriedades" | ||
|
||
msgid "ui.property_editor.property_settings.info_label.text" | ||
msgstr "Configurações da Propriedade" | ||
|
||
msgid "Categories Only" | ||
msgstr "Somente Categorias" | ||
|
||
msgid "Sort List" | ||
msgstr "Ordenar" | ||
|
||
msgid "Alphabetically" | ||
msgstr "Ordem Alfabética" | ||
|
||
msgid "As-Is" | ||
msgstr "Padrão" | ||
|
||
msgid "property" | ||
msgstr "" | ||
|
||
#~ msgid "ui.property_editor.property_settings.categories_only_label.text" | ||
#~ msgstr "Somente para Categorias" | ||
|
||
#~ msgid "ui.property_editor.property_settings.category_filter_label.text" | ||
#~ msgstr "Filtrar Categoria" | ||
|
||
#~ msgid "ui.property_editor.property_settings.sort_list_label.text" | ||
#~ msgstr "Ordenar" | ||
|
||
#~ msgid "ui.property_editor.property_settings.sort_list_menu.alphabetically" | ||
#~ msgstr "Ordem Alfabética" | ||
|
||
#, fuzzy | ||
#~ msgid "ui.property_editor.property_settings.sort_list_menu.as_is" | ||
#~ msgstr "As-is" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
msgid "" | ||
msgstr "" | ||
|
||
"Project-Id-Version: Pandora\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8-bit\n" | ||
|
||
msgid "ui.control_bar.create_category_button.tooltip" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.create_entity_button.tooltip" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.regenerate_id_button.tooltip" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.delete_button.tooltip" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.save_button.tooltip" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.reset_button.tooltip" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.learn_link.text" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.contribute_link.text" | ||
msgstr "" | ||
|
||
msgid "ui.control_bar.report_link.text" | ||
msgstr "" | ||
|
||
msgid "ui.entity_tree.entity_search.placeholder" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.caption_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.unselected_container_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.icon_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.script_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.generate_id_class_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.id_class_name_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.id_class_name_field.placeholder" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.property_settings.header_label.text" | ||
msgstr "" | ||
|
||
msgid "ui.property_editor.property_settings.info_label.text" | ||
msgstr "" | ||
|
||
msgid "Categories Only" | ||
msgstr "" | ||
|
||
msgid "Sort List" | ||
msgstr "" | ||
|
||
msgid "Alphabetically" | ||
msgstr "" | ||
|
||
msgid "As-Is" | ||
msgstr "" | ||
|
||
msgid "property" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class_name TranslationManager extends Node | ||
|
||
static func translate(string: String) -> String: | ||
var language: String = TranslationServer.get_tool_locale() | ||
var translations_path: String = "res://addons/pandora/l10n/%s.po" % language | ||
var fallback_translations_path: String = "res://addons/pandora/l10n/en.po" | ||
var translations: Translation = load(translations_path if FileAccess.file_exists(translations_path) else fallback_translations_path) | ||
return translations.get_message(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Godot 3 we could simply use the
tr()
function available in GDScript. Could we do that instead of this custom translation mamager? Godot 4 supports .pot files in the project settings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a better look at this, I thought that was only applied to the project, not to addons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I ran some tests here and as I suspected the TranslationServer is not available in the EditorPlugin so we can't inject POT files.
Some refs:
godotengine/godot-proposals#6885
godotengine/godot-proposals#1262
I actually took the idea of the custom tr manager from the reference you gave in #65:
https://github.com/nathanhoad/godot_dialogue_manager/blob/71c65332cc7b34eee9c517aaa36d645a79bfadb3/addons/dialogue_manager/constants.gd#L254