001package org.hl7.fhir.utilities; 002 003import java.util.Date; 004import java.util.Map; 005import java.util.Set; 006 007public interface TranslationServices { 008 /** 009 * General translation functionality - given a string, translate it to a different language 010 * 011 * @param context - for debugging purposes 012 * @param value - the string to translate 013 * @param targetLang - the target language to translate to. 014 * 015 * @return the translated string, or value if no translation is found 016 */ 017 String translate(String context, String value, String targetLang); 018 019 /** 020 * General translation functionality - given a string, translate it to a different language, but also perform String.format on the outcome. 021 * 022 * @param contest 023 * @param lang 024 * @param string2 025 * @param args 026 * @return 027 */ 028 String translateAndFormat(String contest, String lang, String string2, Object... args); 029 030 /** 031 * equivalent to the general translation operation, but the context that provides the transations specifies the target language 032 * 033 * @param context 034 * @param value 035 * @return 036 */ 037 String translate(String context, String value); 038 039 /** 040 * Get a list of all translations available for a phrase 041 * 042 * @param value 043 * @return 044 */ 045 Map<String, String> translations(String value); 046 047 /** 048 * localization for converting a decimal to language specific representation 049 * 050 * @param value 051 * @return 052 */ 053 String toStr(float value); 054 055 /** 056 * localization for converting a date to language specific representation 057 * 058 * @param value 059 * @return 060 */ 061 String toStr(Date value); 062 063 /** 064 * get a list of translation codes by category 065 * @param category 066 * @return 067 */ 068 Set<String> listTranslations(String category); 069 070}