wiki:Translating

Translating

SHR Applications supporting translations

  • opimd-utils
  • pyphonelog
  • shr-installer
  • libframeworkd-phonegui-efl (deprecated)
  • shr-settings
  • libphone-ui-shr

New Doc

It's just a idea of a rewritten doc, so feel free to make something better :)

On Launchpad

Translation is going to move to Launchpad platform. please, check  https://launchpad.net/shr-project for more information.

For every project

First time

To get the latest source from a project in git @ first time, you always should use

git clone http://shr.bearstech.com/repo/projectName.git

in Terminal/Console?.

For the several project's, you could visit  http://git.shr-project.org .

This command should create a new Folder with the name of the project.

Example:

git clone http://shr.bearstech.com/repo/opimd-utils.git
cd opimd-utils/

On work

If you already cloned a project from git and if you just want to update it with the new files from git, use

git pull http://shr.bearstech.com/repo/projectName.git

You have to do this in the projectfolder!

For example, on the example in First Time, you have to make

cd opimd-utils

if you're not in the opimd-utils folder.

Troubleshooting

If you have a problem by updating git with pull, which looks like

Updating 7e8b83d..f6454f9
error: Untracked working tree file 'data/po/de/opimd-messages.po' would be overwritten by merge.

you should backup your file and delete the original. If your file was commiting, you also could delete it without care (git would download the newest file from the shr-git, so you've got it then back)

Source- & compiled files

There are two art of files:

  • .po
  • .mo

The .mo-files are the compiled languagefiles which are used by the application to be translated.

The .po-files are the "sourcecode"-languagefiles which you could use to translate.

Structure of sourcefiles

Principali it's a realy easy thing!

In the programmcode is a key defined. This key is also the fallback-language, so if it's not set, it uses the key-value. A pair with a value looks like this:

msgid "Example"
msgstr "TranslatedExample"

So mostly you could translate the text by looking the keyword.

Comments

Optionaly, it's always good to write a comment, where the keyword is used in programmcode. This could looks like this:

#File: opimd-dates , Line: 33, 44

Share/commit your Translation

Just send the ".po" file to the  Shr-devel mailing list and your translation will hopefully be added to SHR.

Opimd-Utils

First:

git clone http://shr.bearstech.com/repo/opimd-utils.git

Then you should found it some folders in data/po/ with language-shortnames (as example "de").

In these folders are the diffrent .po-files for every application (as example opimd-dates.po for opimd-dates).

pyphonelog

First:

git clone http://shr.bearstech.com/repo/pyphonelog.git

Then you should found it some files in data/po with language-shortnames (as example "de.po").

shr-installer

First:

git clone http://shr.bearstech.com/repo/shr-installer.git

Then you should found it some files in data/po with language-shortnames (as example "de.po").

libframeworkd-phonegui-efl

First:

git clone http://shr.bearstech.com/repo/shr.git

Then you should found it some files in libframeworkd-phonegui-efl/po with language-shortnames (as example "de.po").

shr-settings

First:

git clone http://shr.bearstech.com/repo/shr-settings.git

Then you should found it some folders in data/po/ with language-shortnames (as example "de"). And in this folder you should find a file called shr-settings.po .

libphone-ui-shr

First

git clone http://shr.bearstech.com/repo/libphone-ui-shr.git

The you should find some files on libphone-ui-shr/po with language-shortnames (for example "de.po"). Don't forget to add your new language code to the file

libphone-ui-shr/configure.ca

on line

ALL_LINGUAS="ar ca de es fi gl pl ru"

Translate .desktop-files

.desktop-files are all the files which are on the desktop. :) You found them in /usr/share/applications . A normal structure looks like this:

[Desktop Entry]
Name=GPS & Map
Comment=Display map and GPS position
Encoding=UTF-8
Version=1.0
Type=Application
Exec=tangogps
Icon=tangogps
Terminal=false
Categories=GTK;Application;PIM
SingleInstance=true
StartupNotify=true

Name=GPS & Map means the Name which is showed. You could translate this easy, just add

Name[language-shortcut]]=translated text

As example, for german

[Desktop Entry]
Name=GPS & Map
Name[de]=GPS & Karte
Comment=Display map and GPS position
Encoding=UTF-8
Version=1.0
Type=Application
Exec=tangogps
Icon=tangogps
Terminal=false
Categories=GTK;Application;PIM
SingleInstance=true
StartupNotify=true

The same with comments, a translatet & untranslatet comment looks like that

Comment=Display map and GPS position
Comment[de]=Zeigt Karte und GPS-Position

1. Obtaining the source code

git clone http://shr.bearstech.com/repo/shr.git
git clone http://shr.bearstech.com/repo/shr-settings.git

You should now have the sources in a directory called shr and shr-settings.

2. Creating the .pot file manually

gettext needs to be installed for this part

libframeworkd-phonegui-efl

cd shr/libframeworkd-phonegui-efl
xgettext -C --foreign-user -kD_ -o libframeworkd-phonegui-efl.pot `find . -name "*.[ch]" -print`

You should now have file libframeworkd-phonegui-efl.pot in Your current working directory.

shr-settings

cd shr-settings
xgettext -L python --foreign-user -kD_ -o shr-settings.pot shr-settings `find . -name "*.py" -print`

You should now have file shr-settings.pot in Your current working directory.

3. Merging translations

If You're starting a new translation, the previously created .pot file can be moved to po/ll_CC.po, e.g. po/fi.po and edited with Your editor of choice.

If a ".po" file for Your language already exists, you should run the following command to avoid work duplication:

msgmerge -o program_name_updated.pot po/ll_CC.po program_name.pot

where

program_name_updated.pot is a name for the new .pot file, e.g. libframeworkd-phonegui-efl_updated.pot
po/ll_CC.po is the name of the .po file You wish to update, e.g. po/fi.po
program_name.pot is the name of the .pot file created in previous step, e.g libframeworkd-phonegui-efl.pot

program_name_updated.pot can now be edited with Your editor of choice and then moved to po/ll_CC.po

4. Share your Translation

Just send the ".po" file to the  Shr-devel mailing list and your translation will hopefully be added to SHR.

Or the even better way: use git to generate patches. For this just add your files: git add filename.po then commit you're changes localy: git commit -a And then generate a patch: git format-patch -1 Then just send that patch to SHR (You have to do this for every git repo)

State

Enter:

|| LanguageName        ||      Yes/No       ||      Yes/No      ||       Yes/No        ||              Yes/No              ||       Yes/No       ||          Yes/No       ||

Please change the status only if all files (also the .desktop ones!) have been translated!

Language name opimd-utils pyphonelog shr-installer libframeworkd-phonegui-efl shr-settings libphone-ui-shr
Arabian No No No No No No
Catalan No No No No Yes No
Chinese No No No No No No
Czech No No No No No No
Danish No No No No No No
English Yes Yes Yes Yes Yes Yes
Esperanto Yes Yes Yes Yes Yes No
Finnish No No No No No No
French No No No No No No
Galician Yes Yes Yes Yes Yes Yes
German No No No No No No
Greek Yes Yes Yes Yes Yes Yes
Ido No No No No No No
Icelandic No No No No No No
Italian No No No No No No
Japanese No No No No No No
Portuguese No No No No No No
Russian No No No No No No
Spanish Yes Yes Yes Yes Yes Yes
Swedish Yes Yes No No Yes Yes