Diff for "Translations/YourProject/PartialPOExport"

Not logged in - Log In / Register

Differences between revisions 1 and 11 (spanning 10 versions)
Revision 1 as of 2009-01-21 17:13:23
Size: 1552
Editor: i577AA528
Comment: intial version
Revision 11 as of 2010-02-08 17:11:23
Size: 3341
Editor: cpc3-wolv12-0-0-cust183
Comment: page was renamed from Translations/Lao/PartialPOExport
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Translations/Lao/PartialPOExport
## page was renamed from Translations/YourProject/PartialPOExport
## page was renamed from Translations/PartialPOExport
~-[[FrontPage|Launchpad Help]] > [[Translations]] > Partial PO file exports -~
Line 2: Line 7:
Many translation files hosted at Launchpad.net have been imported from an upstream project. For various reasons these imported translations may be changed through the Launchpad.net web interface. In most cases theese changes should be provided back to the upstream project to give them the chance to incorporate these changes into the projects original translation files. Launchpad.net helps with this by providing the posibility to export only those strings from a PO file that were changed.
Line 4: Line 8:
== How to request the export ==
When you are on the web page for the PO file in question, select "Download" from the grey menu bar. You will be presented with the option to choose the file format for the download - either MO or PO format. If you choose the PO format, you will have the choice to either export the full file or just those strings that were changed since they were imported.
Distributions, such as Ubuntu, use Launchpad to translate the free software packages that make up the operating system. Where an upstream project has an existing translation effort, the distribution's translators can import the upstream PO files into Launchpad and either customise those translations to the distro's needs or even correct translation errors.

To make it easier for upstream projects to take advantage of this translation work, Launchpad can generate a partial PO file that contains only the translations that differ from the last imported upstream translation files.

== Requesting a partial export ==

When you are on the web page for the PO file in question, select "Download" from the grey menu bar. You will be presented with the option to choose the file format for the download - either ''PO format'', or ''MO format'', or ''Changes from packaged translations in partial PO format''. Choose the latter option for a partial export.
Line 8: Line 17:
Full PO files contain full gettext header information about the file. They can be edited offline and re-imported into Launchpad.net using the upload facility.
Line 10: Line 18:
Partial PO files do not contain the usual gettext header but only a warning about their nature. They cannot be re-imported into Launchpad.net because the import validation will reject them due to the missing header. Please use these files ''only'' to merge the translation strings into existing full PO files at the upstream project which then in turn may and should be imported into Launchpad.net again. While a standard PO file has a full gettext header, and so can be edited offline and then re-imported into Launchpad, the partial PO files that Launchpad provides do not have a header.

'''Note:''' partial PO files cannot be re-imported into Launchpad because their lack of a header makes them fail the import validation. Please use these files only to merge the translation strings into existing full PO files. Those merged PO files can then, of course, be imported into Launchpad.

== What can upstreams do with partial PO files ==

Partial PO files are useful for reviewing or merging into existing (upstream) PO files. Review can be as simple as going through all the messages and removing those you don't want to accept.

For merging, a further step is required: one has to add a content type declaration to partial PO files before using them with `msgcat` or `msgmerge`.

To do this, insert the following block at the start (right after the comment) of a partial PO export:

{{{
msgid ""
msgstr "Content-type: text/plain; charset=UTF-8\n"
}}}

After adding this bit to the exported partial PO file you got from Launchpad, you can merge this with the upstream PO file using:

{{{
msgmerge -o merged.launchpad.sr.po partial-export.sr.po upstream.sr.po
}}}

where partial-export.sr.po is a Launchpad-exported file with the content-type definition added, upstream.sr.po is the translation file from the upstream repository, and merged.launchpad.sr.po is a resulting merged file where translations from partial-export.sr.po override translations from upstream.sr.po.

If you want to give preference to upstream translations when merging, you can run something along the lines of
{{{
msgcat -o merged.upstream.sr.po --use-first upstream.sr.po partial-export.sr.po
}}}

To learn more about GNU gettext tools, look through the [[http://www.gnu.org/software/gettext/manual/gettext.html|documentation for gettext]].

||<tablestyle="width: 100%;"> ~-[[Translations|< Translations]] -~ ||

Launchpad Help > Translations > Partial PO file exports

Exporting partial gettext PO files

Distributions, such as Ubuntu, use Launchpad to translate the free software packages that make up the operating system. Where an upstream project has an existing translation effort, the distribution's translators can import the upstream PO files into Launchpad and either customise those translations to the distro's needs or even correct translation errors.

To make it easier for upstream projects to take advantage of this translation work, Launchpad can generate a partial PO file that contains only the translations that differ from the last imported upstream translation files.

Requesting a partial export

When you are on the web page for the PO file in question, select "Download" from the grey menu bar. You will be presented with the option to choose the file format for the download - either PO format, or MO format, or Changes from packaged translations in partial PO format. Choose the latter option for a partial export.

How partial PO files differ from full PO files

While a standard PO file has a full gettext header, and so can be edited offline and then re-imported into Launchpad, the partial PO files that Launchpad provides do not have a header.

Note: partial PO files cannot be re-imported into Launchpad because their lack of a header makes them fail the import validation. Please use these files only to merge the translation strings into existing full PO files. Those merged PO files can then, of course, be imported into Launchpad.

What can upstreams do with partial PO files

Partial PO files are useful for reviewing or merging into existing (upstream) PO files. Review can be as simple as going through all the messages and removing those you don't want to accept.

For merging, a further step is required: one has to add a content type declaration to partial PO files before using them with msgcat or msgmerge.

To do this, insert the following block at the start (right after the comment) of a partial PO export:

msgid ""
msgstr "Content-type: text/plain; charset=UTF-8\n"

After adding this bit to the exported partial PO file you got from Launchpad, you can merge this with the upstream PO file using:

msgmerge -o merged.launchpad.sr.po partial-export.sr.po upstream.sr.po 

where partial-export.sr.po is a Launchpad-exported file with the content-type definition added, upstream.sr.po is the translation file from the upstream repository, and merged.launchpad.sr.po is a resulting merged file where translations from partial-export.sr.po override translations from upstream.sr.po.

If you want to give preference to upstream translations when merging, you can run something along the lines of

msgcat -o merged.upstream.sr.po --use-first upstream.sr.po partial-export.sr.po

To learn more about GNU gettext tools, look through the documentation for gettext.

< Translations

Translations/YourProject/PartialPOExport (last edited 2010-02-08 17:11:23 by cpc3-wolv12-0-0-cust183)