@@ -6,63 +6,63 @@ describe('getLanguagePath', () => {
66 { languageName : 'English' , shorthand : 'en' } ,
77 { languageName : 'Polish' , shorthand : 'pl' } ,
88 ] ;
9- const fallbackLanguage = 'en' ;
9+ const defaultLanguage = 'en' ;
1010
1111 describe ( 'when showDefaultLanguageInPath is false' , ( ) => {
12- it ( 'should return the correct path when pathname starts with a language code and target is fallback ' , ( ) => {
12+ it ( 'should return the correct path when pathname starts with a language code and target is default ' , ( ) => {
1313 const pathname = '/no/some/path' ;
1414 const targetLanguage = 'en' ;
1515
1616 const result = getLanguagePath (
1717 pathname ,
1818 targetLanguage ,
1919 supportedLanguages ,
20- fallbackLanguage ,
20+ defaultLanguage ,
2121 false ,
2222 ) ;
2323
2424 expect ( result ) . toBe ( '/some/path' ) ;
2525 } ) ;
2626
27- it ( 'should return the correct path when pathname starts with a language code and target is not fallback ' , ( ) => {
27+ it ( 'should return the correct path when pathname starts with a language code and target is not default ' , ( ) => {
2828 const pathname = '/en/some/path' ;
2929 const targetLanguage = 'no' ;
3030
3131 const result = getLanguagePath (
3232 pathname ,
3333 targetLanguage ,
3434 supportedLanguages ,
35- fallbackLanguage ,
35+ defaultLanguage ,
3636 false ,
3737 ) ;
3838
3939 expect ( result ) . toBe ( '/no/some/path' ) ;
4040 } ) ;
4141
42- it ( 'should return the correct path when pathname does not start with a language code and target is fallback ' , ( ) => {
42+ it ( 'should return the correct path when pathname does not start with a language code and target is default ' , ( ) => {
4343 const pathname = '/some/path' ;
4444 const targetLanguage = 'en' ;
4545
4646 const result = getLanguagePath (
4747 pathname ,
4848 targetLanguage ,
4949 supportedLanguages ,
50- fallbackLanguage ,
50+ defaultLanguage ,
5151 false ,
5252 ) ;
5353
5454 expect ( result ) . toBe ( '/some/path' ) ;
5555 } ) ;
5656
57- it ( 'should return the correct path when pathname does not start with a language code and target is not fallback ' , ( ) => {
57+ it ( 'should return the correct path when pathname does not start with a language code and target is not default ' , ( ) => {
5858 const pathname = '/some/path' ;
5959 const targetLanguage = 'no' ;
6060
6161 const result = getLanguagePath (
6262 pathname ,
6363 targetLanguage ,
6464 supportedLanguages ,
65- fallbackLanguage ,
65+ defaultLanguage ,
6666 false ,
6767 ) ;
6868
@@ -77,7 +77,7 @@ describe('getLanguagePath', () => {
7777 pathname ,
7878 targetLanguage ,
7979 supportedLanguages ,
80- fallbackLanguage ,
80+ defaultLanguage ,
8181 false ,
8282 ) ;
8383
@@ -92,7 +92,7 @@ describe('getLanguagePath', () => {
9292 pathname ,
9393 targetLanguage ,
9494 supportedLanguages ,
95- fallbackLanguage ,
95+ defaultLanguage ,
9696 false ,
9797 ) ;
9898
@@ -101,60 +101,60 @@ describe('getLanguagePath', () => {
101101 } ) ;
102102
103103 describe ( 'when showDefaultLanguageInPath is true' , ( ) => {
104- it ( 'should include fallback language in path when target is fallback ' , ( ) => {
104+ it ( 'should include default language in path when target is default ' , ( ) => {
105105 const pathname = '/no/some/path' ;
106106 const targetLanguage = 'en' ;
107107
108108 const result = getLanguagePath (
109109 pathname ,
110110 targetLanguage ,
111111 supportedLanguages ,
112- fallbackLanguage ,
112+ defaultLanguage ,
113113 true ,
114114 ) ;
115115
116116 expect ( result ) . toBe ( '/en/some/path' ) ;
117117 } ) ;
118118
119- it ( 'should include fallback language when pathname does not start with language code and target is fallback ' , ( ) => {
119+ it ( 'should include default language when pathname does not start with language code and target is default ' , ( ) => {
120120 const pathname = '/some/path' ;
121121 const targetLanguage = 'en' ;
122122
123123 const result = getLanguagePath (
124124 pathname ,
125125 targetLanguage ,
126126 supportedLanguages ,
127- fallbackLanguage ,
127+ defaultLanguage ,
128128 true ,
129129 ) ;
130130
131131 expect ( result ) . toBe ( '/en/some/path' ) ;
132132 } ) ;
133133
134- it ( 'should handle empty path correctly with fallback language' , ( ) => {
134+ it ( 'should handle empty path correctly with default language' , ( ) => {
135135 const pathname = '/' ;
136136 const targetLanguage = 'en' ;
137137
138138 const result = getLanguagePath (
139139 pathname ,
140140 targetLanguage ,
141141 supportedLanguages ,
142- fallbackLanguage ,
142+ defaultLanguage ,
143143 true ,
144144 ) ;
145145
146146 expect ( result ) . toBe ( '/en/' ) ;
147147 } ) ;
148148
149- it ( 'should handle non-fallback language the same regardless of showDefaultLanguageInPath setting' , ( ) => {
149+ it ( 'should handle non-default language the same regardless of showDefaultLanguageInPath setting' , ( ) => {
150150 const pathname = '/some/path' ;
151151 const targetLanguage = 'no' ;
152152
153153 const result = getLanguagePath (
154154 pathname ,
155155 targetLanguage ,
156156 supportedLanguages ,
157- fallbackLanguage ,
157+ defaultLanguage ,
158158 true ,
159159 ) ;
160160
0 commit comments