Localizer provides localized strings for a specific language.
| 11 | |
| 12 | // Localizer provides localized strings for a specific language. |
| 13 | type Localizer interface { |
| 14 | // Text returns a translated string by key. |
| 15 | // It should be used for messages, captions, v1/v2 keys, etc. |
| 16 | // Do NOT pass condition codes here. |
| 17 | Text(lang, key string) string |
| 18 | |
| 19 | // Condition returns translated weather condition by numeric code. |
| 20 | Condition(lang string, code int) string |
| 21 | |
| 22 | // ConditionByName returns translated condition by its English name. |
| 23 | ConditionByName(lang, englishName string) string |
| 24 | |
| 25 | // File returns raw file content (help.txt, etc.) |
| 26 | File(lang, name string) (string, error) |
| 27 | } |
| 28 | |
| 29 | // LocalizeFunc is a language-bound text localization function. |
| 30 | type LocalizeFunc func(key string) string |
no outgoing calls
no test coverage detected