forked from brookinsconsulting/ezcommunity2
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTRANSLATION
193 lines (147 loc) · 6.91 KB
/
TRANSLATION
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
eZ trade / eZ publish 2 translation guide
---------------------------------------
This is an attempt to make a comprehensive explanation of how eZ publish
translation should be handled. Any questions, suggestions or corrections should
be directed to translators@lists.ez.no, or to the translation coordinator,
Gunnstein Lye <gl@ez.no>.
This information can also be found at
http://developer.ez.no/article/static/73
BACKGROUND
Download eZ publish and or eZ trade. you will find a directory structure like:
ezarticle
ezimagecagalogue
ezforum
etc ...
Each module has two sub directories user and admin with intl catalogues under
them. It's in the intl catalogue which the text used on the pages are defined.
So you'll have a structure like this:
publish_directory
\ ezarticle
| user
| \ intl
| | en_GB
| \ no_NO
\ admin
\ intl
| en_GB
\ no_NO
The directories under the 'intl' directories contain the actual translations.
The naming of the languages is based on the locale conventions. British
English is en_GB, American English is en_US, German is de_DE, Norwegian
(bokmaal) is no_NO. You get the picture. Before you begin your translation,
you need to find the locale name of your language. If in doubt, contact us.
You'll find more information about the locale conventions here:
ftp.isi.edu/in-notes/rfc1766.txt and here:
ftp.isi.edu/in-notes/rfc2277.txt
The primary language of eZ publish is en_GB (British English). You should copy
from en_GB when you create a new translation. You can safely assume that the
keys in the en_GB translation are correct. If you find they are not, please
submit a bug report:
http://developer.ez.no/bug/report/
All static strings in eZ publish are stored in separate translation files
called *.php.ini. They consist of a header and key=value pairs, like this:
[strings]
head_line=Latest news
category=Category
search=Search
top_level=Top level
description=Description
next=Next
prev=Previous
So, in short, what you need to do is to translate these values. But read on, there are a few more details.
LOCALE
In classes/locale in your eZ publish distribution are a set of *.ini files,
one for each translated language. These locale files contain general settings
for things like time and date display, currency and day/month names. Here is
an extract from en_GB.ini:
[RegionalSettings]
LanguageISO=iso-8859-1
CurrencySymbol=$
DecimalSymbol=.
ThousandsSymbol=,
FractDigits=2
PositivePrefixCurrencySymbol=yes
NegativePrefixCurrencySymbol=yes
TimeFormat=%H:%i:%s
ShortTimeFormat=%H:%i
DateFormat=%E, %F %d, %Y
ShortDateFormat=%d.%m.%Y
MondayFirst=yes
jan=Jan
feb=Feb
The LanguageISO setting decides which charset to use when rendering text.
MondayFirst decides whether the week starts on Monday or Sunday. The date and
time formats contain characters prefixed with % (percentage symbol). The
following characters are currently supported (more will be implemented later):
%d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
%D - day of the week, textual, 3 letters; i.e. "Fri"
%E - day of the week, textual, long; i.e. "Friday"
%F - month, textual, long; i.e. "January"
%H - hour, 24-hour format; i.e. "00" to "23"
%i - minutes; i.e. "00" to "59"
%m - month; i.e. "01" to "12"
%M - month, textual, 3 letters; i.e. "Jan"
%s - seconds; i.e. "00" to "59"
%Y - year, 4 digits; i.e. "1999"
PRELIMINARY PERL SCRIPTS
We have made a set of Perl scripts that deal with the integrity on
translations, i.e that all necessary files and keys are present. These scripts
do not translate anything, but can be run prior to translation to ensure that
you translate all the necessary keys, and no obsolete keys.
Download the publish-intl scripts here:
http://developer.ez.no/filemanager/list/11/
The package consists of three files:
sanitizetrf.pl matches keywords in a template file against those in an intl
file, checking for obsolete or missing translations. You should not need to
run this, we run it against en_GB before a release, but it is provided for
those who are interested. It does not change any files, it just warns about
possible inconsistencies.
updatetrf.pl uses en_GB as a base to update any given language. It will remove
any obsolete keys, add any untranslated keys, and sort all keys according to
en_GB. It will change your files when it sees fit, so back up first and use
with care!
publish-tr.pl is just a batch script; it runs sanitizetrf.pl and updatetrf.pl
recursively through an eZ publish distribution. You need to edit the @MOD_DIRS
array, this specifies which modules to check. Also, if you have not put
sanitizetrf.pl and updatetrf.pl in your PATH, then you must edit $SAN and $UPD
and provide an absolute path.
If you run the scripts with -h or --help as argument, they will show usage
information.
Here is a normal usage example, that runs updatetrf.pl recursively, updating
no_NO according to en_GB:
publish-tr.pl /home/web/publish_dist no_NO -u
A note to MS Windows users: Perl scripts can be run on the Windows platform as
well. (Windows 95/98, NT, ME and 2000)
Download Windows Perl here:
http://www.activestate.com/Products/ActivePerl/
On Windows, you need to precede the command with 'perl', like this:
perl publish-tr.pl /home/web/publish_dist no_NO -u
EZ BABEL
The eZ Babel program takes care of the actual translation.
Get eZ Babel information, screenshots and downloads here:
http://developer.ez.no/article/static/56/
OTHER PROGRAMS
ezTrx
Ergin Soysal, Turkish translator, has made ezTrx, an alternative translation
program for eZ publish and eZ trade.
You can get it here:
http://www.phped.org/ezTrx.zip Binary download (WinNT, 95 & 98)
http://www.phped.org/ezTrxSrc.zip Source download
Unique keys
Gino Perna, Italian translator, made the following Perl script: (Quote)
I wrote a perl program to be sure to translate only once keys in all files in
all directories. It is not still finished but could do a lot of job for you.
Decompress the archive. Open chiavi.pl and substitute the root directory of
ezpublish and your language. Run the program outside ezpublish root. This will
collect from all .ini files all keys and generate another perl program
(unique_keys.pl) were you find all keywords to be translated. Translate the
rightside values in the hash table generated. (about 850 lines in rel 2).
Run unique_keys.pl and it will generate a new tree called translate and
recreate under this all necessary files for the new language. Now you can
explore the new tree with ezbabel or tar it and move in place.
Download unique.tar.gz here:
http://developer.ez.no/filemanager/list/11/
THANK YOU!
Finally, a great Thank You to all the translators! We want to make eZ publish
the best web publishing and e-commerce solution available, and all the
translations are a big plus in the quality score.