File: TRANSLATION.HOWTO

package info (click to toggle)
dvdisaster 0.72.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 20,088 kB
  • ctags: 6,526
  • sloc: ansic: 29,301; php: 3,324; sh: 370; xml: 296; makefile: 73; cs: 33
file content (142 lines) | stat: -rw-r--r-- 4,336 bytes parent folder | download | duplicates (3)
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

This document describes the process of adding a new translation
to dvdisaster. It is work in progress and not yet complete.

1) General information
----------------------

dvdisaster uses GNU gettext for internationalization. 

The following languages are currently maintained:

Czech		- Luboš Staněk (lubek@users.sourceforge.net)
English 	- Carsten Gnörlich (program author)
German 		- Carsten Gnörlich (program author)
Italian		- Andrea Polverini (polve@polve.com)
Portuguese	- Pablo Almeida (pabloalmeidaff9@gmail.com)	
Russian		- Igor Gorbounov (igorbounov@topazelectro.ru)
Swedish		- Daniel Nylander (info@danielnylander.se)

2) Requirements for translating dvdisaster
------------------------------------------

a) You MUST have a text editor capable of processing UTF-8.

b) Having a complete development environment (e.g. to
   compile dvdisaster from source) is recommended.

c) Some familiarity with GNU gettext is helpful, too.


It is possible to translate dvdisaster without fulfilling
b) and c). In that case you will simply be translating
entries in a text file without immediately seeing your 
translations in the actual dvdisaster application.
This is NOT recommended and can be _very_ tedious.

Contact carsten@dvdisaster.de for more information.

Appendix A) contains instructions for setting up a new
language by yourself if you just want to play around
with translating. 

Appendix B) is a memo for myself to properly set up
a locale. It is not strictly necessary for playing with
a new translation.


A) Maintainers tasks for adding a new language
----------------------------------------------

a) It is recommended that you start with a freshly unpacked
   source distribution. Otherwise, do at least:

   > make clean; make distclean

b) Make sure that your shell environment has the right settings
   for your locale (e.g. the language you want to translate into):

   > printenv | grep LANG
   LANG=de_DE.UTF-8

   The example above shows that the current locale is german.
   We will assume that your locale is xx_XX.

c) Create the initial translation file in the locale directory.
 
   > xgettext *.c -k_ -o locale/xx.po

   Then do:

   > msginit --locale=xx_XX -i locale/xx.po -o locale/xx.po

   Now invoke configure to have the new translation file 
   recognized by the build process:

   > ./configure
   > make

d) Start translating by looking for the following lines in locale/xx.po:

#: dvdisaster.c:<some line number>
msgid "test phrase for verifying the locale installation"
msgstr ""

#: dvdisaster.c:<some line number>
#, c-format
msgid ""
"This software comes with  ABSOLUTELY NO WARRANTY.  This\n"
"is free software and you are welcome to redistribute it\n"
"under the conditions of the GNU GENERAL PUBLIC LICENSE.\n"
"See the file \"COPYING\" for further information.\n"
msgstr ""

The idea of GNU gettext is to give the original message following
the "msgid" tag, and that you supply a translation after the "msgstr" tag.
Do NOT overwrite the original english message!

For example:

#: dvdisaster.c:<some line number>
msgid "test phrase for verifying the locale installation"
msgstr "ok"

#: dvdisaster.c:<some line number>
#, c-format
msgid ""
"This software comes with  ABSOLUTELY NO WARRANTY.  This\n"
"is free software and you are welcome to redistribute it\n"
"under the conditions of the GNU GENERAL PUBLIC LICENSE.\n"
"See the file \"COPYING\" for further information.\n"
msgstr ""
"My new translation\n"

dvdisaster should now show the translated greeting message.

Now you can start translating the other strings in locale/xx.po.
Do a 'make locale' everytime you have edited the xx.po file.

e) When a new version of dvdisaster comes out,
   compile the package and then do

msgattrib --untranslated locale/de.po

to find out about new untranslated strings.


B) Things to edit at the source level for a language
----------------------------------------------------

This should be fully automated, but alas, it isn't.

- Add translator to General information section in this file
- Add translator to CREDITS* files
- Edit GNUmakefile.template (PO_LOCALES)
- Double check that the translator gets credits in the about dialog
  text for his language
- Add localization information in the HTML documentation

- Add Windows codepage to dvdisaster.c
- Edit installer.template