Gettext merge two po files




















This chapter explains the format of PO files. A PO file is made up of many entries, each entry holding the relation between an original untranslated string and its corresponding translation. All entries in a given PO file usually pertain to a single project, and all translations are expressed in a single target language.

One PO file entry has the following schematic structure:. The general structure of a PO file should be well understood by the translator. When using PO mode, very little has to be known about the format details, as PO mode takes care of them for her.

Entries begin with some optional white space. Usually, when generated through GNU gettext tools, there is exactly one blank line between entries. Then comments follow, on lines all starting with the character. There are two kinds of comments: those which have some white space immediately following the - the translator comments -, which comments are created and maintained exclusively by the translator, and those which have some non-white character just after the - the automatic comments -, which comments are created and maintained automatically by GNU gettext tools.

Comment lines starting with. Comment lines starting with , contain flags; more about these below. Comment lines starting with contain the previous untranslated string for which the translator gave a translation. After white space and comments, entries show two strings, namely first the untranslated string as it appears in the original program sources, and then, the translation of this string.

The original string is introduced by the keyword msgid , and the translation, by msgstr. The msgid strings, as well as automatic comments, are produced and managed by other GNU gettext tools, and PO mode does not provide means for the translator to alter these.

The most she can do is merely deleting them, and only by deleting the whole entry. On the other hand, the msgstr string, as well as translator comments, are really meant for the translator, and PO mode gives her the full control she needs. The comment lines beginning with , are special because they are not completely ignored by the programs as comments generally are. The comma separated list of flag s is used by the msgfmt program to give the user some better diagnostic messages.

Currently there are two forms of flags defined:. This flag can be generated by the msgmerge program or it can be inserted by the translator herself. PO and POT files are essentially the same. The difference is in the intended use.

This is why the two files have different extensions. The tool that scans your PHP source will produce a. This file includes only the original texts, which need translation.

You send this file to your translators. It will mark new or modified texts as needing translation and will leave existing translation intact. The best known tool is a program called poedit. A parser will go through your file and extract the texts for translation. It counts the words and calculates the cost for translation.

Then, you can choose translators for your project and get started. When translation is complete, you will receive back the completed PO and MO files. Translation can begin immediately and complete quickly as well. Our Software Localization projects are tuned to your needs exactly. Our system processes and translates the.

At the end of the translation process, you will receive translated. If you are not happy working with poEdit or you do not like the interface, there are quite some other options. Here, we will explore the most useful ones:. If you are a Vim power user, you can integrate PO automation tasks using the po. You can then use it in your terminal, and it will register several action helpers, such as moving to the next untranslated message, adding labels, or copying messages from different msgids.

This plugin will save you time and effort to automate keystrokes. For GNOME users, there is a similar tool called Gtranslator, which offers a few benefits, editing in multiple tabs and translation memory among others. The development branch is actively maintained and hosted in GitLab. However, its major limitation is that you need to have installed GNOME on your platform so this option is more suitable for Linux users. Desktop applications had their time.

Today, major SaaS providers offer tools that manage PO files in the cloud. This often includes more crucial and safer features, such as online backups, and the ability to transform messages into different formats.

Therefore, it is more safe and useful to use a software localization platform like Phrase. It offers support for PO files out of the box so when you sync those files, you have the option to export them into a different format. Finally, if you are working with a large team of developers, designers, translators, and managers, and if productivity is crucial to timely deliver translatable content, then a software localization platform is the way to go.

Find out all you need to know about localization from start to finish with our ultimate guide.



0コメント

  • 1000 / 1000