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>"
&follow=1'> r655@Devoty: necoro | 2008-01-18 03:04:53 +0100Necoro1-1/+1 2008-01-18 r651@Devoty: necoro | 2008-01-18 02:41:51 +0100Necoro3-393/+513 2008-01-18 r643@Devoty: necoro | 2008-01-16 18:55:49 +0100Necoro14-249/+525 2008-01-14 r634@Devoty: necoro | 2008-01-14 23:48:24 +0100Necoro3-1/+4 2008-01-14 r632@Devoty: necoro | 2008-01-14 23:44:52 +0100Necoro3-175/+181 2008-01-14(no commit message)Necoro10-758/+1014 2008-01-14 r621@Devoty: necoro | 2008-01-14 20:21:40 +0100Necoro2-21/+61 2008-01-14 r618@Devoty: necoro | 2008-01-14 20:19:05 +0100Necoro2-35/+57 2008-01-14 r617@Devoty: necoro | 2008-01-14 19:12:59 +0100Necoro2-10/+10 2008-01-14 r609@Devoty: necoro | 2008-01-14 17:04:38 +0100Necoro9-394/+477 2008-01-14 r605@Devoty: necoro | 2008-01-14 11:43:34 +0100Necoro2-26/+129 2008-01-14 r603@Devoty: necoro | 2008-01-14 11:30:26 +0100Necoro4-26/+38 2008-01-11 r598@Devoty: necoro | 2008-01-10 16:36:29 +0100Necoro4-10/+50 2008-01-11 r597@Devoty: necoro | 2008-01-10 14:12:35 +0100Necoro1-3/+3 2008-01-10 r595@Devoty: necoro | 2008-01-10 04:04:15 +0100Necoro1-52/+3 2008-01-09 r586@Devoty: necoro | 2008-01-09 14:54:18 +0100Necoro1-1/+1 2007-12-06 r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108