diff --git a/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts b/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts index 34ef2a4608..1c0a66f1b0 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/backoffice/backoffice.element.ts @@ -46,7 +46,7 @@ export class UmbBackofficeElement extends UmbLitElement { this.consumeContext(UMB_AUTH, (auth) => { this.observe(auth.currentUser, (user) => { if (user) { - const languageIsoCode = user.languageIsoCode ?? 'en_us'; + const languageIsoCode = user.languageIsoCode ?? 'en-us'; localizationContext.setLanguage(languageIsoCode); } }); diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/en_us.js b/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/assets/lang/en_us.js rename to src/Umbraco.Web.UI.Client/src/assets/lang/en-us.js diff --git a/src/Umbraco.Web.UI.Client/src/libs/localization-api/localization.context.ts b/src/Umbraco.Web.UI.Client/src/libs/localization-api/localization.context.ts index b77889ffcc..cc6c54fb9f 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/localization-api/localization.context.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/localization-api/localization.context.ts @@ -18,8 +18,8 @@ export class UmbLocalizationContext { * Set a new language which will query the manifests for translations and register them. * Eventually it will update all codes visible on the screen. * - * @param languageIsoCode The language to use (example: 'en_us') - * @param fallbackLanguageIsoCode The fallback language to use (example: 'en_us', default: 'en_us') + * @param languageIsoCode The language to use (example: 'en-us') + * @param fallbackLanguageIsoCode The fallback language to use (example: 'en-us', default: 'en-us') */ setLanguage(languageIsoCode: string, fallbackLanguageIsoCode?: string) { this.#translationRegistry.register(languageIsoCode, fallbackLanguageIsoCode); diff --git a/src/Umbraco.Web.UI.Client/src/libs/localization-api/registry/translation.registry.ts b/src/Umbraco.Web.UI.Client/src/libs/localization-api/registry/translation.registry.ts index 3c7a866f6e..0b82ca0a0a 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/localization-api/registry/translation.registry.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/localization-api/registry/translation.registry.ts @@ -18,7 +18,7 @@ export class UmbTranslationRegistry { return this.#innerDictionary.asObservable(); } - register(userCulture: string, fallbackCulture = 'en_us') { + register(userCulture: string, fallbackCulture = 'en-us') { userCulture = userCulture.toLowerCase(); fallbackCulture = fallbackCulture.toLowerCase(); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts index 3d08fdad0f..a41650b2cc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts @@ -6,11 +6,11 @@ const translationManifests: Array = [ type: 'translations', alias: 'Umb.Translations.En_US', weight: -100, - name: 'English (UK)', + name: 'English (US)', meta: { - culture: 'en_us', + culture: 'en-us', }, - loader: () => import('../../../assets/lang/en_us.js') + loader: () => import('../../../assets/lang/en-us.js'), }, ]; diff --git a/src/Umbraco.Web.UI.Client/storybook/stories/extending/localization.mdx b/src/Umbraco.Web.UI.Client/storybook/stories/extending/localization.mdx index 08efcdbc14..250bedb902 100644 --- a/src/Umbraco.Web.UI.Client/storybook/stories/extending/localization.mdx +++ b/src/Umbraco.Web.UI.Client/storybook/stories/extending/localization.mdx @@ -24,9 +24,9 @@ The manifest can be added through the `umbraco-package.json` file like this: "alias": "MyPackage.Lang.EnUS", "name": "English (United States)", "meta": { - "culture": "en_us" + "culture": "en-us" }, - "js": "/App_Plugins/MyPackage/lang/en_us.js" + "js": "/App_Plugins/MyPackage/lang/en-us.js" } ] } @@ -36,7 +36,7 @@ If you do not have many translations, you can also choose to include them direct ```json "meta": { - "culture": "en_us", + "culture": "en-us", "translations": { "section": { "key1": "value1",