Révision 1231
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ImportFromOneFile.java (revision 1231) | ||
---|---|---|
30 | 30 |
String langs[] = {"", "_fr", "_ru"}; |
31 | 31 |
|
32 | 32 |
System.out.println("Importing messages..."); |
33 |
int total_update = 0; |
|
33 | 34 |
for (String lang : langs) { |
34 |
System.out.println(" Lang="+lang);
|
|
35 |
System.out.println(" For lang='"+lang+"'...");
|
|
35 | 36 |
|
36 | 37 |
File mergedPropertiesFile = new File(wmm.getWorkspaceLocation(), "org.txm.translate.rcp/messages"+lang+".properties"); |
37 | 38 |
Properties mergedProperties = new Properties(); |
38 | 39 |
mergedProperties.load(IOUtils.getReader(mergedPropertiesFile)); |
39 |
String mergedLang = mergedPropertiesFile.getName().substring(8, mergedPropertiesFile.getName().length() - 11); |
|
40 |
System.out.println(" MERGED LANG="+mergedLang); |
|
41 |
|
|
40 |
|
|
42 | 41 |
if (mergedProperties.size() == 0) { |
43 | 42 |
System.out.println(" No messages to update"); |
44 | 43 |
return; |
... | ... | |
54 | 53 |
for (String key : messages.getMessageKeys()) { |
55 | 54 |
|
56 | 55 |
String merged_key = messages.getMessageFullName()+"."+key; |
57 |
|
|
56 |
//System.out.println(merged_key); |
|
58 | 57 |
if (mergedProperties.containsKey(merged_key)) { |
59 |
messages.put(mergedLang, key, messages.get(mergedLang, key));
|
|
58 |
messages.put(lang, key, messages.get(lang, key));
|
|
60 | 59 |
update++; |
61 | 60 |
} |
62 | 61 |
} |
... | ... | |
67 | 66 |
} else { |
68 | 67 |
System.out.println(" Done, "+update + " update(s) done."); |
69 | 68 |
} |
69 |
total_update += update; |
|
70 | 70 |
} |
71 |
System.out.println("Done."); |
|
71 |
if (total_update == 0) { |
|
72 |
System.out.println("Done, no update done."); |
|
73 |
} else { |
|
74 |
System.out.println("Done, "+total_update + " update(s) done."); |
|
75 |
} |
|
72 | 76 |
} |
73 | 77 |
} |
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/devtools/ExportToOneFile.java (revision 1231) | ||
---|---|---|
1 | 1 |
package org.txm.rcp.translate.devtools; |
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 |
import java.io.FileNotFoundException; |
|
4 | 5 |
import java.io.IOException; |
6 |
import java.io.UnsupportedEncodingException; |
|
5 | 7 |
import java.util.HashMap; |
6 | 8 |
import java.util.LinkedHashMap; |
7 | 9 |
import java.util.Properties; |
... | ... | |
21 | 23 |
*/ |
22 | 24 |
public class ExportToOneFile { |
23 | 25 |
|
24 |
public static void main(String[] args) { |
|
26 |
public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
|
|
25 | 27 |
WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(); |
26 | 28 |
LinkedHashMap<File, PluginMessages> h = wmm.getPluginMessages(); |
27 | 29 |
|
... | ... | |
37 | 39 |
for (File project : h.keySet()) { |
38 | 40 |
|
39 | 41 |
PluginMessages messages = h.get(project); |
40 |
System.out.println(" "+messages.getMessageFullName()+" -> "+messages.getMessageKeys().size()); |
|
42 |
//System.out.println(" "+messages.getMessageFullName()+" -> "+messages.getMessageKeys().size());
|
|
41 | 43 |
|
42 | 44 |
for (String lang : langs) { |
43 | 45 |
File propFile = messages.getFile2lang().getKey(lang); |
44 | 46 |
if (propFile != null) { |
45 | 47 |
BiHashMap<String, String> lmessages = messages.getLangs().get(propFile); |
46 |
for (String key : lmessages.getKeys()) { |
|
48 |
for (String key : messages.getMessageKeys()) { |
|
49 |
|
|
50 |
if (lmessages.get(key) == null) continue; |
|
51 |
|
|
47 | 52 |
String merged_key = messages.getMessageFullName()+"."+key; |
48 | 53 |
if (mergedProps.get(lang).containsKey(merged_key)) { |
49 | 54 |
System.out.println(" WARNING: duplicated key ? "+merged_key); |
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.groovy (revision 1231) | ||
---|---|---|
1 |
package org.txm.rcp.translate.i18n; |
|
2 |
|
|
3 |
import org.txm.utils.BiHashMap |
|
4 |
|
|
5 |
/** |
|
6 |
* |
|
7 |
* Check any missing key in both of messages.properties and Message.java files |
|
8 |
* |
|
9 |
* @author mdecorde |
|
10 |
* |
|
11 |
*/ |
|
12 |
class PluginMessages { |
|
13 |
|
|
14 |
File projectDirectory; |
|
15 |
File messageFile; |
|
16 |
String encoding = "UTF-8" |
|
17 |
|
|
18 |
LinkedHashSet messageKeys = new LinkedHashSet<String>() |
|
19 |
HashMap<File, BiHashMap<String, String>> langs = new HashMap<File, BiHashMap<String, String>>(); |
|
20 |
BiHashMap<File, String> file2lang = new BiHashMap<File, String>() |
|
21 |
|
|
22 |
public PluginMessages(File projectDirectory, File messageFile) { |
|
23 |
this.messageFile = messageFile |
|
24 |
this.projectDirectory = projectDirectory; |
|
25 |
def propFiles = messageFile.getParentFile().listFiles() |
|
26 |
for (File propFile : propFiles) { |
|
27 |
String name = propFile.getName(); |
|
28 |
if (!name.endsWith(".properties")) continue; |
|
29 |
//messages.properties |
|
30 |
//messages_xx.properties |
|
31 |
String lang = name.substring(8, name.indexOf(".properties")) |
|
32 |
langs.put(propFile, new BiHashMap<String, String>()); |
|
33 |
file2lang.put(propFile, lang) |
|
34 |
|
|
35 |
def hash = langs[propFile] |
|
36 |
|
|
37 |
Properties props1 = new Properties() |
|
38 |
props1.load(propFile.newReader(encoding)) |
|
39 |
for (String k : props1.keySet()) { |
|
40 |
hash.put(k, props1.get(k)) |
|
41 |
} |
|
42 |
} |
|
43 |
|
|
44 |
if (messageFile != null) { |
|
45 |
BufferedReader reader2 = new BufferedReader(new InputStreamReader(new FileInputStream(messageFile), encoding)); |
|
46 |
String line2 = reader2.readLine(); |
|
47 |
while (line2 != null) { |
|
48 |
line2 = line2.trim(); |
|
49 |
if (line2.startsWith("public static String") && line2.endsWith(";") && !line2.contains("=")) { |
|
50 |
line2 = line2.substring(21, line2.length() -1); |
|
51 |
messageKeys << line2 |
|
52 |
} |
|
53 |
line2 = reader2.readLine(); |
|
54 |
} |
|
55 |
} |
|
56 |
} |
|
57 |
|
|
58 |
public void put(String lang, String key, String message) { |
|
59 |
messageKeys.add(key); |
|
60 |
|
|
61 |
File p = new File(messageFile.getParentFile(), "messages"+lang+".properties") |
|
62 |
|
|
63 |
if (!langs.containsKey(p)) { |
|
64 |
langs.put(p, new BiHashMap<String, String>()); |
|
65 |
file2lang.put(p, lang) |
|
66 |
} |
|
67 |
|
|
68 |
if (message == null) { |
|
69 |
langs.get(p).removeByKey(key); |
|
70 |
} else { |
|
71 |
langs.get(p).put(key, message); |
|
72 |
} |
|
73 |
} |
|
74 |
|
|
75 |
public String get(String lang, String key) { |
|
76 |
File p = new File(messageFile.getParentFile(), "messages"+lang+".properties") |
|
77 |
|
|
78 |
if (!file2lang.containsKey(p)) return null; |
|
79 |
|
|
80 |
return langs.get(p).get(key); |
|
81 |
} |
|
82 |
|
|
83 |
public LinkedHashSet<String> getMessageKeys() { |
|
84 |
return messageKeys; |
|
85 |
} |
|
86 |
|
|
87 |
public File getMessageFile() { |
|
88 |
return messageFile; |
|
89 |
} |
|
90 |
|
|
91 |
public String getMessageClassName() { |
|
92 |
return messageFile.getName().substring(0, messageFile.getName().length()-5); |
|
93 |
} |
|
94 |
|
|
95 |
public String getMessageFullClassName() { |
|
96 |
return messageFile.getAbsolutePath().substring(messageFile.getAbsolutePath().lastIndexOf("org/txm/"), messageFile.getAbsolutePath().length()-5).replace("/", "."); |
|
97 |
} |
|
98 |
|
|
99 |
public String getMessageName() { |
|
100 |
return messageFile.getName().substring(0, messageFile.getName().length()-5-8); |
|
101 |
} |
|
102 |
|
|
103 |
public String getMessageFullName() { |
|
104 |
return messageFile.getAbsolutePath().substring(messageFile.getAbsolutePath().lastIndexOf("org/txm/")+8, messageFile.getAbsolutePath().length()-5-8).replace("/", "."); |
|
105 |
} |
|
106 |
|
|
107 |
// public def getMissingsMessageKeys(String lang) { |
|
108 |
// def missing = [] |
|
109 |
// for (String pKey : this.getKeys()) |
|
110 |
// if (!messageKeys.contains(pKey)) |
|
111 |
// missing << pKey |
|
112 |
// |
|
113 |
// return missing |
|
114 |
// } |
|
115 |
// |
|
116 |
// public getMissingPropKeys(String lang) { |
|
117 |
// def missing = [] |
|
118 |
// def pKeys = this.getKeys() |
|
119 |
// for (String mKey : messageKeys) |
|
120 |
// if (!pKeys.contains(mKey)) |
|
121 |
// missing << mKey |
|
122 |
// |
|
123 |
// return missing |
|
124 |
// } |
|
125 |
|
|
126 |
public void saveChanges() { |
|
127 |
|
|
128 |
//Write prop File |
|
129 |
for (File propFile : langs.keySet()) { |
|
130 |
String name = propFile.getName(); |
|
131 |
if (!name.endsWith(".properties")) continue; |
|
132 |
String lang = name.substring(8, name.indexOf(".properties")) |
|
133 |
|
|
134 |
File oldFile = new File(propFile.getParentFile(), propFile.getName()+".cpy"); |
|
135 |
propFile.renameTo(oldFile); |
|
136 |
|
|
137 |
Properties props = new Properties() |
|
138 |
} |
|
139 |
|
|
140 |
|
|
141 |
// write message File |
|
142 |
if (messageFile == null) return; |
|
143 |
|
|
144 |
File oldFile2 = new File(messageFile.getParentFile(), messageFile.getName()+".cpy"); |
|
145 |
messageFile.renameTo(oldFile2); // back up |
|
146 |
messageFile.withWriter(encoding) { out -> |
|
147 |
// write start |
|
148 |
out.println('''package org.txm; |
|
149 |
|
|
150 |
import org.eclipse.osgi.util.NLS; |
|
151 |
|
|
152 |
public class Messages extends NLS { |
|
153 |
|
|
154 |
// The Constant BUNDLE_NAME. |
|
155 |
private static final String BUNDLE_NAME = "org.txm.messages"; //$NON-NLS-1$ |
|
156 |
''') |
|
157 |
|
|
158 |
//write keys |
|
159 |
for(String key : this.getKeys().sort()) |
|
160 |
out.println("\tpublic static String $key;"); |
|
161 |
|
|
162 |
// write end |
|
163 |
out.println(''' |
|
164 |
static { |
|
165 |
// initialize resource bundle |
|
166 |
NLS.initializeMessages(BUNDLE_NAME, Messages.class); |
|
167 |
} |
|
168 |
|
|
169 |
private Messages() { |
|
170 |
} |
|
171 |
} |
|
172 |
''') |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 |
public void summary() { |
|
177 |
println getMessageFileName() |
|
178 |
println "Messages keys" |
|
179 |
for (def key : messageKeys) { |
|
180 |
println " $key" |
|
181 |
} |
|
182 |
|
|
183 |
println "Langs" |
|
184 |
for (def lang : langs.keySet()) { |
|
185 |
println " '$lang'" |
|
186 |
def hash = langs[lang] |
|
187 |
println " keys="+ hash.getKeys() |
|
188 |
for (def key : hash.getKeys()) { |
|
189 |
println " $key="+hash.get(key) |
|
190 |
} |
|
191 |
} |
|
192 |
} |
|
193 |
|
|
194 |
public static void main(String[] args) { |
|
195 |
File messageFile = new File("/home/mdecorde/workspace047/org.txm.core/src/java/org/txm/core/messages/TXMCoreMessages.java") |
|
196 |
PluginMessages dict = new PluginMessages(messageFile); |
|
197 |
|
|
198 |
println dict.summary() |
|
199 |
//dict.saveChanges(); |
|
200 |
} |
|
201 |
} |
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessages.java (revision 1231) | ||
---|---|---|
1 |
package org.txm.rcp.translate.i18n; |
|
2 |
|
|
3 |
import java.io.BufferedReader; |
|
4 |
import java.io.File; |
|
5 |
import java.io.FileInputStream; |
|
6 |
import java.io.FileNotFoundException; |
|
7 |
import java.io.IOException; |
|
8 |
import java.io.InputStreamReader; |
|
9 |
import java.io.PrintWriter; |
|
10 |
import java.io.UnsupportedEncodingException; |
|
11 |
import java.util.HashMap; |
|
12 |
import java.util.Hashtable; |
|
13 |
import java.util.LinkedHashSet; |
|
14 |
import java.util.Properties; |
|
15 |
|
|
16 |
import org.txm.utils.BiHashMap; |
|
17 |
import org.txm.utils.io.IOUtils; |
|
18 |
|
|
19 |
/** |
|
20 |
* |
|
21 |
* Check any missing key in both of messages.properties and Message.java files |
|
22 |
* |
|
23 |
* @author mdecorde |
|
24 |
* |
|
25 |
*/ |
|
26 |
public class PluginMessages { |
|
27 |
|
|
28 |
File projectDirectory; |
|
29 |
File messageFile; |
|
30 |
String encoding = "UTF-8"; |
|
31 |
|
|
32 |
LinkedHashSet<String> messageKeys = new LinkedHashSet<String>(); |
|
33 |
HashMap<File, BiHashMap<String, String>> langs = new HashMap<File, BiHashMap<String, String>>(); |
|
34 |
BiHashMap<File, String> file2lang = new BiHashMap<File, String>(); |
|
35 |
|
|
36 |
public PluginMessages(File projectDirectory, File messageFile) throws UnsupportedEncodingException, FileNotFoundException, IOException { |
|
37 |
this.messageFile = messageFile; |
|
38 |
this.projectDirectory = projectDirectory; |
|
39 |
File[] propFiles = messageFile.getParentFile().listFiles(); |
|
40 |
for (File propFile : propFiles) { |
|
41 |
String name = propFile.getName(); |
|
42 |
if (!name.endsWith(".properties")) continue; |
|
43 |
//messages.properties |
|
44 |
//messages_xx.properties |
|
45 |
String lang = name.substring(8, name.indexOf(".properties")); |
|
46 |
langs.put(propFile, new BiHashMap<String, String>()); |
|
47 |
file2lang.put(propFile, lang); |
|
48 |
|
|
49 |
BiHashMap<String, String> hash = langs.get(propFile); |
|
50 |
|
|
51 |
Properties props1 = new Properties(); |
|
52 |
props1.load(IOUtils.getReader(propFile, encoding)); |
|
53 |
for (Object k : props1.keySet()) { |
|
54 |
hash.put(k.toString(), props1.get(k).toString()); |
|
55 |
} |
|
56 |
} |
|
57 |
|
|
58 |
if (messageFile != null) { |
|
59 |
BufferedReader reader2 = new BufferedReader(new InputStreamReader(new FileInputStream(messageFile), encoding)); |
|
60 |
String line2 = reader2.readLine(); |
|
61 |
while (line2 != null) { |
|
62 |
line2 = line2.trim(); |
|
63 |
if (line2.startsWith("public static String") && line2.endsWith(";") && !line2.contains("=")) { |
|
64 |
line2 = line2.substring(21, line2.length() -1); |
|
65 |
messageKeys.add(line2); |
|
66 |
} |
|
67 |
line2 = reader2.readLine(); |
|
68 |
} |
|
69 |
reader2.close(); |
|
70 |
} |
|
71 |
} |
|
72 |
|
|
73 |
public void put(String lang, String key, String message) { |
|
74 |
messageKeys.add(key); |
|
75 |
|
|
76 |
File p = new File(messageFile.getParentFile(), "messages"+lang+".properties"); |
|
77 |
|
|
78 |
if (!langs.containsKey(p)) { |
|
79 |
langs.put(p, new BiHashMap<String, String>()); |
|
80 |
file2lang.put(p, lang); |
|
81 |
} |
|
82 |
|
|
83 |
if (message == null) { |
|
84 |
langs.get(p).removeByKey(key); |
|
85 |
} else { |
|
86 |
langs.get(p).put(key, message); |
|
87 |
} |
|
88 |
} |
|
89 |
|
|
90 |
public String get(String lang, String key) { |
|
91 |
File p = new File(messageFile.getParentFile(), "messages"+lang+".properties"); |
|
92 |
|
|
93 |
if (!file2lang.containsKey(p)) return null; |
|
94 |
|
|
95 |
return langs.get(p).get(key); |
|
96 |
} |
|
97 |
|
|
98 |
public LinkedHashSet<String> getMessageKeys() { |
|
99 |
return messageKeys; |
|
100 |
} |
|
101 |
|
|
102 |
public File getMessageFile() { |
|
103 |
return messageFile; |
|
104 |
} |
|
105 |
|
|
106 |
public String getMessageClassName() { |
|
107 |
return messageFile.getName().substring(0, messageFile.getName().length()-5); |
|
108 |
} |
|
109 |
|
|
110 |
public String getMessageFullClassName() { |
|
111 |
return messageFile.getAbsolutePath().substring(messageFile.getAbsolutePath().lastIndexOf("org/txm/"), messageFile.getAbsolutePath().length()-5).replace("/", "."); |
|
112 |
} |
|
113 |
|
|
114 |
public String getMessageName() { |
|
115 |
return messageFile.getName().substring(0, messageFile.getName().length()-5-8); |
|
116 |
} |
|
117 |
|
|
118 |
public String getMessageFullName() { |
|
119 |
return messageFile.getAbsolutePath().substring(messageFile.getAbsolutePath().lastIndexOf("org/txm/")+8, messageFile.getAbsolutePath().length()-5-8).replace("/", "."); |
|
120 |
} |
|
121 |
|
|
122 |
// public def getMissingsMessageKeys(String lang) { |
|
123 |
// def missing = [] |
|
124 |
// for (String pKey : this.getKeys()) |
|
125 |
// if (!messageKeys.contains(pKey)) |
|
126 |
// missing << pKey |
|
127 |
// |
|
128 |
// return missing |
|
129 |
// } |
|
130 |
// |
|
131 |
// public getMissingPropKeys(String lang) { |
|
132 |
// def missing = [] |
|
133 |
// def pKeys = this.getKeys() |
|
134 |
// for (String mKey : messageKeys) |
|
135 |
// if (!pKeys.contains(mKey)) |
|
136 |
// missing << mKey |
|
137 |
// |
|
138 |
// return missing |
|
139 |
// } |
|
140 |
|
|
141 |
public void saveChanges() throws UnsupportedEncodingException, FileNotFoundException { |
|
142 |
|
|
143 |
//Write prop File |
|
144 |
for (File propFile : langs.keySet()) { |
|
145 |
String name = propFile.getName(); |
|
146 |
if (!name.endsWith(".properties")) continue; |
|
147 |
|
|
148 |
File oldFile = new File(propFile.getParentFile(), propFile.getName()+".cpy"); |
|
149 |
propFile.renameTo(oldFile); |
|
150 |
|
|
151 |
Properties props = new Properties(); |
|
152 |
} |
|
153 |
|
|
154 |
// write message File |
|
155 |
if (messageFile == null) return; |
|
156 |
|
|
157 |
File oldFile2 = new File(messageFile.getParentFile(), messageFile.getName()+".cpy"); |
|
158 |
messageFile.renameTo(oldFile2); // back up |
|
159 |
|
|
160 |
String className = getMessageClassName(); |
|
161 |
String name = getMessageName(); |
|
162 |
String classPackage = getMessageFullClassName().substring(0, getMessageFullClassName().length()- getMessageClassName().length()); |
|
163 |
|
|
164 |
PrintWriter out = IOUtils.getWriter(messageFile, encoding); |
|
165 |
|
|
166 |
// write start |
|
167 |
out.println("package "+classPackage+";\n"); |
|
168 |
|
|
169 |
out.println("import org.eclipse.osgi.util.NLS;"); |
|
170 |
out.println("import org.txm.utils.messages.Utf8NLS;\n"); |
|
171 |
|
|
172 |
out.println("/** "+name+" messages. @author sjacquot, mdecorde **/"); |
|
173 |
|
|
174 |
out.println("public class "+className+" extends NLS {"); |
|
175 |
|
|
176 |
out.println(" private static final String BUNDLE_NAME = \""+classPackage+".messages\"; //$NON-NLS-1$"); |
|
177 |
|
|
178 |
//write keys |
|
179 |
for (String key : this.getMessageKeys()) |
|
180 |
out.println(" public static String "+key+";"); |
|
181 |
|
|
182 |
// write end |
|
183 |
out.println(" static {"); |
|
184 |
out.println(" // initialize resource bundle"); |
|
185 |
out.println(" Utf8NLS.initializeMessages(BUNDLE_NAME, "+className+".class);"); |
|
186 |
out.println(" }"); |
|
187 |
|
|
188 |
out.println(" private "+className+"() { }"); |
|
189 |
out.println("}"); |
|
190 |
|
|
191 |
out.close(); |
|
192 |
} |
|
193 |
|
|
194 |
public void summary() { |
|
195 |
System.out.println(getMessageClassName()); |
|
196 |
System.out.println("Messages keys"); |
|
197 |
for (String key : messageKeys) { |
|
198 |
System.out.println(" $key"); |
|
199 |
} |
|
200 |
|
|
201 |
System.out.println("Langs"); |
|
202 |
for (File lang : langs.keySet()) { |
|
203 |
System.out.println(" '$lang'"); |
|
204 |
BiHashMap<String, String> hash = langs.get(lang); |
|
205 |
System.out.println(" keys="+ hash.getKeys()); |
|
206 |
for (String key : hash.getKeys()) { |
|
207 |
System.out.println(" $key="+hash.get(key)); |
|
208 |
} |
|
209 |
} |
|
210 |
} |
|
211 |
|
|
212 |
public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException { |
|
213 |
File projectFile = new File("/home/mdecorde/workspace047/org.txm.core"); |
|
214 |
File messageFile = new File(projectFile, "src/java/org/txm/core/messages/TXMCoreMessages.java"); |
|
215 |
PluginMessages dict = new PluginMessages(projectFile, messageFile); |
|
216 |
|
|
217 |
dict.summary(); |
|
218 |
//dict.saveChanges(); |
|
219 |
} |
|
220 |
|
|
221 |
public BiHashMap<File, String> getFile2lang() { |
|
222 |
return file2lang; |
|
223 |
} |
|
224 |
|
|
225 |
public HashMap<File, BiHashMap<String, String>> getLangs() { |
|
226 |
return langs; |
|
227 |
} |
|
228 |
} |
tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java (revision 1231) | ||
---|---|---|
1 | 1 |
package org.txm.rcp.translate.i18n; |
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 |
import java.io.FileNotFoundException; |
|
5 |
import java.io.IOException; |
|
6 |
import java.io.UnsupportedEncodingException; |
|
4 | 7 |
import java.util.LinkedHashMap; |
5 | 8 |
|
6 | 9 |
/** |
... | ... | |
17 | 20 |
|
18 | 21 |
/** |
19 | 22 |
* Creates the manager using the "user.dir" parent directory -> works when run from Eclipse |
23 |
* @throws IOException |
|
24 |
* @throws FileNotFoundException |
|
25 |
* @throws UnsupportedEncodingException |
|
20 | 26 |
*/ |
21 |
public WorkspaceMessagesManager() { |
|
27 |
public WorkspaceMessagesManager() throws UnsupportedEncodingException, FileNotFoundException, IOException {
|
|
22 | 28 |
this(new File(System.getProperty("user.dir")).getParentFile()); |
23 | 29 |
} |
24 | 30 |
|
25 |
public WorkspaceMessagesManager(File workspaceLocation) { |
|
31 |
public WorkspaceMessagesManager(File workspaceLocation) throws UnsupportedEncodingException, FileNotFoundException, IOException {
|
|
26 | 32 |
this.workspaceLocation = workspaceLocation; |
27 | 33 |
|
28 | 34 |
if (!workspaceLocation.exists()) return; |
... | ... | |
54 | 60 |
return pluginsMessagesPerProject; |
55 | 61 |
} |
56 | 62 |
|
57 |
public static void main(String[] args) { |
|
63 |
public static void main(String[] args) throws UnsupportedEncodingException, FileNotFoundException, IOException {
|
|
58 | 64 |
WorkspaceMessagesManager wmm = new WorkspaceMessagesManager(); |
59 | 65 |
LinkedHashMap<File, PluginMessages> h = wmm.getPluginMessages(); |
60 | 66 |
for (File p : h.keySet()) { |
tmp/org.txm.translate.rcp/messages_ru.properties (revision 1231) | ||
---|---|---|
1 | 1 |
#compiled messages for lang=_ru |
2 |
#Mon Nov 05 17:16:38 CET 2018
|
|
2 |
#Tue Nov 06 09:09:24 CET 2018
|
|
3 | 3 |
concordance.core.messages.ConcordanceCore.PropertiesReferenceComparator_0=MISSING |
4 | 4 |
concordance.rcp.messages.ConcordanceUI.GetConcordances_4=** Ошибка при расчете конкордансов\: {0} |
5 | 5 |
ahc.rcp.messages.AHCUI.tooltips_computeColumns=Колонки |
6 | 6 |
cooccurrence.rcp.messages.CooccurrenceUI.CooccurrencesEditor_18=Порог индекса должен быть действительным числом, отличным от {0} |
7 | 7 |
internalview.core.messages.InternalViewCore.RESULT_TYPE= |
8 | 8 |
cooccurrence.rcp.messages.CooccurrenceUI.CooccurrencesEditor_17=Индекс |
9 |
ca.rcp.messages.CAUI.CorrespondanceAnalysisEditorInput_29=Конт |
|
10 |
ca.rcp.messages.CAUI.CorrespondanceAnalysisEditorInput_27=Дист |
|
11 |
ca.rcp.messages.CAUI.CorrespondanceAnalysisEditorInput_26=Масса |
|
12 | 9 |
cooccurrence.rcp.messages.CooccurrenceUI.CooccurrencesEditor_10=Совместная частотность |
13 | 10 |
lexicaltable.rcp.messages.LexicalTableUI.ComputeLexicalTable_7=** Списки значений должны иметь одинаковое распределение\: {0} |
14 | 11 |
lexicaltable.rcp.messages.LexicalTableUI.ComputeLexicalTable_6=** Списки значений должны строиться на одинаковых сочетаниях свойств\: {0} |
... | ... | |
270 | 267 |
internalview.rcp.messages.InternalViewUI.InternalViewEditor_16=Ошибка |
271 | 268 |
progression.core.messages.ProgressionCore.RESULT_TYPE=Прогрессия |
272 | 269 |
cooccurrence.core.messages.CooccurrenceCore.info_buildingQueries=Расчет запроса |
273 |
ca.rcp.messages.CAUI.CorrespondanceAnalysisEditorInput_30=Cos² |
tmp/org.txm.translate.rcp/messages_fr.properties (revision 1231) | ||
---|---|---|
1 | 1 |
#compiled messages for lang=_fr |
2 |
#Mon Nov 05 17:16:38 CET 2018
|
|
2 |
#Tue Nov 06 09:09:24 CET 2018
|
|
3 | 3 |
ca.rcp.messages.CAUI.PreferencePage_CHART_SHOW_POINT_SHAPES=Afficher le tracé des points |
4 | 4 |
cooccurrence.core.messages.CooccurrenceCore.info_retreivingMatches=Calcul des retours. |
5 | 5 |
statsengine.r.core.messages.RCore.error_evaluationError=** Erreur d'évaluation \: {0}\n{1}. |
... | ... | |
51 | 51 |
statsengine.core.messages.StatsEngineCore.VectorizeArray_1=** Les tableaux internes doivent avoir une dimension supérieure à 0 |
52 | 52 |
statsengine.r.core.messages.RCore.error_rserveIsAlreadyRunningOnPort=Rserve est déja démarré sur le port {0}. |
53 | 53 |
statsengine.core.messages.StatsEngineCore.VectorizeArray_0=** Rien à faire avec une matrice vide |
54 |
referencer.rcp.messages.ReferencerUI.= |
|
55 | 54 |
searchengine.cqp.core.messages.CQPSearchEngineCore.READ_INTEGER_FROM_CQI_SERVER=Entier reçu du serveur CQi \: {0}. |
56 | 55 |
internalview.core.messages.InternalViewCore.InternalView_7=\ n° d'informations sur les structures |
57 | 56 |
internalview.core.messages.InternalViewCore.InternalView_6=Erreur lors de la récupération des valeurs des propriétés de structure \: |
... | ... | |
321 | 320 |
statsengine.r.core.messages.RCore.ExecuteRScript_2=Terminé \: |
322 | 321 |
statsengine.r.core.messages.RCore.ExecuteRScript_1=Exécution de {0} |
323 | 322 |
lexicaltable.rcp.messages.LexicalTableUI.LexicalTableEditor_1=** Erreur \: le nombre de colonne diffère \: avant {0} après {1}. |
324 |
properties.core.messages.PropertiesCore.Properties_26=Pas de propriété |
|
325 | 323 |
searchengine.cqp.core.messages.CQPSearchEngineCore.CqiClient_33=** La connexion au moteur de recherche a échoué. |
326 | 324 |
searchengine.cqp.core.messages.CQPSearchEngineCore.PatchCwbRegistry_16=Le fichier 'registry' est introuvable |
325 |
properties.core.messages.PropertiesCore.Properties_26=Pas de propriété |
|
327 | 326 |
searchengine.cqp.core.messages.CQPSearchEngineCore.CqiClient_32=Moteur de recherche lancé... |
328 | 327 |
specificities.core.messages.SpecificitiesCore.SpecificitesResult_8=Unité |
329 | 328 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditorContributor_0=Concordance |
... | ... | |
341 | 340 |
searchengine.cqp.core.messages.CQPSearchEngineCore.MemCqiClient_1=Erreur CQ \: |
342 | 341 |
searchengine.cqp.core.messages.CQPSearchEngineCore.MemCqiClient_0=Erreur interne CQI \: |
343 | 342 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_116=Effectuer l'annotation |
344 |
properties.core.messages.PropertiesCore.Properties_16=Nombre d'unités de structure |
|
345 | 343 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_115=Ajouter une nouvelle categorie |
344 |
properties.core.messages.PropertiesCore.Properties_16=Nombre d'unités de structure |
|
346 | 345 |
ahc.core.messages.AHCCore.RESULT_TYPE=CAH |
347 | 346 |
properties.core.messages.PropertiesCore.Properties_14=Propriétés des unités lexicales (max {0} valeurs) |
348 | 347 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_112=La valeur {0} n''est pas encore associée à la catégorie \: {1}. Créer l''association ? |
349 |
properties.core.messages.PropertiesCore.Properties_11=\ structures |
|
350 | 348 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_110=Nouvelle valeur {0} pour la catégorie {1} |
349 |
properties.core.messages.PropertiesCore.Properties_11=\ structures |
|
351 | 350 |
cooccurrence.core.messages.CooccurrenceCore.info_buildingQueries=Calcul des requêtes. |
352 |
searchengine.cqp.rcp.messages.CQPUI.= |
|
353 | 351 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_108=\ éléments. Continuez ? |
354 | 352 |
para.rcp.messages.ParaBrowserUI.ParaBrowserEditor_22=Ouvrir le Navigateur interne |
355 | 353 |
para.rcp.messages.ParaBrowserUI.ParaBrowserEditor_21=_ |
tmp/org.txm.translate.rcp/messages.properties (revision 1231) | ||
---|---|---|
1 | 1 |
#compiled messages for lang= |
2 |
#Mon Nov 05 17:16:38 CET 2018
|
|
2 |
#Tue Nov 06 09:09:24 CET 2018
|
|
3 | 3 |
ca.rcp.messages.CAUI.PreferencePage_CHART_SHOW_POINT_SHAPES=Show point shapes |
4 | 4 |
cooccurrence.core.messages.CooccurrenceCore.info_retreivingMatches=Retreiving matches. |
5 | 5 |
statsengine.r.core.messages.RCore.error_evaluationError=** Evaluation error\: {0}\n{1}. |
... | ... | |
187 | 187 |
cooccurrence.rcp.messages.CooccurrenceUI.CooccurrencesEditor_18=The score threshold must be a real number (current value\={0}) |
188 | 188 |
cooccurrence.rcp.messages.CooccurrenceUI.CooccurrencesEditor_17=Score |
189 | 189 |
statsengine.r.core.messages.RCore.info_savingChartToFile=Saving chart to file\: {0}. |
190 |
partition.rcp.messages.PartitionUI.preferences_charts_tabfolder_title=Dimensions chart rendering |
|
191 | 190 |
cooccurrence.rcp.messages.CooccurrenceUI.CooccurrencesEditor_10=Cofrequency |
192 | 191 |
statsengine.core.messages.StatsEngineCore.VectorizeArray_11=** All the inner array do not have the same length. |
193 | 192 |
statsengine.core.messages.StatsEngineCore.VectorizeArray_10=** An inner array cannot be null. |
... | ... | |
249 | 248 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_9=Error\: could not retrieve line word id for edition |
250 | 249 |
statsengine.r.core.messages.RCore.info_tryingToStartRFrom=Try to start R from\: {0}... |
251 | 250 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_8=The corpus has no text_id property |
252 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_7=CQP error\: |
|
253 | 251 |
concordance.rcp.messages.ConcordanceUI.editor_sorting_with=Sorting with |
252 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_7=CQP error\: |
|
254 | 253 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_6=Sorting |
255 | 254 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_5=Concordance of <{0}> in corpus {1} |
256 | 255 |
edition.rcp.messages.EditionUI.warning_no_edition_with_name=No edition with name\={0} available for text\={1} |
... | ... | |
439 | 438 |
searchengine.cqp.core.messages.CQPSearchEngineCore.PatchCwbRegistry_16=Can't find registry file |
440 | 439 |
searchengine.cqp.core.messages.CQPSearchEngineCore.CqiClient_32=Search Engine launched... |
441 | 440 |
specificities.core.messages.SpecificitiesCore.SpecificitesResult_8=Unit |
442 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditorContributor_0=Concordance |
|
443 | 441 |
concordance.rcp.messages.ConcordanceUI.editor_right=Right |
442 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditorContributor_0=Concordance |
|
444 | 443 |
ca.rcp.messages.CAUI.error_cannot_compute_with=Error\: cannot compute CA with {0} |
445 | 444 |
searchengine.cqp.core.messages.CQPSearchEngineCore.MemCqiClient_9=b2 |
446 | 445 |
searchengine.cqp.core.messages.CQPSearchEngineCore.PatchCwbRegistry_13=Source registry does not exists\: |
... | ... | |
536 | 535 |
internalview.core.messages.InternalViewCore.RESULT_TYPE=Internal View |
537 | 536 |
searchengine.cqp.core.messages.CQPSearchEngineCore.Subcorpus_3={0} is not a valid CQP ID for a subcorpus. It must be an uppercase character followed by lowercase characters. |
538 | 537 |
specificities.rcp.messages.SpecificitiesUI.SpecificitiesTableEditor_11=\ T |
539 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_xpndtmNewExpanditem_text_2=New ExpandItem |
|
540 | 538 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_99=List of categories |
539 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_xpndtmNewExpanditem_text_2=New ExpandItem |
|
541 | 540 |
concordance.rcp.messages.ConcordanceUI.ConcordancesEditor_xpndtmNewExpanditem_text_1=New ExpandItem |
542 | 541 |
annotation.kr.rcp.messages.KRAnnotationUI.KRAnnotation_6=Concordance Annotation area |
543 | 542 |
index.rcp.messages.IndexUI.ComputeIndex_0=Opening Index results |
Formats disponibles : Unified diff