Development/Tutorials/Localization/Building KDE's l10n Module: Difference between revisions

From KDE TechBase
(x-test is updated by scripty once a day)
(Undo revision 88678 by Alexmerry (talk))
(9 intermediate revisions by 7 users not shown)
Line 5: Line 5:
name=Building KDE's l10n Module|
name=Building KDE's l10n Module|


pre=[[Getting_Started/Sources/Using_Subversion_with_KDE|Using Subversion with KDE]]<br>[[Getting_Started/Build/KDE4|Building KDE From Subversion]]<br>[[../i18n|Writing Applications With Localization in Mind]]|
pre=[[Getting_Started/Sources/Using_Subversion_with_KDE|Using Subversion with KDE]]<br>[[Getting_Started/Build|Building KDE From Subversion]]<br>[[../i18n|Writing Applications With Localization in Mind]]|


}}
}}
Line 13: Line 13:
For those working on applications in KDE's main repository, building and installing language support from KDE's localization (l10n) module is a good idea. Doing so will allow you to test applications in other languages so as to spot problems related to localization that may exist in KDE. Learn how to do just that in this tutorial.
For those working on applications in KDE's main repository, building and installing language support from KDE's localization (l10n) module is a good idea. Doing so will allow you to test applications in other languages so as to spot problems related to localization that may exist in KDE. Learn how to do just that in this tutorial.


== Step 1: kdesdk ==
== Step 1: l10n ==
 
First, checkout the <tt>kdesdk</tt> module from the repository, then build and install it. If you have trouble building the kdesdk module, you can skip the troublesome parts. The main thing you need from the kdesdk module is the poxml folder. Lokalize is also nice to have but not essential.
 
== Step 2: l10n ==


You must download, build and install each language in the l10n module separately. You can check out and build just the German, and XX languages using the following procedure:
You must download, build and install each language in the l10n module separately. You can check out and build just the German, and XX languages using the following procedure:
<syntaxhighlight lang="bash">
svn co -N svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4 l10n
cd l10n
svn up scripts
svn up templates
svn up x-test
svn up de
./scripts/autogen.sh de
./scripts/autogen.sh x-test
cd de
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
make
make install
cd ../..
cd x-test
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
make
make install
</syntaxhighlight>


svn co -N svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4 l10n
{{note|You need revpath (may be found in package {{program|imake}} or {{program|xutils-dev}}) to run <tt>autogen.sh</tt>}}
cd l10n
{{tip|Do not combine make and make install in a single step. It will not install anything.}}
svn up scripts
svn up templates
svn up x-test
svn up de
./scripts/autogen.sh de
./scripts/autogen.sh x-test


Once this is done, switch to your build directory, start cmake in the <tt>l10n/x-test</tt>, <tt>l10n/de</tt>, etc directories that you wish to build the language support for one at a time. You may then make and install from the build directory.
For KDE Frameworks 5 the steps are the same except <tt>l10n-kde4</tt> is replaced with <tt>l10n-kf5</tt> and <tt>kde4-config</tt> with <tt>kf5-config</tt>.


{{note|You need revpath (may be found in package imake) to run autogen.sh}}
== Step 2: Test An Application ==
{{tip|Do not combine make and make install in a single step. It won't install anything.}}


The {{path|./x-test/internal/update_xx.sh}} step uses the transxx program in kdesdk/poxml to automatically produce the XX language translation. If you were not able to build the kdesdk/poxml files, skip the {{path|./x-test/internal/update_xx.sh}} step. You'll have to rely on someone else running it and committing to the code repository.
To run your application using, for instance, the German catalogs open a terminal (e.g. {{program|konsole}}) and type:
<syntaxhighlight lang="bash">
KDE_LANG=de myapp
</syntaxhighlight>
where <tt>myapp</tt> is the name of the application you wish to test. Replace the <tt>de</tt> with the language code you wish to test, e.g. <tt>x-test</tt>.


== Step 3: Test An Application ==
The German language is a good choice for testing the layout of your application, as German translated strings tend to be quite long. French is also a good choice. The x-test language is useful for identifying strings in your application that are not translated.


To run your application using, for instance, the German catalogs open a terminal (e.g. konsole) and type:
KDE Frameworks 5 does not use <tt>KDE_LANG</tt>, so for KDE Frameworks 5 use this instead:
 
<syntaxhighlight lang="bash">
KDE_LANG=de myapp
LANGUAGE=de myapp
 
</syntaxhighlight>
where "myapp" is the name of the application you wish to test. Replace the "de" with the language code you wish to test, e.g. "x-test".
 
The German language is a good choice for testing the layout of your application, as German translated strings tend to be quite long. French is also a good choice. The x-test language is useful for identifying strings in your application that are not translated.

Revision as of 12:32, 11 March 2016

Building KDE's l10n Module
Tutorial Series   Localization
Previous   Using Subversion with KDE
Building KDE From Subversion
Writing Applications With Localization in Mind
What's Next   n/a
Further Reading   n/a

Abstract

For those working on applications in KDE's main repository, building and installing language support from KDE's localization (l10n) module is a good idea. Doing so will allow you to test applications in other languages so as to spot problems related to localization that may exist in KDE. Learn how to do just that in this tutorial.

Step 1: l10n

You must download, build and install each language in the l10n module separately. You can check out and build just the German, and XX languages using the following procedure:

svn co -N svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4 l10n
cd l10n
svn up scripts
svn up templates
svn up x-test
svn up de
./scripts/autogen.sh de
./scripts/autogen.sh x-test
cd de
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
make
make install
cd ../..
cd x-test
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
make
make install
Note
You need revpath (may be found in package imake or xutils-dev) to run autogen.sh
Tip
Do not combine make and make install in a single step. It will not install anything.


For KDE Frameworks 5 the steps are the same except l10n-kde4 is replaced with l10n-kf5 and kde4-config with kf5-config.

Step 2: Test An Application

To run your application using, for instance, the German catalogs open a terminal (e.g. konsole) and type:

KDE_LANG=de myapp

where myapp is the name of the application you wish to test. Replace the de with the language code you wish to test, e.g. x-test.

The German language is a good choice for testing the layout of your application, as German translated strings tend to be quite long. French is also a good choice. The x-test language is useful for identifying strings in your application that are not translated.

KDE Frameworks 5 does not use KDE_LANG, so for KDE Frameworks 5 use this instead:

LANGUAGE=de myapp