Home Explore Blog CI



postgresql

3rd chunk of `doc/src/sgml/nls.sgml`
ccb6e640e721d530f2de70965e198c2ddc2448e559d44d9d0000000100000fab
 then this program has been prepared
    for translation.
   </para>

   <para>
    If there are already some <filename>.po</filename> files, then
    someone has already done some translation work.  The files are
    named <filename><replaceable>language</replaceable>.po</filename>,
    where <replaceable>language</replaceable> is the
    <ulink url="https://www.loc.gov/standards/iso639-2/php/English_list.php">
    ISO 639-1 two-letter language code (in lower case)</ulink>, e.g.,
    <filename>fr.po</filename> for French.  If there is really a need
    for more than one translation effort per language then the files
    can also be named
    <filename><replaceable>language</replaceable>_<replaceable>region</replaceable>.po</filename>
    where <replaceable>region</replaceable> is the
    <ulink url="https://www.iso.org/iso-3166-country-codes.html">
    ISO 3166-1 two-letter country code (in upper case)</ulink>,
    e.g.,
    <filename>pt_BR.po</filename> for Portuguese in Brazil.  If you
    find the language you wanted you can just start working on that
    file.
   </para>

   <para>
    If you need to start a new translation effort, then first run the
    command:
<programlisting>
make init-po
</programlisting>
    This will create a file
    <filename><replaceable>progname</replaceable>.pot</filename>.
    (<filename>.pot</filename> to distinguish it from PO files that
    are <quote>in production</quote>. The <literal>T</literal> stands for
    <quote>template</quote>.)
    Copy this file to
    <filename><replaceable>language</replaceable>.po</filename> and
    edit it.  To make it known that the new language is available,
    also edit the file <filename>po/LINGUAS</filename> and add the
    language (or language and country) code next to languages already listed,
    like:
<programlisting>
de fr
</programlisting>
    (Other languages can appear, of course.)
   </para>

   <para>
    As the underlying program or library changes, messages might be
    changed or added by the programmers.  In this case you do not need
    to start from scratch.  Instead, run the command:
<programlisting>
make update-po
</programlisting>
    which will create a new blank message catalog file (the pot file
    you started with) and will merge it with the existing PO files.
    If the merge algorithm is not sure about a particular message it
    marks it <quote>fuzzy</quote> as explained above.  The new PO file
    is saved with a <filename>.po.new</filename> extension.
   </para>
  </sect2>

  <sect2 id="nls-translator-editing-po">
   <title>Editing the PO Files</title>

   <para>
    The PO files can be edited with a regular text editor. There are also
    several specialized editors for PO files which can help the process with
    translation-specific features.
    There is (unsurprisingly) a PO mode for Emacs, which can be quite
    useful.
   </para>

   <para>
    The translator should only change the area between the quotes after
    the msgstr directive, add comments, and alter the fuzzy flag.
   </para>

   <para>
    The PO files need not be completely filled in.  The software will
    automatically fall back to the original string if no translation
    (or an empty translation) is available.  It is no problem to
    submit incomplete translations for inclusions in the source tree;
    that gives room for other people to pick up your work.  However,
    you are encouraged to give priority to removing fuzzy entries
    after doing a merge.  Remember that fuzzy entries will not be
    installed; they only serve as reference for what might be the right
    translation.
   </para>

   <para>
    Here are some things to keep in mind while editing the
    translations:
    <itemizedlist>
     <listitem>
      <para>
       Make sure that if the original ends with a newline, the
       translation does, too.  Similarly for tabs, etc.
      </para>
     </listitem>

     <listitem>
      <para>
       If the original is a <function>printf</function>

Title: Creating and Editing PO Files
Summary
This section explains how to create a new translation effort by running the 'make init-po' command, copying the resulting template file, and editing it, as well as how to update existing PO files using 'make update-po' and editing them using a text editor or specialized PO file editors, with guidelines for translators on what to change and what to keep in mind while editing translations.