Coverage Report - de.glossmaker.gloss.language.Translation
 
Classes in this File Line Coverage Branch Coverage Complexity
Translation
11%
39/340
3%
10/286
14,364
 
 1  
 package de.glossmaker.gloss.language;
 2  
 
 3  
 
 4  
 import guihelper.statusbar.EStatusBarMessageLevel;
 5  
 import guihelper.statusbar.StatusBarMessagePublisher;
 6  
 import jancilla.encoding.EFileEncoding;
 7  
 import jancilla.util.Properties;
 8  
 import jancilla.util.PropertiesFactory;
 9  
 
 10  
 import java.io.File;
 11  
 import java.io.FileInputStream;
 12  
 import java.io.FileNotFoundException;
 13  
 import java.io.FileOutputStream;
 14  
 import java.util.Locale;
 15  
 import java.util.NoSuchElementException;
 16  
 
 17  
 import org.apache.log4j.Logger;
 18  
 
 19  
 import de.glossmaker.common.io.UnicodeInputStream;
 20  
 
 21  
 
 22  
 
 23  
 /**
 24  
  * This class loads the language file. If the language file doesn't exists English
 25  
  * default values will be returned.
 26  
  * 
 27  
  * @author Markus Flingelli
 28  
  *
 29  
  */
 30  
 public class Translation {
 31  6
         private static final Logger mLogger = Logger.getLogger(Translation.class);
 32  6
         private static Translation mTranslation = null;
 33  6
         private static String mLangauge = null;
 34  6
         private Properties mProps = null;
 35  
         
 36  
         
 37  6
         private Translation() {
 38  6
                 changeLanguage();
 39  6
         }
 40  
         
 41  
         private void changeLanguage() {
 42  15
                 FileInputStream fis = null; 
 43  15
                 String encoding = "ISO-8859-1";
 44  
                 try {
 45  15
                         File f = new File("");
 46  15
                         String fileName = f.getAbsoluteFile() +  "/resources/translations/language_" + 
 47  
                         Locale.getDefault().getLanguage().toUpperCase() + ".properties";
 48  15
                         fis = new FileInputStream(fileName);
 49  15
                         UnicodeInputStream uis = new UnicodeInputStream(fis, "ISO-8859-1");
 50  15
                         encoding = uis.getEncoding();
 51  
                         
 52  15
                         mProps = PropertiesFactory.createSortedProperties();
 53  15
                         FileInputStream inputStream = new FileInputStream(fileName);
 54  15
                         EFileEncoding fileEncoding = EFileEncoding.ISO_8859_1;
 55  15
                         if (encoding.equals(EFileEncoding.US_ASCII.toString())) {
 56  0
                                 fileEncoding = EFileEncoding.US_ASCII;
 57  15
                         } else if (encoding.equals(EFileEncoding.UTF_16.toString())) {
 58  0
                                 fileEncoding = EFileEncoding.UTF_16;
 59  15
                         } else if (encoding.equals(EFileEncoding.UTF_16BE.toString())) {
 60  0
                                 fileEncoding = EFileEncoding.UTF_16BE;
 61  15
                         } else if (encoding.equals(EFileEncoding.UTF_16LE.toString())) {
 62  0
                                 fileEncoding = EFileEncoding.UTF_16LE;
 63  15
                         } else if (encoding.equals(EFileEncoding.UTF_8.toString())) {
 64  0
                                 fileEncoding = EFileEncoding.UTF_8;
 65  
                         }
 66  15
                         mProps.load(inputStream, fileEncoding);
 67  0
                 } catch (FileNotFoundException e) {
 68  0
                         mLogger.error(e);
 69  15
                 } 
 70  15
         }
 71  
         
 72  
         public static Translation getInstance() {
 73  144
                 if (mTranslation == null) {
 74  6
                         mTranslation = new Translation();
 75  6
                         mLangauge = Locale.getDefault().getLanguage();
 76  
                 }
 77  144
                 if (Locale.getDefault().getLanguage().equals(mLangauge) == false) {
 78  9
                         mTranslation.changeLanguage();
 79  9
                         mLangauge = Locale.getDefault().getLanguage();
 80  
                 }
 81  144
                 return mTranslation;
 82  
         }
 83  
         
 84  
                 
 85  
         public void saveFile(String fileName) {
 86  
                 try {
 87  0
                         mProps.store(new FileOutputStream(fileName));
 88  0
                 } catch (FileNotFoundException e) {
 89  0
                         mLogger.error(e);
 90  0
                         StatusBarMessagePublisher.getInstance().publish(EStatusBarMessageLevel.ERROR, "File "
 91  
                                         + fileName + " not found.");
 92  0
                 }
 93  0
         }
 94  
         
 95  
         
 96  
         public String getValue(String key) {        
 97  89
                 Translation.getInstance();
 98  89
                 String result = null;
 99  89
                 if (mProps != null) {
 100  
                         try {
 101  89
                                 result = mProps.getProperty(key);                        
 102  0
                         } catch (NoSuchElementException e) {
 103  0
                                 result = getDefaultValue(key);
 104  89
                         }
 105  
                 }  else {
 106  0
                         result = getDefaultValue(key);
 107  
                 }
 108  
                 
 109  89
                 return result;
 110  
         }
 111  
         
 112  
         public Character getChar(String key) {
 113  0
                 Translation.getInstance();
 114  0
                 Character result = null;
 115  0
                 if (mProps != null) {
 116  
                         try {
 117  0
                                 result = mProps.getProperty(key).charAt(0);                        
 118  0
                         } catch (NoSuchElementException e) {
 119  0
                                 result = getDefaultValue(key).charAt(0);
 120  0
                         }
 121  
                 }  else {
 122  0
                         result = getDefaultValue(key).charAt(0);
 123  
                 }
 124  
                 
 125  0
                 return result;
 126  
         }
 127  
         
 128  
         public String getValue(String key, String ... str) {
 129  1
                 return String.format(getValue(key), (Object[])str);
 130  
         }
 131  
         
 132  
         private String getMenuValues(String key) {
 133  0
                 String result = "";
 134  0
                 if (key.equals("menu.file.text")) {
 135  0
                         result = "File";
 136  0
                 } else if (key.equals("menu.file.new.text")) {
 137  0
                         result = "New";
 138  0
                 } else if (key.equals("menu.file.shortcut")) {
 139  0
                         result = "F";
 140  0
                 } else if (key.equals("menu.file.new.tooltip")) { 
 141  0
                         result = "Create a new file"; 
 142  0
                 } else if (key.equals("menu.file.open.text")) {
 143  0
                         result = "Open";
 144  0
                 } else if (key.equals("menu.file.open.tooltip")) {
 145  0
                         result = "Opens an existing glossary file";
 146  0
                 } else if (key.equals("menu.file.last_opened.text")) {
 147  0
                         result = "Reopen file";
 148  0
                 } else if (key.equals("menu.file.last_opened.tooltip")) {
 149  0
                         result = "Reopen an alreadey opened file.";
 150  0
                 } else if (key.equals("menu.file.save.text")) {
 151  0
                         result = "Save";
 152  0
                 } else if (key.equals("menu.file.save.tooltip")) {
 153  0
                         result = "Save the opened glossary file";
 154  0
                 } else if (key.equals("menu.file.save_as.text")) {
 155  0
                         result = "Save as";
 156  0
                 } else if (key.equals("menu.file.import.text")) {
 157  0
                         result = "Import file";
 158  0
                 } else if (key.equals("menu.file.import.tooltip")) {
 159  0
                         result = "Imports a glossary file and adds its content to the open file.";
 160  0
                 } else if (key.equals("menu.file.exit.text")) {
 161  0
                         result = "Exit";
 162  0
                 } else if (key.equals("menu.file.exit.tooltip")) {
 163  0
                         result = "Terminates the application";
 164  0
                 } else if (key.equals("menu.edit.text")) {
 165  0
                         result = "Edit";
 166  0
                 } else if (key.equals("menu.edit.shortcut")) {
 167  0
                         result = "E";
 168  0
                 } else if (key.equals("menu.edit.undo.text")) {
 169  0
                         result = "Undo";
 170  0
                 } else if (key.equals("menu.edit.undo.tooltip")) {
 171  0
                         result = "Undoes the last change";
 172  0
                 } else if (key.equals("menu.edit.redo.text")) {
 173  0
                         result = "Redo";
 174  0
                 } else if (key.equals("menu.edit.redo.tooltip")) {
 175  0
                         result = "Redoes the last undo";
 176  0
                 } else if (key.equals("menu.refactor.text")) {
 177  0
                         result = "Refactor";
 178  0
                 } else if (key.equals("menu.edit.shortcut")) {
 179  0
                         result = "R";
 180  0
                 } else if (key.equals("menu.refactor.check_gloss_consistency.text")) {
 181  0
                         result = "Check gloss consistency";
 182  0
                 } else if (key.equals("menu.refactor.check_gloss_consistency.tooltip")) {
 183  0
                         result = "Checks if all gloss references refer to existing items.";
 184  0
                 } else if (key.equals("menu.options.text")) {
 185  0
                         result = "Options";
 186  0
                 } else if (key.equals("menu.edit.shortcut")) {
 187  0
                         result = "O";                
 188  0
                 } else if (key.equals("menu.options.language.text")) {
 189  0
                         result = "Languages";
 190  0
                 } else if (key.equals("menu.options.language.tooltip")) {
 191  0
                         result = "Change the language";
 192  0
                 } else if (key.equals("menu.options.bibtex.text")) {
 193  0
                         result = "BibTeX";
 194  0
                 } else if (key.equals("menu.options.bibtex.tooltip")) {
 195  0
                         result = "Choose the BibTeX file.";
 196  0
                 } else if (key.equals("menu.help.text")) {
 197  0
                         result = "Help";
 198  0
                 } else if (key.equals("menu.edit.shortcut")) {
 199  0
                         result = "H";                
 200  0
                 } else if (key.equals("menu.help.help.text")) {
 201  0
                         result = "Help";
 202  0
                 } else if (key.equals("menu.help.help.tooltip")) {
 203  0
                         result = "Shows the help dialog";
 204  0
                 } else if (key.equals("menu.help.info.text")) {
 205  0
                         result = "Info";
 206  0
                 } else if (key.equals("menu.help.info.tooltip")) {
 207  0
                         result = "Shows the information dialog box";
 208  
                 } 
 209  
                 
 210  0
                 return result;
 211  
         }
 212  
         
 213  
         private String getImportGlossDialogValues(String key) {
 214  0
                 String result = "";
 215  0
                 if (key.equals("importgloss.frame.title.text")) {
 216  0
                         result = "Import Glossary File";
 217  0
                 } else if (key.equals("importgloss.table.column.import.text")) {
 218  0
                         result = "Import";
 219  0
                 } else if (key.equals("importgloss.table.column.operation.text")) {
 220  0
                         result = "Operation";
 221  0
                 } else if (key.equals("importgloss.table.column.heading.text")) {
 222  0
                         result = "Heading";
 223  0
                 } else if (key.equals("importgloss.table.column.key.text")) {
 224  0
                         result = "Key";
 225  0
                 } else if (key.equals("importgloss.table.column.word.text")) {
 226  0
                         result = "Word";
 227  0
                 } else if (key.equals("importgloss.table.column.definition.text")) {
 228  0
                         result = "Definition";
 229  0
                 } else if (key.equals("importgloss.button.ok.text")) {
 230  0
                         result = "Ok";
 231  0
                 } else if (key.equals("importgloss.button.ok.tooltip")) {
 232  0
                         result = "Imports the selected items in the opened file.";
 233  0
                 } else if (key.equals("importgloss.button.cancel.text")) {
 234  0
                         result = "Cancel";
 235  0
                 } else if (key.equals("importgloss.button.cancel.tooltip")) {
 236  0
                         result = "";
 237  0
                 } else if (key.equals("importgloss.button.help.text")) {
 238  0
                         result = "Help";
 239  0
                 } else if (key.equals("importgloss.button.help.tooltip")) {
 240  0
                         result = "Shows help dialog";
 241  
                 }
 242  
 
 243  0
                 return result;
 244  
         }
 245  
 
 246  
         private String getDefinitionPanelValues(String key) {
 247  0
                 String result = "";
 248  0
                 if (key.equals("definition.popup.menu.copy.text")) {
 249  0
                         result = "Copy";
 250  0
                 } else if (key.equals("definition.popup.menu.paste.text")) {
 251  0
                         result = "Paste";
 252  0
                 } else if (key.equals("definition.popup.menu.cut.text")) {
 253  0
                         result = "Cut";
 254  0
                 } else if (key.equals("definition.popup.menu.select_all.text")) {
 255  0
                         result = "Select all";
 256  0
                 } else if (key.equals("definition.popup.menu.gloss.text")) {
 257  0
                         result = "Add glossary references";
 258  0
                 } else if (key.equals("definition.popup.menu.bibtex.text")) {
 259  0
                         result = "Add BibTeX reference";
 260  0
                 } else if (key.equals("definition.toolbar.menu.insert.text")) {
 261  0
                         result = "Insert";
 262  0
                 } else if (key.equals("definition.toolbar.menu.insert.tooltip")) {
 263  0
                         result = "";
 264  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.text")) {
 265  0
                         result = "Enumerations";
 266  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.tooltip")) {
 267  0
                         result = "";
 268  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.itemization.text")) {
 269  0
                         result = "Itemization";
 270  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.itemization.tooltip")) {
 271  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;begin{itemize}</code><br/>&nbsp;&nbsp;" +
 272  
                         "<code>&#92;item</code><br/><code>&#92;end{itemize}</code></body></html>";
 273  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.enumeration.text")) {
 274  0
                         result = "Enumeration";
 275  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.enumeration.tooltip")) {
 276  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;begin{enumerate}</code><br/>&nbsp;&nbsp;" + 
 277  
                         "<code>&#92;item</code><br/><code>&#92;end{enumerate}</code></body></html>";
 278  0
                 } else if (key.equals("definition.toolbar.menu.insert.enumerations.description.text")) {
 279  0
                         result = "Description";
 280  0
                 } else if (key.equals("definition.toolbar.menu.insert.ienumerations.description.tooltip")) {
 281  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;begin{description}</code><br/>&nbsp;&nbsp;" + 
 282  
                         "<code>&#92;item[]</code><br/><code>&#92;end{description}</code></body></html>";
 283  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.text")) {
 284  0
                         result = "Code Environments";
 285  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.tooltip")) {
 286  0
                         result = "";
 287  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.code.text")) {
 288  0
                         result = "Code";
 289  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.code.tooltip")) {
 290  0
                         result = "<html><body>F�gt folgendes Konstrukt ein:<br/><br/><code>&#92;begin{verbatim}</code>" + 
 291  
                         "<br/><br/><code>&#92;end{verbatim}</code></body></html>";
 292  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.code_white_space.text")) {
 293  0
                         result = "Code with visible White Spaces";
 294  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.code_white_space.tooltip")) {
 295  0
                         result = "<html><body>F�gt folgendes Konstrukt ein:<br/><br/><code>&#92;begin{verbatim*}</code>" + 
 296  
                         "<br/><br/><code>&#92;end{verbatim*}</code></body></html>";
 297  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.embededd_code.text")) {
 298  0
                         result = "Embedded Code";
 299  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.embedded_code.tooltip")) {
 300  0
                         result = "<html><body>F�gt folgendes Konstrukt ein:<br/><br/><code>&#92;verb||</code></body></html>";
 301  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.embedded_code_white_space.text")) {
 302  0
                         result = "Embedded Code with visible White Spaces";
 303  0
                 } else if (key.equals("definition.toolbar.menu.insert.code_environments.embededd_code_white_space.tooltip")) {
 304  0
                         result = "<html><body>F�gt folgendes Konstrukt ein:<br/><br/><code>&#92;verb*||</code></body></html>";
 305  0
                 } else if (key.equals("definition.toolbar.menu.format.text")) {
 306  0
                         result = "Format";
 307  0
                 } else if (key.equals("definition.toolbar.menu.format.tooltip")) {
 308  0
                         result = "";
 309  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.text")) {
 310  0
                         result = "Font Family";
 311  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.tooltip")) {
 312  0
                         result = "";
 313  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.roman.text")) {
 314  0
                         result = "Roman";
 315  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.roman.tooltip")) {
 316  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;rmfamily</code></body></html>";
 317  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.sans_serif.text")) {
 318  0
                         result = "Sans Serif";
 319  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.sans_serif.tooltip")) {
 320  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;sffamily</code></body></html>";
 321  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.typewriter.text")) {
 322  0
                         result = "Typewriter";
 323  0
                 } else if (key.equals("definition.toolbar.menu.format.font_family.typewriter.tooltip")) {
 324  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;ttfamily</code></body></html>";
 325  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.text")) {
 326  0
                         result = "Font Shapes";
 327  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.tooltip")) {
 328  0
                         result = "";
 329  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.vertical.text")) {
 330  0
                         result = "Vertical";
 331  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.vertical.tooltip")) {
 332  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;upshape</code></body></html>";
 333  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.italic.text")) {
 334  0
                         result = "Italic";
 335  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.italic.tooltip")) {
 336  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;itshape</code></body></html>";
 337  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.slanted.text")) {
 338  0
                         result = "Slanted";
 339  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.slanted.tooltip")) {
 340  0
                         result = "<html><body>Inserts:<br/><br/><code>&#92;slshape</code></body></html>";
 341  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.small_caps.text")) {
 342  0
                         result = "Small Caps";
 343  0
                 } else if (key.equals("definition.toolbar.menu.format.font_shapes.small_caps.tooltip")) {
 344  0
                         result = "<html><body>Insert:<br/><br/><code>&#92;scshape</code></body></html>";
 345  0
                 } else if (key.equals("definition.toolbar.menu.format.font_series.text")) {
 346  0
                         result = "Font Series";
 347  0
                 } else if (key.equals("definition.toolbar.menu.format.font_series.tooltip")) {
 348  0
                         result = "Medium";
 349  0
                 } else if (key.equals("definition.toolbar.menu.format.font_series.medium.text")) {
 350  0
                         result = "";
 351  0
                 } else if (key.equals("definition.toolbar.menu.format.font_series.medium.tooltip")) {
 352  0
                         result = "<html><body>Insert:<br/><br/><code>&#92;mdseries</code></body></html>";
 353  0
                 } else if (key.equals("definition.toolbar.menu.format.font_series.bold.text")) {
 354  0
                         result = "Bold";
 355  0
                 } else if (key.equals("definition.toolbar.menu.format.font_series.bold.tooltip")) {
 356  0
                         result = "<html><body>Insert:<br/><br/><code>&#92;bfseries</code></body></html>";
 357  
                 }
 358  
         
 359  0
                 return result;
 360  
         }
 361  
         
 362  
         /** This method sets the default values if no language file is there. The default
 363  
          * values are in English. */
 364  
         private String getDefaultValue(String key) {
 365  0
                 String result = "";
 366  0
                 if (key.startsWith("menu.")) {
 367  0
                         result = getMenuValues(key);
 368  0
                 } else if (key.startsWith("importgloss.")) {
 369  0
                         result = getImportGlossDialogValues(key);
 370  0
                 } else if (key.startsWith("definition.")) {
 371  0
                         result = getDefinitionPanelValues(key);
 372  0
                 } else         if (key.equals("tree.root.text")) {
 373  0
                         result = "[New Glossar]";
 374  0
                 } else if (key.equals("tree.popup.add_item.text")) {
 375  0
                         result = "Add item";
 376  0
                 } else if (key.equals("tree.popup.add_item.tooltip")) {
 377  0
                         result = "Adds an new item";
 378  0
                 } else if (key.equals("tree.popup.add_item.word_text")) {
 379  0
                         result = "New Item";
 380  0
                 } else if (key.equals("tree.popup.remove_item.text")) {
 381  0
                         result = "Remove item";
 382  0
                 } else if (key.equals("tree.popup.remove_item.tooltip")) {
 383  0
                         result = "Removes the selected item";
 384  0
                 } else if (key.equals("statusbar.info.new_file.text")) {
 385  0
                         result = "New project created.";
 386  0
                 } else if (key.equals("statusbar.info.file_saved.text")) {
 387  0
                         result = "File %s saved.";
 388  0
                 } else if (key.equals("statusbar.info.file_opened.text")) {
 389  0
                         result = "File %s opened.";
 390  0
                 } else if (key.equals("statusbar.warning.key_exists.text")) {
 391  0
                         result = "Key not changed because key='%s' already exists.";
 392  0
                 } else if (key.equals("statusbar.warning.empty_key.text")) {
 393  0
                         result = "No item added because item with empty key already exists.";
 394  0
                 } else if (key.equals("statusbar.info.item_removed")) {
 395  0
                         result = "Item with key='%s' removed.";
 396  0
                 } else if (key.equals("statusbar.info.references_valid")) {
 397  0
                         result = "All references are valid.";
 398  0
                 } else if (key.equals("confirmation.save_changes.text")) {
 399  0
                         result = "Do you want to save the changes?";
 400  0
                 } else if (key.equals("confirmation.save_changes.title")) {
 401  0
                         result = "Confirmation";
 402  0
                 } else if (key.equals("filechooser.save_as.title")) {
 403  0
                         result = "Set the new filename";
 404  0
                 } else if (key.equals("filechosser.open.title")) {
 405  0
                         result = "Choose the glossar file";
 406  0
                 } else if (key.equals("glossfilechooser.description.text")) {
 407  0
                         result = "Glossar files";
 408  0
                 } else if (key.equals("datastructure.items.key_not_exists")) {
 409  0
                         result = "The key='%s' doesn't exist in the item with the key='%s'.";
 410  0
                 } else if (key.equals("frame.help.title")) {
 411  0
                         result = "GlossMaker Help";
 412  0
                 } else if (key.equals("eoperation.nothing.text")) {
 413  0
                         result = "Nothing";
 414  0
                 } else if (key.equals("eoperation.override.text")) {
 415  0
                         result = "Override";
 416  0
                 } else if (key.equals("eoperation.merge.text")) {
 417  0
                         result = "Merge";
 418  0
                 } else if (key.equals("eoperation.keep.text")) {
 419  0
                         result = "Keep";
 420  0
                 } else if (key.equals("eoperation.import.text")) {
 421  0
                         result = "Import";
 422  0
                 } else if (key.equals("options.bibtex.filename.text")) {
 423  0
                         result = "BibTeX filename";
 424  0
                 } else if (key.equals("options.bibtex.button.ok.text")) {
 425  0
                         result = "OK";
 426  0
                 } else if (key.equals("options.bibtex.button.cancel.text")) {
 427  0
                         result = "Cancel";
 428  0
                 } else if (key.equals("options.bibtex.button.help.text")) {
 429  0
                         result = "Help";
 430  
                 }
 431  
                                 
 432  0
                 return result;
 433  
         }
 434  
 }