-
Notifications
You must be signed in to change notification settings - Fork 195
Localization #240
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
base: main
Are you sure you want to change the base?
Localization #240
Conversation
|
Hey, thanks for working on this! We're currently don't have a lot of time to work on this project, but we plan to look at this PR on Monday, and give you feedback! |
|
Hey, @blinry! Did you take a look at my changes? |
|
Yes! @bleeptrack looked at this PR yesterday, and also at #152, another attempt at a localization feature. Cool that you're working on this – people still occasionally ask for translated levels, or express interest in translating them! :) So this would be very cool to see. We want to make sure we get the translation feature right, so that potential translators and players will have a good time with it. So here's some thoughts, curious what you think about them: CSV vs .po formatYou already mentioned yourself that relying on gettext and .po files would be a great option – it avoids file conflicts when multiple people translate at the same time, compared to the CSV file with multiple columns. Are you familiar with the gettext format and .po files? #152 already relied on this, maybe you can take inspiration. Technique for translating levelsIn #152, full translated level files where kept in a parallel directory structure – there would be a Because of that, we think that your approach of translating the individual snippets of text in levels makes a lot of sense! 🎉 One downside is that the levels can't be "fully customized" to, for example, provide more culturally appropriate content in other languages. If anyone has thoughts on that, I'd be curious to hear them, but for now, we could go ahead with the approach in this PR!
|
|
Thanks for the quick and detailed response! Regarding the syntax:Using _() is a good decision. It is the industry standard, and implementing a parser for it is absolutely feasible. I will rewrite the level parser to extract text wrapped in So, the level file would look like this: title = _(Make parallel commits)
cards = checkout commit-autoBasically, I will wrap all translatable text (titles, descriptions, hints) in Regarding @@ markers:As far as I know they are default symbols used for placeholder in templates. Switching to _() avoids confusion and makes the file look cleaner for developers. Answers to your questions1. Singular/Plural forms and linguistic issues:
Solution:
2. Translation Quality:
Next steps:I will proceed with refactoring the code to support Will be in touch! |
Add: - Native Gettext (.po) support with ru and br translations - translate_string parser for _() syntax in level files - Language selection menu to the Title scene - global_menu scene for navigation (single menu for level_select and main scenes) Fix: - Win condition logic to correctly grep localized file contents - UI layout issues where localizaed text overflowed containers (SaveButton) - Font change to properly render cyrillic characters - node.gd logic to prevent unwanted translation of raw Git data (commit messages, refs) - Limit the size of TextEdit in FileBrowser to prevent text from going under buttons
1d70184 to
0d9047a
Compare
|
Hey, @blinry! New commit is a reworked gettext version with Also this commit includes changes from previous like 1. General changes
Tested game 2 times - in English and Russian and fixed all the bugs with win checks, that arose because of localization. 2. BugsWhile testing games in different languages saw a bug with win condition in # The commit with the typo is not part of the main branch anymore.
git log --oneline | grep -v "rrrrr"This win condition is always true, because repository initially has 2 commits. The solution is: # _(The commit with the typo is not part of the main branch anymore.)
! git log --oneline | grep "rrrrr"There's one unresolved issue - 3. Suggestions
4. Next stepsIf you decide this pull request should be included in the repository, I suggest:
Looking forward to your feedback! |
This PR implements full localization support for Oh-my-git!
Summary
The goal is to allow non-English speakers to play the game and enable community to contribute translations easily.
Russian and Brazilian are added as the proof-of-concept languages.
In Brazilian all keys are "TRANSLATED" placeholders, Russian is translated by AI.
The following changes are included:
This scene is now in both main.tscn and level_select.tscn.
Plan
The next step will be migrating from .csv to the
.pot(Gettext) file format.Using
.potis the industry standard for localization and is officially recommended by the Godot documentation:https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_translations.html#doc-importing-translations
PR closes #18