| Version 11 (modified by skamster, 4 years ago) (diff) |
|---|
Translating
SHR Applications supporting translations
- opimd-utils
- pyphonelog
- shr-installer
- libframeworkd-phonegui-efl
- shr-settings
New Doc
It's just a idea of a rewritten doc, so feel free to make something better :)
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
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 .
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.
