File tree 2 files changed +12
-11
lines changed
2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const SPANISH_INTERNATIONAL_LOCALE = 'es';
8
8
export default class Url extends Service {
9
9
@service currentDomain ;
10
10
@service intl ;
11
+ @service locale ;
11
12
12
13
definedHomeUrl = ENV . rootURL ;
13
14
@@ -108,22 +109,22 @@ export default class Url extends Service {
108
109
}
109
110
110
111
get supportHomeUrl ( ) {
111
- const currentLanguage = this . intl . primaryLocale ;
112
+ const currentLocale = this . intl . primaryLocale ;
112
113
113
114
if ( this . currentDomain . isFranceDomain ) {
114
115
return 'https://pix.fr/support' ;
115
116
}
116
117
117
- switch ( currentLanguage ) {
118
- case ENGLISH_INTERNATIONAL_LOCALE :
119
- return 'https://pix.org/en/support' ;
120
- case DUTCH_INTERNATIONAL_LOCALE :
121
- return 'https://pix.org/nl-be/support' ;
122
- case SPANISH_INTERNATIONAL_LOCALE :
123
- return 'https://pix.org/en/support' ;
124
- default :
125
- return 'https://pix.org/fr/support' ;
118
+ let locale ;
119
+ if ( currentLocale == 'nl' ) {
120
+ locale = 'nl-BE' ;
121
+ } else if ( this . locale . isSupportedLocale ( currentLocale ) ) {
122
+ locale = currentLocale ;
123
+ } else {
124
+ locale = ENGLISH_INTERNATIONAL_LOCALE ;
126
125
}
126
+
127
+ return `https://pix.org/${ locale } /support` ;
127
128
}
128
129
129
130
get serverStatusUrl ( ) {
Original file line number Diff line number Diff line change @@ -496,7 +496,7 @@ module('Unit | Service | url', function (hooks) {
496
496
const service = this . owner . lookup ( 'service:url' ) ;
497
497
service . currentDomain = { isFranceDomain : false } ;
498
498
service . intl = { primaryLocale : DUTCH_INTERNATIONAL_LOCALE } ;
499
- const expectedSupportHomeUrl = 'https://pix.org/nl-be /support' ;
499
+ const expectedSupportHomeUrl = 'https://pix.org/nl-BE /support' ;
500
500
501
501
// when
502
502
const supportHomeUrl = service . supportHomeUrl ;
You can’t perform that action at this time.
0 commit comments