feat(localization): Add in Bokmål and Nynorsk translations (#855)
* feat(localization): add bokmål and nynorsk translations * feat(localization): update tests for Bokmål and Nynorsk * docs(localization): document bokmål and nynorsk locales * fix(locales/nb,nn): remove unicode ellipsis to make tests pass Signed-off-by: Xe Iaso <me@xeiaso.net> * style(localization): sort languages to make test output stable Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: spelling check-spelling run (pull_request) for main Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev> --------- Signed-off-by: Xe Iaso <me@xeiaso.net> Signed-off-by: Xe Iaso <xe.iaso@techaro.lol> Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> Co-authored-by: Xe Iaso <me@xeiaso.net> Co-authored-by: Xe Iaso <xe.iaso@techaro.lol>
This commit is contained in:
parent
24d2501187
commit
25af5a232f
6 changed files with 148 additions and 2 deletions
|
|
@ -21,6 +21,8 @@ func TestLocalizationService(t *testing.T) {
|
|||
"fr": "Chargement...",
|
||||
"ja": "ロード中...",
|
||||
"is": "Hleður...",
|
||||
"nb": "Laster inn...",
|
||||
"nn": "Lastar inn...",
|
||||
"pt-BR": "Carregando...",
|
||||
"tr": "Yükleniyor...",
|
||||
"ru": "Загрузка...",
|
||||
|
|
@ -28,7 +30,16 @@ func TestLocalizationService(t *testing.T) {
|
|||
"zh-TW": "載入中...",
|
||||
}
|
||||
|
||||
for lang, expected := range loadingStrMap {
|
||||
var keys []string
|
||||
|
||||
for lang := range loadingStrMap {
|
||||
keys = append(keys, lang)
|
||||
}
|
||||
|
||||
sort.Strings(keys)
|
||||
|
||||
for _, lang := range keys {
|
||||
expected := loadingStrMap[lang]
|
||||
t.Run(fmt.Sprintf("%s localization", lang), func(t *testing.T) {
|
||||
localizer := service.GetLocalizer(lang)
|
||||
result := localizer.MustLocalize(&i18n.LocalizeConfig{MessageID: "loading"})
|
||||
|
|
@ -44,7 +55,7 @@ func TestLocalizationService(t *testing.T) {
|
|||
"mascot_design", "try_again", "go_home", "javascript_required",
|
||||
}
|
||||
|
||||
for lang := range loadingStrMap {
|
||||
for _, lang := range keys {
|
||||
t.Run(fmt.Sprintf("All required keys exist in %s", lang), func(t *testing.T) {
|
||||
loc := service.GetLocalizer(lang)
|
||||
for _, key := range requiredKeys {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue