@@ -6,9 +6,11 @@ import { LitElement, customElement, property } from '@umbraco-cms/backoffice/ext
6
6
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api' ;
7
7
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api' ;
8
8
9
+ const initialLanguage = 'en-us' ;
10
+
9
11
@customElement ( 'umb-localize-controller-host' )
10
12
class UmbLocalizeControllerHostElement extends UmbElementMixin ( LitElement ) {
11
- @property ( ) lang = 'en-us' ;
13
+ @property ( ) lang = initialLanguage ;
12
14
}
13
15
14
16
@customElement ( 'umb-localization-render-count' )
@@ -36,7 +38,7 @@ interface TestLocalization extends UmbLocalizationSetBase {
36
38
37
39
//#region Localizations
38
40
const english : TestLocalization = {
39
- $code : 'en-us ' ,
41
+ $code : 'en' ,
40
42
$dir : 'ltr' ,
41
43
close : 'Close' ,
42
44
logout : 'Log out' ,
@@ -81,8 +83,8 @@ describe('UmbLocalizeController', () => {
81
83
82
84
beforeEach ( async ( ) => {
83
85
umbLocalizationManager . registerManyLocalizations ( [ english , danish , danishRegional ] ) ;
84
- document . documentElement . lang = english . $code ;
85
- document . documentElement . dir = english . $dir ;
86
+ document . documentElement . lang = initialLanguage ;
87
+ document . documentElement . dir = 'ltr' ;
86
88
await aTimeout ( 0 ) ;
87
89
const host = {
88
90
getHostElement : ( ) => document . createElement ( 'div' ) ,
@@ -101,7 +103,7 @@ describe('UmbLocalizeController', () => {
101
103
} ) ;
102
104
103
105
it ( 'should have a default language' , ( ) => {
104
- expect ( controller . lang ( ) ) . to . equal ( english . $code ) ;
106
+ expect ( controller . lang ( ) ) . to . equal ( initialLanguage ) ;
105
107
} ) ;
106
108
107
109
it ( 'should update the language when the language changes' , async ( ) => {
0 commit comments