Terasology: New tutorial module request: i18n

Created on 21 May 2017  路  20Comments  路  Source: MovingBlocks/Terasology

As indicated in PR #2918 we should better highlight how to provide and use internationalization assets, including now in modules with that PR merged.

Translation still needs plenty of work (like #2433, #2677, or #2621) as well as better documentation, but we have a decent start and it would be nice to have a typical tutorial module that shows how it works.

Little trickier to have any sort of integration with Weblate in the tutorial. But maybe that'll be a good time to try setting up a first module project in Weblate that's linked with the new tutorial module?

Some of the basics here would be fairly easy to do, so bite-sized for that. It could get pretty involved over time though.

Documentation Good First Issue Logistics UI

Most helpful comment

Okay okay cool. Me and @Cervator spoke about what all could be added to this on IRC. I'll surely talk about where one can get TranslationSystem. Webplate is surely on the list of things to be added 馃槃

All 20 comments

Hey, I would like to work on this issue!

Hi @TheFlash98,

just go ahead 馃槃 Did you already familiarize with the code base and i18n in particular? Also have a look at the other tutorial modules to get an idea of what we are aiming for here.

You can start your work in a repo called TutorialI18n which can later be transferred to the Terasology organization. An alternative might be to include a section about i18n in the [TutorialAssetSystem], whatever you think is best.

Actually I am completely new to Terasology. Could you guide me a bit further? I have the project locally running. I have not familiarised myself with i18n? Could use your help @skaldarnar

Then be welcome (and say "hi" in our [forum] sometime). 馃槂

Issue #2918 linked above briefly explains how to use the i18n in Terasology. PR #2732 demonstrates how to change hardcoded string in english to use the translation system instead. A couple of new languages were added during GCI, for instance in PR #2737.

For a start, you could try to create a new module with a simple command and two languages. Pay attention to the format in which translation keys are specified, etc. If you have any questions, hop on our IRC channel #terasology on freenode, there are usually people lurking around who can help you.

And here is a guide derived from #2918 : https://oniatus.github.io/developing/translation.html

@skaldarnar and @oniatus thanks for your help. I had a look at the tutorials and issue #2918 and PR #2732
The guide https://oniatus.github.io/developing/translation.html gave me a good idea as to how i18n and i10n work. I fetched the module TutorialAssetSystem. How should I go about making a tutorial?

I even posted to the Forum @skaldarnar 馃槃

I'll try to give you a (very brief) overview of the next steps here. Please make sure to double check all the commands and names I typed in (no guarantee for 100% correct syntax or absence of typos) :wink:

You can create your own new module using gradlew by typing
./gradlew createModule<moduleName>, in your case it might be ./gradlew createModuleTutorialI18n.

This will create a new, empty module in the modules folder. Start adding examples for usage of i18n in modules there. You could begin with a console command. The module is already git enabled, so you can directly commit your changes.

On your GitHub account, create a new repository matching the name of the module, e.g. TutorialI18n. Add this repository as remote to your new module by running the following command from the module directory: git remote add origin https://github.com/TheFlash98/TutorialI18n. Now you can push your changes.

All the existing tutorial modules use the GitHub wiki for further documentation (you might need to enable it in the repository settings).

If you have the repository set up just post a link here so that we can review it and give you some feedback. Eventually, the repository can be moved to the MovingBlocks org to be in the "official" lineup 馃槂

Thank you so much for your help. I'll post link as soon as I set it all up.

Here's the link https://github.com/TheFlash98/TutorialI18n

All your commands were perfect 馃槢

Correct me if I'm wrong, you want something like this for i18n?
https://github.com/Terasology/TutorialWorldGeneration
From what I understood by looking at the repo, that this a tutorial on How to Generate Worlds in the game. It has some code samples and a wiki guide.

@skaldarnar have a look! 馃槃
Not yet complete. Just some progress
https://github.com/TheFlash98/TutorialI18n/wiki

It's too bad that github does not allow comments, like Google Docs.. (or does it?)

Based on a first reading, the tutorial seems like a pretty good starting point.

My nitpicks:

  • Logger.info isn't exactly a pop-up :P
  • A bit more editing and proof reading would be awesome. For instance, You wouldn't want a Spanish player to see this, he/she was would may be prefer seeing "Hola nuevo jugador"

Apart from that, great work!

@vampcat thanks a lot! What should I replace pop-up with? Message may be? 馃槢

For some reason whenever I am not able access the webplate. Could you help me? I need to add it to the tutorial. @skaldarnar
http://translate.terasology.org/

Weblate is accessible for me. You won't find your module there (or any other module) - that has to be configured manually. We tend to use it only for the larger/more solid projects (yet), probably we should consider enabling it (or something like that) for modules as well.

I really like what you have so far, stating the motivation for i18n and all that!

Alright. What else do you want me to add? Should I talk about the webplate yet?

@skaldarnar ? 馃槃

Looks really good to me. Maybe just mention where to get the TranslationSystem from (you can do it like that in any system using the @In annotation).

If you want, add some lines about Weblate (how to use it, what account you need, how to request a new translation, etc.).

Anyways, closing this issue as it is officially in place now :-)

Okay okay cool. Me and @Cervator spoke about what all could be added to this on IRC. I'll surely talk about where one can get TranslationSystem. Webplate is surely on the list of things to be added 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cervator picture Cervator  路  4Comments

emanuele3d picture emanuele3d  路  3Comments

nihal111 picture nihal111  路  4Comments

brylie picture brylie  路  3Comments

Qwertygiy picture Qwertygiy  路  6Comments