chrys87 / fenrir

An TTY screenreader for Linux.
GNU Lesser General Public License v3.0
47 stars 13 forks source link

Finish translation implementation in all fenrir's messages #9

Closed manuelcortez closed 7 years ago

manuelcortez commented 7 years ago

Hope I didn't forget any message.

chrys87 commented 7 years ago

Thanks for your hard work on that! i may add you as an maintainer to the master repo. thanks for all your contribution. together we will make fenrir to the most awsome CLI screen reader on world :). one thing: can you tell me what i need to do in "install.sh" to install the tranlations properly? and how to create a new one?

chrys

manuelcortez commented 7 years ago

Hello, thank you! I have accepted the invitation already, let's do it! Regarding about translations, I have used poedit for taking the .pot file and creating a new translation from it, but as far as I know, you'll need the following:

  1. Create the same folder structure, following the two letter ISO code for every language, for example locale/de/LC_MESSAGES.
  2. If you want to create a new file, In the tools directory (or where the .pot file exists), run the following command: msginit --locale=langcode --input=fenrir.pot
  3. Move the po file to the locale's directory that you have created and Edit the PO generated file translating what you want.
  4. Once done, for creating the machine readable translation, run something like this in the locale/langcode/LC_MESSAGES directory or where you have your .po file: msgfmt -o lang.mo lang.po. And that's done!
  5. If you add new content to the fenrir's messages (remember that translatable strings should be in the form like _("string")), go to the tools directory and run the generate_translations.sh (I think we could change it to generate_template though).
  6. For updating your language, we should run the following command, also in the tools directory: msgmerge --output-file=../locale/langcode/LC_MESSAGES/fenrir.po ../locale/langcode/LC_MESSAGES/fenrir.po fenrir.pot
  7. After updating, run the step 4.

For installing a translation properly you need to copy the fenrir.mo file (located in every locale/language/LC_MESSAGES) to the system's localization folder (in raspbian this is in /usr/share/locale), so you'll have to see a structure like /usr/share/locale/es/LC_MESSAGES/fenrir.mo, and so for other languages.