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:
Sunniva Løvstad 2025-07-22 04:37:49 +02:00 committed by GitHub
parent 24d2501187
commit 25af5a232f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 148 additions and 2 deletions

View file

@ -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 {