Material localization support
[debian/openrocket] / core / src / net / sf / openrocket / l10n / Translator.java
index 9eed2cdfa51ada85ce290e1941df03676c1ccfb7..5211ed730d80868449f09e265fc5dd9a578196d5 100644 (file)
@@ -22,4 +22,33 @@ public interface Translator {
         */
        public String get(String key);
        
+       
+       /**
+        * Retrieve a translated string based on a base key and base (English) version of the text.
+        * The base text is normalized before using as a key.
+        * <p>
+        * This is meant to be used in very specific cases where the English name is
+        * used as a key for translation and storage.  If a translation is not found,
+        * the base text is used instead.
+        * 
+        * @param base          the base for the logical key
+        * @param text          the base (English) text to translate
+        * @return                      the translated string, or "text" if not found
+        */
+       public String get(String base, String text);
+       
+       
+       /**
+        * Find the base (English) version of a translated text.
+        * <p>
+        * This is the opposite operation of {@link #get(String, String)}, and
+        * meant for use in very specific cases when storing the values of
+        * translated texts.
+        * 
+        * @param base                  the base for the logical key
+        * @param translation   the translated string
+        * @return                              the base text, or the translation if not found.
+        */
+       public String getBaseText(String base, String translation);
+       
 }