aboutsummaryrefslogtreecommitdiffstats
path: root/src/helpers
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-02-12 20:42:21 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-02-12 20:42:21 +0100
commit2d5a303b1cc559339c3ecc7a176e9d8bd66755ef (patch)
tree2a97c1db68a72b8e208bd177af7faad5df2c9f48 /src/helpers
parentfeat(Windows): Add option to quit Franz from Taskbar icon (diff)
parentfeat(Spell checking): Add option to automatically detect language (diff)
downloadferdium-app-2d5a303b1cc559339c3ecc7a176e9d8bd66755ef.tar.gz
ferdium-app-2d5a303b1cc559339c3ecc7a176e9d8bd66755ef.tar.zst
ferdium-app-2d5a303b1cc559339c3ecc7a176e9d8bd66755ef.zip
Merge branch 'feature/spellcheck-autodetect' into develop
Diffstat (limited to 'src/helpers')
-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,