aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers/i18n-helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/i18n-helpers.js')
-rw-r--r--src/helpers/i18n-helpers.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/helpers/i18n-helpers.js b/src/helpers/i18n-helpers.js
index 091b86b06..84146dd8c 100644
--- a/src/helpers/i18n-helpers.js
+++ b/src/helpers/i18n-helpers.js
@@ -28,22 +28,33 @@ export function getLocale({
28 return localeStr; 28 return localeStr;
29} 29}
30 30
31export function getSelectOptions({ locales, resetToDefaultText = '' }) { 31export function getSelectOptions({ locales, resetToDefaultText = '', automaticDetectionText = '' }) {
32 let options = []; 32 const options = [];
33 33
34 if (resetToDefaultText) { 34 if (resetToDefaultText) {
35 options = [ 35 options.push(
36 { 36 {
37 value: '', 37 value: '',
38 label: resetToDefaultText, 38 label: resetToDefaultText,
39 }, {
40 value: '───',
41 label: '───',
42 disabled: true,
43 }, 39 },
44 ]; 40 );
45 } 41 }
46 42
43 if (automaticDetectionText) {
44 options.push(
45 {
46 value: 'automatic',
47 label: automaticDetectionText,
48 },
49 );
50 }
51
52 options.push({
53 value: '───',
54 label: '───',
55 disabled: true,
56 });
57
47 Object.keys(locales).sort(Intl.Collator().compare).forEach((key) => { 58 Object.keys(locales).sort(Intl.Collator().compare).forEach((key) => {
48 options.push({ 59 options.push({
49 value: key, 60 value: key,