📜 ⬆️ ⬇️

Bashstyle-ng. Application localization example

The other day I went to gnomefiles.org to see if there was any new interesting software, or just updates for what I have already installed. My attention was drawn to the update bashstyle-ng , a graphical utility for customizing the appearance of the command line. Honestly, I didn’t even try the utility in action, because I don’t like such pribludy and consider it redundant (no, well, really, sometimes it's easier to read man, and fix configs with pens). But my attention was attracted by the author's comment utility:
Looking for Translators!
If you are willing to translate BS-NG into another language then English or German, send me a mail.
If you don’t know how to translate - no problem! I'll post you comment.

The first thought was something like this: “Hmm, what’s the point of bothering?”. It was followed by the following: “Well, I am, after all, an opensource supporter. So what if I will not use this utility? Not everyone likes to poke around in configs ... ”. And indeed, many novice users of Unix / Linux can not immediately understand the configs, moreover, many of them are not strong in English, plus everything, since he called himself an adherent of opensource, then he should be consistent. And therefore it was decided: “We will help-c”.

I contacted the author, he gave me instructions on localization. Since this was my first experience, then I’ll not be able to talk about the instructions that I followed, I’ll be universal, but I’ll describe what I did, maybe it will be useful to someone.

In the source directory, we find the directory " translations / po " (or something similar to this). Then we execute the following command inside this directory:
msginit -i ../pot/filename.pot -o filename-ru.po -l ru_RU

It should be noted that to get this command, the installed gettext is needed, the locale setting must be correct (that is, echo $ LC_ALL should return ru_RU.UTF-8 ), well, follow the location of the directories in the source tree when typing this command. This command will generate a file filename-ru.po , which will contain strings such as
msgid ="here_some_original_text"

that is, lines with original texts, as well as lines of type
msgstr =""

in which, respectively, need to make our translation.
')
After the routine processing of the file, go to the directory (or several directories) above and look for the file filename.in . In this file, we need to find approximately the following line:
langs += ["C", "de", "it"]

I mean a list of locales, and fix it on something like this:
langs += ["C", "de", "it", "ru"]

then go directly to the installation and testing:
./configure –prefix=/path/to/install
make mo #
make install

and if everything went well, then after launch we will see a localized application.

Having spent just a couple of hours, I got a lot of pleasure from the work done, and after sending the language .po file to the utility author, I received a letter that raised my spirits even more:
Wow! That was fast :)
I just tested it, and the strings appear all.
You can grab the latest svn (revision 500) and see yourself in
the about-dialog (translators tab) :)

Thanks a lot!
Chris

Help people, share ideas, it's great, really :)

Source: https://habr.com/ru/post/56977/


All Articles