voxforge.org
VoxForge Dev

Ticket #400: LabelLocalizer.java

File LabelLocalizer.java, 13.6 kB (added by kmaclean, 6 months ago)
Line 
1 package speechrecorder;
2
3 class LabelLocalizer  {
4     private String usernamePanelLabel;
5     private String usernamePanelText;
6    
7     private String copyrightName;
8     private String gplAccepted;
9    
10     private String pleaseSelect;
11     private String other;
12     private String notApplicable;
13    
14     private String genderPanelLabel;
15     private String genderSelection [];
16    
17     private String ageRangePanelLabel;
18     private String ageSelection [];
19
20     private String dialectPanelLabel;
21     private String dialectSelection [];
22    
23     private String microphonePanelLabel;
24     private String microphoneSelection [];
25    
26     private String uploadText;
27     private String uploadButtonLabel;
28    
29     private String moreInfoText;
30     private String moreInfoButtonLabel;   
31
32     private String disclaimerText;
33     private String aboutButtonLabel;
34    
35     private String recordButton;
36     private String stopButton;
37     private String playButton;
38     private String peakWarningLabel;
39     private String sampleGraphFileLabel;
40     private String sampleGraphLengthLabel;
41     private String sampleGraphPositionLabel;
42    
43     private String uploadingMessageLabel;
44     private String uploadCompletedMessageLabel;
45        
46         public LabelLocalizer (String language) {
47                 // debug System.err.println("LabelLocalizerLanguage:" + language + ":");
48                 if (language.equals("EN")) {
49                         English();
50                         // debug System.err.println("LabelLocalizerLanguage:" + language + ": equals EN");
51                 } else if (language.equals("NL")) {
52                         Dutch();
53                 } else if (language.equals("DE")) {
54                         German();
55                 } else if (language.equals("RU")) {
56                         Russian();
57                 } else if (language.equals("IT")) {
58                         Italian();
59                 } else if (language.equals("HB")) {
60                         Hebrew();
61                 } else if (language.equals("BR")) {
62                         Brazilian();
63                 } else {
64                         English();
65                         // debug System.err.println("LabelLocalizerLanguage:" + language + ": defaults to english");
66                 }
67         }
68        
69         private void English() {
70              usernamePanelLabel = "Username:";
71              usernamePanelText = "(leave blank to submit anonymously)";
72              
73              copyrightName = "Free Software Foundation";
74              gplAccepted = "Yes";
75            
76              pleaseSelect = "Please Select";
77              notApplicable = "unknown";
78              
79              genderPanelLabel = "Gender:";
80              genderSelection = new String [3];
81              genderSelection[0] = pleaseSelect;   
82              genderSelection[1] = "Male";   
83              genderSelection[2] = "Female";
84    
85              ageRangePanelLabel = "Age Range:";
86              ageSelection = new String [4];
87              ageSelection[0] = pleaseSelect; 
88              ageSelection[1] = "Youth"
89              ageSelection[2] = "Adult";
90              ageSelection[3] = "Senior";
91        
92              dialectPanelLabel = "Pronunciation Dialect:";
93              dialectSelection = new String [11];
94              dialectSelection[0] = pleaseSelect;   
95              dialectSelection[1] = "Australian English";   
96              dialectSelection[2] = "American English";    // other
97              dialectSelection[3] = "British English";
98              dialectSelection[4] = "Canadian English";     
99              dialectSelection[5] = "European English";
100              dialectSelection[6] = "Indian English";
101              dialectSelection[7] = "Irish English";
102              dialectSelection[8] = "New Zealand English";
103              dialectSelection[9] = "South African English"
104              dialectSelection[10] = "Other";
105            
106              microphonePanelLabel = "Microphone Type:";
107              microphoneSelection = new String [9];
108              microphoneSelection[0] = pleaseSelect; 
109              microphoneSelection[1] = "Headset mic";   
110              microphoneSelection[2] = "USB Headset mic";   
111              microphoneSelection[3] = "Desktop Boom mic"
112              microphoneSelection[4] = "USB Desktop Boom mic"
113              microphoneSelection[5] = "Laptop Built-in mic";
114              microphoneSelection[6] = "WebCam mic";     
115              microphoneSelection[7] = "Studio mic";
116              microphoneSelection[8] = "Other";
117            
118              uploadText = "<html>By clicking the \"Upload\" button, you agree to assign the Copyright to your recorded speech to <br> "
119                 + "the Free Software Foundation, and to license your submission under the GNU Public Licence (\"GPL\"):" ;
120              uploadButtonLabel = "Upload";
121            
122              moreInfoText = "For more information on Copyright and GPL, click here:";
123              moreInfoButtonLabel = "More Information";   
124        
125              disclaimerText =
126                  "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>"
127                  +"This program comes with ABSOLUTELY NO WARRANTY; without even the implied<br> "
128                  +"warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  For<br>"
129                  +"more details click the \"About\" button:";
130              aboutButtonLabel = "About";
131            
132              recordButton = "Record";
133              stopButton = "Stop";
134              playButton = "Play";
135              
136              peakWarningLabel =  "Warning: input may be too loud";
137              sampleGraphFileLabel = "File: ";
138              sampleGraphLengthLabel = "  Length: ";
139              sampleGraphPositionLabel ="  Position: ";
140              
141              uploadingMessageLabel = "Uploading...";
142              uploadCompletedMessageLabel = "Upload completed... Thank you for your submission!";
143         }
144
145         private void Russian() {
146                         }
147        
148         private void German() {
149         }
150                
151         private void Dutch() {
152         }
153
154         private void Italian() {
155          usernamePanelLabel = "Nome utente:";
156          usernamePanelText = "(lasciare in bianco se si vuole inviare come anonimo)";
157          
158          copyrightName = "Free Software Foundation";
159          gplAccepted = "Si";
160        
161          pleaseSelect = "Selezionare";
162          notApplicable = "non definito";
163          
164          genderPanelLabel = "Sesso:";
165          genderSelection = new String [3];
166          genderSelection[0] = pleaseSelect;   
167          genderSelection[1] = "Machio";   
168          genderSelection[2] = "Femmina";
169    
170          ageRangePanelLabel = "Fascia di età:";
171          ageSelection = new String [4];
172          ageSelection[0] = pleaseSelect; 
173          ageSelection[1] = "Giovane"
174          ageSelection[2] = "Adulto";
175          ageSelection[3] = "Anziano";
176    
177          dialectPanelLabel = "Dialetto di pronuncia:";
178          dialectSelection = new String [9];
179          dialectSelection[0] = pleaseSelect;   
180          dialectSelection[1] = "Italiano generico";   
181          dialectSelection[2] = "Italiano abruzzese";   
182          dialectSelection[3] = "Italiano calabrese";
183          dialectSelection[4] = "Italiano ciociaro";     
184          dialectSelection[5] = "Italiano milanese";
185          dialectSelection[6] = "Italiano pugliese";
186          dialectSelection[7] = "Italiano ";     
187          dialectSelection[8] = "Altro";
188        
189          microphonePanelLabel = "Tipo di Microfono:";
190          microphoneSelection = new String [9];
191          microphoneSelection[0] = pleaseSelect; 
192          microphoneSelection[1] = "Headset mic";   
193          microphoneSelection[2] = "USB Headset mic";   
194          microphoneSelection[3] = "Desktop Boom mic"
195          microphoneSelection[4] = "USB Desktop Boom mic"
196          microphoneSelection[5] = "Laptop Built-in mic";
197          microphoneSelection[6] = "WebCam mic";     
198          microphoneSelection[7] = "Studio mic";
199          microphoneSelection[8] = "Altro";
200        
201          uploadText = "<html>Cliccando il bottone \"Carica\", si accetta di assegnare il Copyright del parlato registrato a <br> "
202             + "la Free Software Foundation, e di rilasciare il tuo contributo nei termini della GNU Public Licence (\"GPL\"):" ;
203          uploadButtonLabel = "Carica";
204        
205          moreInfoText = "Per ulteriori informazioni sul Copyright e la GPL, premere qui:";
206          moreInfoButtonLabel = "Ulteriori Informazioni";   
207    
208          disclaimerText =
209             "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>"
210             +"Questo programma e fornito ASSOLUTAMENTE SENZA NESSUNA GARANZIA; neanche senza la sottintesa <br> "
211             +"garanzia di COMMERCIABILITA' o di ADEGUATEZZA PER UNO SCOPO PARTICOLARE.  Per<br>"
212             +"ulteriori dettagli cliccare il bottone \"Informazioni\" :";
213          aboutButtonLabel = "Informazioni";
214        
215          recordButton = "Registra";
216          stopButton = "Ferma";
217          playButton = "Ascolta";
218          
219          peakWarningLabel =  "Attenzione: il volume dell'ingresso potrebbe essere troppo alto";
220          sampleGraphFileLabel = "File: ";
221          sampleGraphLengthLabel = "  Lunghezza: ";
222          sampleGraphPositionLabel ="  Posizione: ";
223          
224          uploadingMessageLabel = "Caricamento...";
225          uploadCompletedMessageLabel = "Caricamento completato... Si ringrazia per il contributo!";
226      }
227        
228         private void Hebrew() {
229         }
230
231         private void Brazilian() {
232              usernamePanelLabel = "Usu�o:";
233              usernamePanelText = "(deixe em branco para submeter anonimamente)";
234              
235              copyrightName = "Funda� de Software Livre";
236              gplAccepted = "Sim";
237            
238              pleaseSelect = "Selecione";
239              notApplicable = "desconhecido";
240              
241              genderPanelLabel = "Sexo:";
242              genderSelection = new String [3];
243              genderSelection[0] = pleaseSelect;   
244              genderSelection[1] = "Masculino";   
245              genderSelection[2] = "Feminino";
246    
247              ageRangePanelLabel = "Faixa Et�a:";
248              ageSelection = new String [4];
249              ageSelection[0] = pleaseSelect; 
250              ageSelection[1] = "Jovem"
251              ageSelection[2] = "Adulto";
252              ageSelection[3] = "Idoso";
253        
254              dialectPanelLabel = "Dialeto de Pronuncia�:";
255              dialectSelection = new String [3];
256              dialectSelection[0] = pleaseSelect;   
257              dialectSelection[1] = "Portugu�Brasileiro";   
258              dialectSelection[2] = "Outro";
259            
260              microphonePanelLabel = "Tipo de Microfone:";
261              microphoneSelection = new String [9];
262              microphoneSelection[0] = pleaseSelect; 
263              microphoneSelection[1] = "Fone de Ouvido com Microfone";   
264              microphoneSelection[2] = "Fone de Ouvido USB com Microfone";   
265              microphoneSelection[3] = "Microfone de Mesa"
266              microphoneSelection[4] = "Microfone de Mesa USB"
267              microphoneSelection[5] = "Microfone de Laptop";
268              microphoneSelection[6] = "Microfone de WebCam";     
269              microphoneSelection[7] = "Microfone de Est�;
270              microphoneSelection[8] = "Outro";
271             
272              uploadText = "<html>Clicando no bot�\"Submeter\", voc�oncorda em ceder o Copyright de seu discurso gravado para <br> "
273                 + "a Funda� de Software Livre e licenciar sua submiss�sob a Licen�P�a GNU (\"GPL\"):" ;
274              uploadButtonLabel = "Submeter";
275            
276              moreInfoText = "Para mais informa�s sobre Copyright e GPL, clique aqui:";
277              moreInfoButtonLabel = "Mais informa�s";   
278        
279              disclaimerText =
280                  "<html>VoxForge SpeechSubmission Applet - Copyright (C) 2007 VoxForge<br>"
281                  +"Este programa vem com ABSOLUTAMENTE NENHUMA GARANTIA; nem mesmo as garantias<br> "
282                  +"impl�tas de COMERCIABILIDADE ou ADEQUA�O A UM PROP�ITO EM PARTICULAR.  Para<br>"
283                  +"mais detalhes clique no bot�\"Sobre\":";
284              aboutButtonLabel = "Sobre";
285            
286              recordButton = "Gravar";
287              stopButton = "Parar";
288              playButton = "Tocar";
289              
290              peakWarningLabel =  "Aviso: a entrada pode ser muito barulhenta";
291              sampleGraphFileLabel = "Arquivo: ";
292              sampleGraphLengthLabel = "  Tamanho: ";
293              sampleGraphPositionLabel ="  Posi�: ";
294              
295              uploadingMessageLabel = "Submetendo...";
296              uploadCompletedMessageLabel = "Submiss�completada... Obrigado por sua submiss�";
297         }
298        
299         public String getUsernamePanelLabel() {
300                 return usernamePanelLabel;
301         }
302
303         public String getUsernamePanelText() {
304                 return usernamePanelText;
305         }
306
307         public String getCopyrightName() {
308                 return copyrightName;
309         }
310
311         public String getGplAccepted() {
312                 return gplAccepted;
313         }
314
315         public String getPleaseSelect() {
316                 return pleaseSelect;
317         }
318
319         public String getNotApplicable() {
320                 return notApplicable;
321         }
322
323         public String getGenderPanelLabel() {
324                 return genderPanelLabel;
325         }
326
327         public String[] getGenderSelection() {
328                 return genderSelection;
329         }
330
331         public String getAgeRangePanelLabel() {
332                 return ageRangePanelLabel;
333         }
334
335         public String[] getAgeSelection() {
336                 return ageSelection;
337         }
338
339         public String getDialectPanelLabel() {
340                 return dialectPanelLabel;
341         }
342
343         public String[] getDialectSelection() {
344                 return dialectSelection;
345         }
346
347         public String getMicrophonePanelLabel() {
348                 return microphonePanelLabel;
349         }
350
351         public String[] getMicrophoneSelection() {
352                 return microphoneSelection;
353         }
354
355         public String getUploadText() {
356                 return uploadText;
357         }
358
359         public String getUploadButtonLabel() {
360                 return uploadButtonLabel;
361         }
362
363         public String getMoreInfoText() {
364                 return moreInfoText;
365         }
366
367         public String getMoreInfoButtonLabel() {
368                 return moreInfoButtonLabel;
369         }
370
371         public String getDisclaimerText() {
372                 return disclaimerText;
373         }
374
375         public String getAboutButtonLabel() {
376                 return aboutButtonLabel;
377         }
378
379         public String getRecordButton() {
380                 return recordButton;
381         }
382
383         public String getStopButton() {
384                 return stopButton;
385         }
386
387         public String getPlayButton() {
388                 return playButton;
389         }
390
391         public String getPeakWarningLabel() {
392                 return peakWarningLabel;
393         }
394
395         public String getSampleGraphFileLabel() {
396                 return sampleGraphFileLabel;
397         }
398
399         public String getSampleGraphLengthLabel() {
400                 return sampleGraphLengthLabel;
401         }
402
403         public String getSampleGraphPositionLabel() {
404                 return sampleGraphPositionLabel;
405         }
406        
407         public String getUploadingMessageLabel() {
408                 return uploadingMessageLabel;
409         }
410         public String getUploadCompletedMessageLabel() {
411                 return uploadCompletedMessageLabel;
412         }
413
414        
415 }