-
Notifications
You must be signed in to change notification settings - Fork 1
/
TRANSLATOR.HOWTO
175 lines (128 loc) · 5.23 KB
/
TRANSLATOR.HOWTO
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Qtstalker Translator Howto v1.0
date (2009-04-11)
created by Yannick LE NY (y.le.ny at ifrance dot com )
In this text file, I give the main steps to translate Qtstalker in an other language.
See overview of the process:
"Internationalization with Qt"
http://doc.qt.nokia.com/internationalization.html
Here, I use a console like KDE Konsole or xterm .
1) Download Qtstalker code sources.
Stable release :
You can download Qtstalker code sources for the latest stable release here :
https://sourceforge.net/project/showfiles.php?group_id=25632
CVS developpment release :
a) install cvs package or software
b) Create a folder named qtstalker-cvs :
mkdir qtstalker-cvs
c) go in this folder :
cd qtstalker-cvs
d) get the latest CVS code sources by CVS (development branch):
cvs -z3 -d:pserver:anonymous@qtstalker.cvs.sourceforge.net:/cvsroot/qtstalker co -r qtstalker-qt4-branch qtstalker
2) Create the language file for your language :
a) Go in the i18n folder
cd qtstalker/i18n
b) create your language file :
exemple for french language file creation
cp -p qtstalker_xx.ts qtstalker_fr.ts
exemple for german language file creation
cp -p qtstalker_xx.ts qtstalker_de.ts
Here, you find fr in the file name for french language.
You can find the 2 letters that identify your language here :
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
3) Translate
a) Edit your language translation file, here qtstalker_fr.ts for french
with a text editor that can use UTF-8 format like kwrite or gedit (Linux) or Unired (MS Windows)
b) In you text editor, at the beginng of the file, you have :
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>BarEdit</name>
<message>
<location filename="../lib/BarEdit.cpp" line="70"/>
<source>Delete Record</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lib/BarEdit.cpp" line="64"/>
<source>Save Record</source>
<translation type="unfinished"></translation>
</message>
After translation in french, you have :
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>BarEdit</name>
<message>
<location filename="../lib/BarEdit.cpp" line="70"/>
<source>Delete Record</source>
<translation>Supprimer enregistrement</translation>
</message>
<message>
<location filename="../lib/BarEdit.cpp" line="64"/>
<source>Save Record</source>
<translation>Sauvegarder enregistrement</translation>
</message>
You need to do the same tasks in the translation file for your language.
Keyboard Shortcut (http://en.wikipedia.org/wiki/Keyboard_shortcut) problem, in the Qtstalker Menu there is letter with underscore to use shortcut.
In the text to translate here, there is & before the letter that is with underscore.
You need to reuse this letter in the translated text string in you language like this (letter u):
<message>
<location filename="../src/ChartPage.cpp" line="82"/>
<source>D&ump Chart Ctrl+U</source>
<translation>Vider le graphiq&ue Ctrl+U</translation>
</message>
If it is not possible, add after an alone letter with the underscore after the text strings translated in your language like this :
<message>
<location filename="../src/ChartPage.cpp" line="82"/>
<source>D&ump Chart Ctrl+U</source>
<translation>Vider le graphique &u Ctrl+U</translation>
</message>
3) Compile Qtstalker
a) configure step
cd ..
now you are in the qtstlaker main folder
start configuation :
./configure
....
when you use this command, you can see some useful things for the translator like these
********* Finished testing of Dependencies *********
/home/webadm/qtstalker-0.37-svn/qtstalker
Creating national language files in i18n ...
Updating 'i18n/qtstalker_fr.ts'...
Found 974 source text(s) (0 new and 974 already existing)
Same-text heuristic provided 100 translation(s)
Updating 'i18n/qtstalker_de.ts'...
Found 974 source text(s) (0 new and 974 already existing)
Done
Compiling existing translations ...
Updating 'i18n/qtstalker_fr.qm'...
Generated 370 translation(s) (247 finished and 123 unfinished)
Ignored 604 untranslated source text(s)
Updating 'i18n/qtstalker_de.qm'...
Generated 0 translation(s) (0 finished and 0 unfinished)
Ignored 974 untranslated source text(s)
Done
You may now 'make && sudo make install'
b) compile step
make
make install
(by default , qtstalker is installed in /usr/local/)
4) Start qtstalker
a) If /usr/local/lib is not in your LD_LIBRARY_PATH, do : export LD_LIBRARY_PATH=/usr/local/lib
b) launch qtstalker
cd /usr/local/bin
./qtstalker
5) Improve translation by incremental step :
a) update your qstalker translation file *.ts
b) save it
c) stop qstalker program
d) update the translation binary file *.qm
/usr/lib/qt4/bin/lrelease i18n/qtstalker_fr.ts
here fr in the file name for french translation
e) copy the binary translation file in the good folder
cp -p i18n/qtstalker_fr.qm /usr/local/share/qtstalker/i18n/
here fr in the file name for french translation
f) start qstalker program
g) check if your translation is good and OK