summaryrefslogtreecommitdiff
path: root/doc/TRANSLATING
blob: 4b49fa5a0675f4f3421e6565cb1cf55bd750a663 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#--------------------------------------#
| INSTRUCTIONS FOR TRANSLATING PORTATO |
#--------------------------------------#

PRENOTE: This document is copied from the porthole project and slightly changed afterwards.
Thanks guys :)

The recommended way to translate Portato into another language is to use
"Poedit" (app-i18n/poedit). However you might want to try out either
KBabel (kde-base/kbabel) or Gtranslator (app-text/gtranslator).


Getting the sources:
===================

You do need the sources to make translations. The installed program is not sufficient.
Change into a local directory where you want to have the sources installed.
Then do:

> bzr pull lp:portato

You now should have the actual sources in the "portato" subdirectory.


To update an incomplete translation:
===================================

If there is a translation for your language already, then open the .po file in
portato's i18n/ directory with Poedit (e.g. pl.po = Polish, fr_FR.po = French
(France)). Select "Update from POT file" from the "Catalog" menu, then choose
the messages.pot file in the i18n/ directory. Untranslated strings will be
highlighted and placed at the top of the list. Translate them and save the file!


To create a new translation:
===========================

Open poedit and Select "New catalog from POT file" from the "File" menu, and
choose the messages.pot file in portato's i18n/ directory. Translate, then save
the file (also in the i18n/ directory) as <lang>.po where <lang> is the two
letter code for your language, optionally followed by a two letter modifier.
For example en.po would be for English, en_GB.po would be specifically for
British English.


Important notes about placeholders:
==================================

The translatable strings in the messages.pot catalogue and the <lang>.po files
are partially in Python's string format, partially in GTK's. The following items
should be included in translated strings as placeholders for names or figures:

"%s" : string placeholder
"%d" : number placeholder
"%(days)d" : placeholder named "days", do not translate the name
pretty much anything starting with "%"

Html-Tags ("<b>some_text</b>") should be kept as is and only the text in between
has to be changed.

In addition, the underscore (_) is used to indicate that the next character will 
be used as the accellerator key. When the user presses "CTRL" + this key, it will 
perform the item's action. These are not required, but if you use them the 
characters chosen must all be different.

Strings like "gtk-quit", "gtk-cancel" etc. must not be translated.


To test your translation:
========================

run the "pocompile" script in the portato directory:

> ./pocompile.sh

This will compile all the .po files in i18n/ into .mo files (which
gettext uses when translating Portatot) and place them in the necessary
subdirectories (<lang>/LC_MESSAGES).

Now you can run the local portato version in your language:

> ./portato.py

If you are not seeing your language, make sure the environment variable "LANG" 
is set to your language code.
For example, to run portato using the German translation:

> LANG="de_DE" ./portato.py


To submit the translation so we can include it in Portato distributions:
========================================================================

The easiest method is to post it to a tracker on portato's site: 
http://portato.origo.ethz.ch/issues

Or send a mail to portato@necoro.net


I found a string in Portato that I can't translate! What gives?:
================================================================

Post a bug report on the sourceforge site
(http://portato.origo.ethz.ch/issues). Include the untranslatable string
and where in Portato you came across it. It's easy for us to mark the strings
for translation, but we may have missed some!


I don't want to use a stupid GUI, they are plain text files!:
============================================================

The .po files are indeed plain text files. If you don't want to use poedit for
some reason, these gettext commands might come in handy:

Update a .po file from the messages.pot file:
> "msgmerge <lang>.po messages.pot > newpofile.po"

Create a new .po file from the messages.pot file:
> "msginit -i messages.pot -l <lang>"
deletions'>-0/+12