Skip to content
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

I18n #146

Closed
wants to merge 53 commits into from
Closed

I18n #146

wants to merge 53 commits into from

Conversation

m0rp30
Copy link

@m0rp30 m0rp30 commented Aug 19, 2022

#18 #129 @schokotets @blinry

Ok guys i have refactoring the localization system, and for me it's came out very well.

I following your suggestions, i have concentrade all traduction files in the "locale" folder.

I have make three template files:

  • cards.pot -> All descriptions of the cards
  • levels.pot -> All the titles, descriptions, congrats and other of the levels
  • text.pot -> All text you can find in the scenes
  • Requirement
  • gettext
  • po editor (I used poedit)
  • Process
  1. Generate .po file in your localization (es. es_ES-text.po ) with template files (.pot)
  2. Upload the files on Project -> Project settings -> Localization at Godot
  3. Add an item to the dictionary "languages" at the file game.gd (es. var languages = {"en": tr("English"), "it": tr("Italian"), "es": tr(Spanish)} # Localizations allowed
  4. Make traduction

What do you think?!?!

m0rp30 and others added 30 commits September 6, 2021 12:25
localization: refining italian translation. part 1
localization: refine italian translation. part 2
Co-authored-by: schokotets <moritzleni@gmail.com>
scenes/levels.gd Outdated
@@ -3,14 +3,14 @@ extends Node
var chapters

func _ready():
var lang = game.lang
var lang = game.os_lang

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering: what is the variable lang used for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry ... my mistake!!!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excuse me i don't have sync last commit in pull request! Now all is sync.

@@ -3,7 +3,7 @@ cards = checkout commit-auto

[description]

The yellow boxes are frozen points in time, we call them "commits"! You can travel between them using the "checkout" card! (Try it!)
The yellow boxes are frozen points in time, we call them 'commits'! You can travel between them using the "checkout" card! (Try it!)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is only a pair of double quotes changed to singe ones?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In .po files, the msgid is wrap in double quotes and the string must match perfectly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case i have changed manually that string for test but in the script i have add code to replace the double quote in single quote

@oliveirafilipe
Copy link

oliveirafilipe commented Aug 29, 2022

Just a matter of organization:

  • What if each language´s files was inside a folder of its own?

locale folder could get huge with 3 files for each possible language.
For example:

$ pwd
./oh-my-git/locale

$ ls -R
.:
babelrc  cards.pot  it_IT/  levels.pot  pt_BR/  text.pot

./it_IT:
it_IT-cards.po  it_IT-levels.po  it_IT-text.po

./pt_BR:
pt_BR-cards.po  pt_BR-levels.po  pt_BR-text.po

@oliveirafilipe
Copy link

oliveirafilipe commented Aug 29, 2022

Some other thoughts:

  1. Maybe the "Language" button should always be in English, or at least contain the "Language" word, for example: "Linguaggio/Language", because I can end up in a language I don't know without being able to go back to English because I can't read which button would do that.
  2. I can't find the reason right now, but no alphabet other than Latin seems to be working (i.e: Cyrillic, Slavic, Chinese)

@m0rp30
Copy link
Author

m0rp30 commented Aug 31, 2022

It's a good idea !!!

@m0rp30
Copy link
Author

m0rp30 commented Aug 31, 2022

Some other thoughts:

  1. Maybe the "Language" button should always be in English, or at least contain the "Language" word, for example: "Linguaggio/Language", because I can end up in a language I don't know without being able to go back to English because I can't read which button would do that.
  2. I can't find the reason right now, but no alphabet other than Latin seems to be working (i.e: Cyrillic, Slavic, Chinese)
  1. It's a way, but for me it's also nice to translate it
  2. The reason it's the fonts but i don't really sure how to fix it

@schokotets
Copy link

schokotets commented Sep 8, 2022

Hello @m0rp30, thanks again for your willingness to contribute! It is outstanding how quickly you've continued to take feedback and work on your contribution, and how much effort you're putting into it. As stated before, i18n plays a big role in making the game accessible to a larger audience, so your contributions are so valuable!

Sorry for getting back to you so late, I haven't had the time to review it thoroughly so far, so I'll stay brief for this comment.
I like the way you've realized translating cards & texts! It's great to use the .po format, it integrates nicely with existing tooling and Godot's translation mechanisms. I'd like to discuss the folder structure and file naming at a later point.

Concerning the levels: I've discussed the structure of internationalizing the levels themselves again with @blinry . We would like to stick to our suggestion of not using the .po format with extracted strings, but instead having multiple copies of the levels' files for the different languages. We want to pursue this approach because we think that we should prioritize quality and completeness of translation. For this, we want translators to be able to change the git commands and file names, and perhaps even the amount and kinds of files available, to be able to translate as much of the level as possible and to allow adaptation for cultural appropriateness. We would not see this realized fully if we extracted strings from the level files.

Can you agree with our prioritization and follow our conclusions? If so, please rework your pull request to eliminate the *levels.po files and instead, in each level's folder, have a folder for the level's part, and in it a file for each language. For example. the merge level:

merge (directory)
├── conflict (directory)
│   └── en (file)
├── merge (directory)
│   └── en (file)
├── merge-abort (directory)
│   └── en (file)
└── sequence (file)

3 directories, 4 files

@blinry
Copy link
Member

blinry commented Sep 8, 2022

I also wanted to chime in with huge thanks to both @m0rp30 for working on this PR, as well as @schokotets for making sure that the translation feature will be as good as it can be! 💚

@blinry
Copy link
Member

blinry commented Sep 8, 2022

@oliveirafilipe I like your idea that the language switching button should always include both the label "English", as well as the native language, that would be perfect.

And the problem with the missing characters is likely that our font Cabin, doesn't include Cyrillic/Slavic/Chinese glyphs. We would need to look for a fallback font for those languages.

@m0rp30
Copy link
Author

m0rp30 commented Sep 13, 2022

Hello @m0rp30, thanks again for your willingness to contribute! It is outstanding how quickly you've continued to take feedback and work on your contribution, and how much effort you're putting into it. As stated before, i18n plays a big role in making the game accessible to a larger audience, so your contributions are so valuable!

Sorry for getting back to you so late, I haven't had the time to review it thoroughly so far, so I'll stay brief for this comment. I like the way you've realized translating cards & texts! It's great to use the .po format, it integrates nicely with existing tooling and Godot's translation mechanisms. I'd like to discuss the folder structure and file naming at a later point.

Concerning the levels: I've discussed the structure of internationalizing the levels themselves again with @blinry . We would like to stick to our suggestion of not using the .po format with extracted strings, but instead having multiple copies of the levels' files for the different languages. We want to pursue this approach because we think that we should prioritize quality and completeness of translation. For this, we want translators to be able to change the git commands and file names, and perhaps even the amount and kinds of files available, to be able to translate as much of the level as possible and to allow adaptation for cultural appropriateness. We would not see this realized fully if we extracted strings from the level files.

Can you agree with our prioritization and follow our conclusions? If so, please rework your pull request to eliminate the *levels.po files and instead, in each level's folder, have a folder for the level's part, and in it a file for each language. For example. the merge level:

merge (directory)
├── conflict (directory)
│   └── en (file)
├── merge (directory)
│   └── en (file)
├── merge-abort (directory)
│   └── en (file)
└── sequence (file)

3 directories, 4 files

sorry if I answer only now, I didn't understand the hint for the levels, i will immediately proceeded to change the system for the levels and do the merge

@m0rp30
Copy link
Author

m0rp30 commented Sep 13, 2022

OK, now the system and italian traduction it's ok, the levels have a specific directory with translated files and the other strings have .po file for the traductions

@oliveirafilipe
Copy link

Hi @m0rp30, just to point out, I think your solution its slightly different from the proposed by @schokotets, but I think both of them work nicely.

@m0rp30
Copy link
Author

m0rp30 commented Sep 13, 2022

Hi @m0rp30, just to point out, I think your solution its slightly different from the proposed by @schokotets, but I think both of them work nicely.

Ok ... now I understand ... I'm a bit brainless 😄 but I have some questions:

  • What level do we show if the translation is not finished (if we show it!)
  • If one or more languages have more levels than the original (English), we heve to make the English version also
  • For me, it's a bit more complicated to track the point of the traduction
  • My system it's more easy to make

I can make an other pull request with the @schokotets's system and test it !!!

@blinry and @schokotets what do you think ?

@schokotets
Copy link

Hi @m0rp30 , glad you got to implementation so quickly, It's a shame I haven't seen your message earlier.

The thought behind the proposed folder structure was the following: make it as hard as possible to deviate from the given structure (which parts a level contains) in different translations. This assumes that we'd want to enforce keeping the different levels' translations in the same structure — is that right, @blinry ?

I try to expand the proposed folder structure by the Italian translation to explain it better.

merge (directory)
├── conflict (directory)
│   ├── en (file containing the "conflict" part of the "merge" level in English)
│   └── it (file containing the "conflict" part of the "merge" level in Italian)
├── merge (directory)
│   ├── en (file containing the "merge" part of the "merge" level in English)
│   └── it (file containing the "merge" part of the "merge" level in Italian)
├── merge-abort (directory)
│   ├── en (file containing the "merge-abort" part of the "merge" level in English)
│   └── it (file containing the "merge-abort" part of the "merge" level in Italian)
└── sequence (file containing the sequence of the level parts)

Also, the motivation behind keeping the custom level format was to allow translation of the multiple "virtual file"s' names in each level. E.g. in levels/it/index/steps (referencing your file structure), the bottle file could be called bottiglia (if my assumption about Italian is correct).

@blinry and I see find it valuable to provide the freedom of varying the shell scripts. This includes file names, as described in the previous paragraph. Furthermore, what needs to be done precisely for each level could be changed to be more culturally appropriate. E.g. instead of having two files knife and fork, it could be a single file chopsticks. Or varying the task, e.g. not taking the bus to disco, but inviting family for a dance, and whatever changes in script this procures. While this may not find application in the current state of the project, we'd like to provide the opportunity for adaptations of this kind.

Having a .po file structure is problematic, in our eyes: it would harden the level's internal phrasing and leave less room to adapt. It would nudge translators towards literal translation, instead of rewriting little stories in the level parts.

To address your questions and concerns:

What level do we show if the translation is not finished (if we show it!)

The easiest would be to show the English version. However, this is not ideal, because English might not be the player's next best language. Therefore, I'd suggest offering a language picker dialog every time this happens to select a fallback language.

If one or more languages have more levels than the original (English), we heve to make the English version also

I believe that's not the case, as my proposed folder structure doesn't really enforce an 'original' language. New levels could start out in other languages.

For me, it's a bit more complicated to track the point of the traduction
My system it's more easy to make

I see, this is the disadvantage of deviating from using the .po file format and tooling. However, @blinry and I find it a worthwhile discomfort, because it enables better, more adaptable translation, as explained further up.

Can you follow our argumentation, do you agree? We could also discuss the details here, if you'd like, before having to do it one way and then un-doing too much which one could've been spared of.

Thanks for keeping to work on this, I'm so happy to see it come together so nicely :)

@m0rp30
Copy link
Author

m0rp30 commented Oct 5, 2022

Ok, I made another pull request #152 where I created the layer structure as suggested by @schokotets.

I hope it' fine 😄

@m0rp30 m0rp30 closed this Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants