git-learning-game / oh-my-git

An interactive Git learning game!
https://ohmygit.org
Other
2.04k stars 146 forks source link

I18n #146

Closed m0rp30 closed 1 year ago

m0rp30 commented 2 years ago

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:

What do you think?!?!

oliveirafilipe commented 2 years ago

Just a matter of organization:

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 commented 2 years ago

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 commented 2 years ago

It's a good idea !!!

m0rp30 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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! :green_heart:

blinry commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 :smile: but I have some questions:

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

@blinry and @schokotets what do you think ?

schokotets commented 2 years ago

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 commented 2 years ago

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

I hope it' fine :smile: