Skip to content

Commit 1644ad3

Browse files
committed
fix: remove fallback code if we're on the default locale
1 parent ed62324 commit 1644ad3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/entities/locale.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ function createLocaleApi (http) {
3636
// delete some properties which are returned by the server but shouldn't
3737
// be sent back.
3838
const locale = this
39+
// for the default locale, we can't send the fallback code back or we get an error
40+
if (locale.default) {
41+
delete locale.fallback_code
42+
} else {
43+
// temporary fix due to property naming weirdness
44+
locale.fallbackCode = locale.fallback_code
45+
delete locale.fallback_code
46+
}
3947
delete locale.default
40-
locale.fallbackCode = locale.fallback_code
41-
delete locale.fallback_code
4248
return createUpdateEntity({
4349
http: http,
4450
entityPath: 'locales',

0 commit comments

Comments
 (0)