How to get the .po file from .pot files

11,185

.pot and .po files are the same file format. .pot stands for "PO template". The difference being that you're supposed to use this template file and give it to your translators, who will produce the translated .po files. The .pot file is the template for several localized .po files. See http://www.gnu.org/software/gettext/manual/gettext.html#Files.

In other words, just renaming .pot to .po will do.
In the proper gettext workflow, there's the msginit tool for doing this, which will also set a number of headers to the correct values for the chosen locale.

Share:
11,185
MUY Belgium
Author by

MUY Belgium

I have a good advise for you : READ THE MANUAL and VALIDATE YOUR DATA!

Updated on June 13, 2022

Comments

  • MUY Belgium
    MUY Belgium almost 2 years

    I use cakePHP 2.0 and use the console tool to create one .../app/locale/default.pot . Now, I would like to get my site translated into multiple languages. I read the paragraph about internationalization in the cakephp cook book (http://book.cakephp.org/1.2/en/view/162/Internationalizing-Your-Application).

    I copy the default.pot files into

    • .../app/locale/eng/LC_MESSAGES/default.pot
    • .../app/locale/fre/LC_MESSAGES/default.pot
    • .../app/locale/pol/LC_MESSAGES/default.pot
    • ...

    And enter the tranalations string with an utf-8 text editor (as gedit). And ... my site do not get translated at all.

    I have noticed the AppController may implement some code to change the Configure::write('Config.language', some_three_letters_language), as the configuration changed nothing, I have implemented some very simple code.

    // in AppController
    public function beforeFilter() {
            Configure::write('Config.language', 'fre');
    }
    

    Why does the translation function always return it arguments and not the translated string in .pot files ( in views, __('Something') -answers-> 'Something')?

    I found nowhere were .pot files are translated into .po. How can I get those .po files, with REHL or CentOS (cannot get any suitable packet with po or poeditor in the name)?

    Thanks for your answer.

  • MUY Belgium
    MUY Belgium about 12 years
    Thank you for your answers. I have renamed my fre/RC_MESSAGES/default.pot into default.po but this did not solved the problem.
  • Gromski
    Gromski about 12 years
    "RC_MESSAGES"? Should be LC_MESSAGES.
  • MUY Belgium
    MUY Belgium about 12 years
    Yes, sorry, I have changed it. Do you know a way to check validity of .po files?
  • Gromski
    Gromski about 12 years
    Using any of the gettext utilities on it or a .po editor like Poedit should help you there.
  • MUY Belgium
    MUY Belgium about 12 years
    I do not grasp what happened but I destroyed all the translation strings and rebuild the all and ... it worked.