Debian Codegraph @

tools/l10n/README

raw
1 <!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to you under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 -->
17
18 This directory contains a java program that can be used to flag possible
19 problems in the translation of the localized message files.
20 This program can be run at any time, for instance, to identify where
21 the localized files are lagging behind their English counterparts.
22 But, it is anticipated to be run before a check-in of changes to one of
23 the localization files, or before a release.
24
25 It is intended to be run on the source of the messages; as such, there is
26 no point in including this into any runtime jar file.
27
28 The output of the program requires manual perusal, because many aspects
29 checked may be acceptable in a particular language, or translation, or for
30 a specific message. As such, it is not part of the full build.
31
32 Files in this directory
33 =======================
34 LocCompare.java
35 This file is the source code used to generate a test class for
36 translated messages.
37 build.xml
38 This file will build the class into the svnroot/classes directory
39 README
40 This file
41
42
43 Syntax
44 ======
45 java [-Dderbysvntop=<svntop>] [-Dtranslations=<newloc>] LocCompare [<territories>][?|-h]
46 where
47 svntop = top of derby svn tree for branch or trunk
48 default is current dir is the top
49 newloc = temporary location for translated files
50 drda locale files are expected in a subdir 'drda'
51 default is same file structure as for the english files
52 territories = one translated territories, or 'all'
53 where all means:
54 {cs,de_DE,es,fr,hu,it,ja_JP,ko_KR,pl,pt_BR,ru,zh_CN,zh_TW}
55 ?|-h = you can pass on -h or ? to get this message
56 you can also pass -Dtvtdebug=true in to see more comments.
57
58 Examples:
59 --------------------
60 compares french:
61 java -Dderbysvntop=c:/derby/trunk LocCompare fr
62 compares unexisting french french:
63 java -Dderbysvntop=c:/derby/trunk LocCompare fr
64 compares all territories listed in program:
65 java -Dderbysvntop=c:/derby/trunk LocCompare
66 compares all territories listed in program in 'chatty' mode:
67 java -Dtvtdebug=true -Dderbysvntop=c:/derby/trunk LocCompare
68 gets usage message
69 java LocCompare -h
70 --------------------
71
72 Files accessed by the program
73 =============================
74 always: English:
75 svnroot/java/engine/org/apache/derby/loc/messages_en.properties
76 svnroot/java/tools/org/apache/derby/loc/toolsmessages.properties
77 svnroot/java/tools/org/apache/derby/loc/sysinfoMessages.properties
78 svnroot/java/drda/org/apache/derby/loc/drda/messages_en.properties
79 svnroot/java/drda/org/apache/derby/loc/drda/servlet_messages.properties
80
81 translated files in the following languages:
82 cs - Czech
83 de_DE - German
84 es - Spanish
85 fr - French
86 hu - Hungarian
87 it - Italian
88 ja_JP - Japanese
89 ko_KR - Korean
90 pl - Polish
91 pt_BR - Portuguese
92 ru - Russian
93 zh_CN - Chinese
94 zh_TW - Traditional Chinese
95
96 By default, the translated files are expected to be in the same location
97 as the English files indicated above, i.e. for German engine messages the
98 file is expected to be:
99 svnroot/java/engine/org/apache/derby/loc/messages_de_DE.properties
100
101 (For convenience, it is also possible to specify a temporary location, using
102 the -Dtranslations= property. In this case, it is necessary to place
103 the network server files in a subdirectory because the main file server file
104 has the same name as the engine messages file.)
105
106
107 Details about the program
108 =========================
109 The program has two modes, a 'chatty' mode, which shows a lot of information,
110 and a normal mode, which only flags possible problems and Failures.
111 The chatty mode is initialized by specifying the property -Dtvtdebug=true.
112 In the chatty mode, every message string in the English message files is
113 printed out with - if existing - its localized counterpart.
114 In the normal mode, only messages that have been identified with a possible
115 problem will be printed.
116
117 The messages are printed with a < for English, and > for the localization:
118
119 Example:
120 --------------------
121 *********************************************
122 *********************************************
123 Now comparing
124 < c:/p4/p4main/opensource/java/engine/org/apache/derby/loc/messages_en.properties
125 > c:/p4/p4main/opensource/java/engine/org/apache/derby/loc/messages_fr.properties
126 ===============
127 en: < 07009=No input parameters.
128 fr: > 07009=Aucun param\u00e8tre d'entr\u00e9e.
129 WARNING - found single single quotes - quotes need to be doubled
130
131 ===============
132 --------------------
133
134 The program will flag the following problems:
135 - missing file
136 - missing message
137 - message containing characters outside the range 0x00-0x1f (which are ASCII) and 0x7f-0xff - message requiring double quotes but having only one
138 - message not having same number of parameters as English
139 - unmatched curly braces ('{' and '}')
140 - unmatched number of uppercased strings
141 and warn about the following:
142 - if the number of the following characters in the translated message is
143 different from the English:
144 '%', ';', ':', '_', '=', '(', ')', '+', '/', '[', ']', '\'
145 - if the strings or parameters, or their sequence within curly braces is different
146 - for file toolsmessages*.properties, if there are double single quotes in a string
147 without replacements
148 - if there are single quotes where they should be doubled up
149 - different uppercased strings
150
151 In addition, the chatty mode will describe successful comparisons.
152
153