Skip to content

i18n Configuration failed to load tw-TW #131

@muzsor

Description

@muzsor

Hello!

I tried changing the Chinese (Taiwan) language code in supportedLngs from zh-TW to tw-TW in the config.js file and also renamed the zh-TW folder in the locales directory to tw-TW.

Before

After

/* src/i18n/config.js */

// Add names for each locale to
// show the user in our locale
// switcher.
export const supportedLngs = {
  "en-US": "English",
  "de-DE": "Deutsch",
  "zh-TW": "繁體中文",
  "zh-CN": "简体中文",
  "pt-BR": "Português (BR)"
}
/* src/i18n/config.js */

// Add names for each locale to
// show the user in our locale
// switcher.
export const supportedLngs = {
  "en-US": "English",
  "de-DE": "Deutsch",
  "tw-TW": "繁體中文",
  "cns-CN": "简体中文",
  "br-BR": "Português (BR)",
  "jp-JP": "日本語"
}
Image

When I tested it, I got this error: i18next::languageUtils: rejecting language code not found in supportedLngs: ak-TW

Image

I've tested with cns-CN, br-Br and jp-JP, and those work fine.

de-DE
Deutsch
cns-CN
简体中文
br-Br
Português (BR)
jp-JP
日本語
Image Image Image Image

My main goal is to make sure it displays correctly in other languages, but I'm not really sure how to configure the i18n settings.

I also tried a few other approaches, but none of them worked.

Another idea I had was to use region codes instead of language codes, and just keep the original supportedLngs values.

Image

I'm not sure if there's a better way, so I'd like to open this up for discussion.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions