Bashstyle-NG. Application Localization Example

    The other day I went to gnomefiles.org to see if there was any interesting new software, or just updates for what I already installed. My attention was drawn to the update of bashstyle-ng , a graphical utility for customizing the appearance of the command line. Honestly, I didn’t even try the utility in action, since I do not like such stray and consider it unnecessary (no, well, it’s true, sometimes it’s easier to read man, and fix the configs with pens). But my attention was attracted by the comment of the author of the 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! Just leave a comment about that in your mail and I'll instruct you.

    The first thought was something like this: "Hmm, but what's the point of bothering?" Following her was overtaken by the following: “Well, ooh, I’m after all a supporter of opensource. So what if I don’t use this utility? After all, not everyone likes picking their configs ... ” Indeed, many novice users of Unix / Linux cannot immediately figure out the configs, moreover, many of them are not strong in English, plus everything, since I was called a supporter of opensource, it should be consistent. And so the decision was made: "Help-c."

    I contacted the author, he gave me instructions for localization. Since this was my first experience, I will not yet say that the instructions that I followed were universal, but nevertheless I will describe what I did, maybe someone will come in handy.

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

    At the same time, you need to take into account that you need to have gettext installed to run this command , the locale setting must be correct (that is, echo $ LC_ALL should return ru_RU.UTF-8 ), and watch the location of directories in the source tree when typing this command. This command will form a file filename-ru.po that will contain lines like
    msgid ="here_some_original_text"

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

    in which, accordingly, you need to make our translation.

    After 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 something like this line:
    langs += ["C", "de", "it"]

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

    after which we proceed directly to the installation and testing:
    ./configure –prefix=/path/to/install
    make mo #генерируем бинарник с переводом
    make install

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

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

    Thanks a lot!
    Chris

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

    Also popular now: