X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fl10n%2FTranslator.java;fp=core%2Fsrc%2Fnet%2Fsf%2Fopenrocket%2Fl10n%2FTranslator.java;h=5211ed730d80868449f09e265fc5dd9a578196d5;hb=9349577cdfdff682b2aabd6daa24fdc3a7449b58;hp=9eed2cdfa51ada85ce290e1941df03676c1ccfb7;hpb=30ba0a882f0c061176ba14dbf86d3d6fad096c02;p=debian%2Fopenrocket diff --git a/core/src/net/sf/openrocket/l10n/Translator.java b/core/src/net/sf/openrocket/l10n/Translator.java index 9eed2cdf..5211ed73 100644 --- a/core/src/net/sf/openrocket/l10n/Translator.java +++ b/core/src/net/sf/openrocket/l10n/Translator.java @@ -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. + *

+ * 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. + *

+ * 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); + }