ToggleLocale switches between zh and en.
()
| 19 | |
| 20 | // ToggleLocale switches between zh and en. |
| 21 | func ToggleLocale() { |
| 22 | if currentLocale == "zh" { |
| 23 | currentLocale = "en" |
| 24 | } else { |
| 25 | currentLocale = "zh" |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | // T returns the translated string for the given key. |
| 30 | func T(key string) string { |