Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quickstart instructions for intltool #159

Merged
merged 1 commit into from Dec 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -31,13 +31,35 @@
</para>
<para>
Each translatable element in the <filename>.xml.in</filename> file needs to be prefixed with an underscore (<code>_</code>) to be marked as translatable.
Apart from that, the same specifications apply to this file as for any other AppStream metadata.
This should include the <code>name</code>, <code>summary</code>, and <code>caption</code> tags, as well as each paragraph in the
<code>description</code>. Apart from that, the same specifications apply to this file as for any other AppStream metadata.
</para>

<para>
TODO: Fill in some generic examples how Intltool can be used.
To translate the appstream data, first add the <filename>.xml.in</filename> file to <filename>po/POTFILES.in</filename>, along with any other
translatable files. Then create the translation template file <filename>&lt;package name&gt;.pot</filename>.
</para>

<programlisting language="Bash"><![CDATA[cd po; intltool-update --pot --gettext-package=<package name>]]></programlisting>

<para>
For each supported language, copy the template file to <filename>po/&lt;language&gt;-[&lt;COUNTRY&gt;].po</filename>, where
<filename>po/&lt;language&gt;</filename> and the optional <filename>po/&lt;COUNTRY&gt;</filename> are standard two-letter codes.
Edit the file to add translated strings.
</para>

<para>
As the translatable content is updated, recreate the template file, and update the <filename>.po</filename> files.
</para>

<programlisting language="Bash"><![CDATA[cd po; intltool-update --dist --gettext-package=<package name> <language>]]></programlisting>

<para>
Create the translated <filename>.xml</filename> with the following command.
</para>

<programlisting language="Bash"><![CDATA[intltool-merge -u -c ./po/.intltool-merge-cache ./po -x <file>.xml.in <file>.xml]]></programlisting>

<section id="qsr-l10n-intltool-autotools">
<title>Integrating with Autotools (the AppStream way)</title>
<para>