Skip to content

Commit

Permalink
Extract OS keyboard layouts list to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
precondition committed Sep 4, 2022
1 parent 88e1943 commit ffcfc24
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 63 deletions.
63 changes: 63 additions & 0 deletions src/osKeyboardLayouts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
export const osKeyboardLayouts = [

This comment has been minimized.

Copy link
@yanfali

yanfali Sep 4, 2022

Collaborator

you can also use export default [ ... ] which will make importing a little bit easier.
`import osKeyboardLayouts from 'osKeyboardLayouts';

'keymap_belgian',
'keymap_bepo',
'keymap_brazilian_abnt2',
'keymap_canadian_multilingual',
'keymap_colemak',
'keymap_croatian',
'keymap_czech',
'keymap_danish',
'keymap_dvorak_fr',
'keymap_dvorak',
'keymap_dvorak_programmer',
'keymap_estonian',
'keymap_finnish',
'keymap_french_afnor',
'keymap_french',
'keymap_french_mac_iso',
'keymap_german',
'keymap_greek',
'keymap_hebrew',
'keymap_hungarian',
'keymap_icelandic',
'keymap_irish',
'keymap_italian',
'keymap_italian_mac_ansi',
'keymap_italian_mac_iso',
'keymap_japanese',
'keymap_korean',
'keymap_latvian',
'keymap_lithuanian_azerty',
'keymap_lithuanian_qwerty',
'keymap_neo2',
'keymap_norman',
'keymap_norwegian',
'keymap_polish',
'keymap_portuguese',
'keymap_portuguese_mac_iso',
'keymap_romanian',
'keymap_russian',
'keymap_serbian',
'keymap_serbian_latin',
'keymap_slovak',
'keymap_slovenian',
'keymap_spanish_dvorak',
'keymap_spanish',
'keymap_swedish',
'keymap_swedish_mac_ansi',
'keymap_swedish_mac_iso',
'keymap_swedish_pro_mac_ansi',
'keymap_swedish_pro_mac_iso',
'keymap_swiss_de',
'keymap_swiss_fr',
'keymap_turkish_f',
'keymap_turkish_q',
'keymap_uk',
'keymap_ukrainian',
'keymap_us_extended',
'keymap_us_international',
'keymap_us_international_linux',
'keymap_us',
'keymap_workman',
'keymap_workman_zxcvm'
];
65 changes: 2 additions & 63 deletions src/store/modules/app/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
localStorageLoad,
CONSTS
} from '@/store/localStorage';
import { osKeyboardLayouts } from '@/osKeyboardLayouts';

function getDefaultConfiguratorSettings() {
// detect if OS supports dark mode and set as default
Expand Down Expand Up @@ -78,69 +79,7 @@ const state = {
{ value: 'ja', label: '日本語' },
{ value: 'zh-CN', label: '简体中文' }
],
osKeyboardLayouts: [
'keymap_belgian',
'keymap_bepo',
'keymap_brazilian_abnt2',
'keymap_canadian_multilingual',
'keymap_colemak',
'keymap_croatian',
'keymap_czech',
'keymap_danish',
'keymap_dvorak_fr',
'keymap_dvorak',
'keymap_dvorak_programmer',
'keymap_estonian',
'keymap_finnish',
'keymap_french_afnor',
'keymap_french',
'keymap_french_mac_iso',
'keymap_german',
'keymap_greek',
'keymap_hebrew',
'keymap_hungarian',
'keymap_icelandic',
'keymap_irish',
'keymap_italian',
'keymap_italian_mac_ansi',
'keymap_italian_mac_iso',
'keymap_japanese',
'keymap_korean',
'keymap_latvian',
'keymap_lithuanian_azerty',
'keymap_lithuanian_qwerty',
'keymap_neo2',
'keymap_norman',
'keymap_norwegian',
'keymap_polish',
'keymap_portuguese',
'keymap_portuguese_mac_iso',
'keymap_romanian',
'keymap_russian',
'keymap_serbian',
'keymap_serbian_latin',
'keymap_slovak',
'keymap_slovenian',
'keymap_spanish_dvorak',
'keymap_spanish',
'keymap_swedish',
'keymap_swedish_mac_ansi',
'keymap_swedish_mac_iso',
'keymap_swedish_pro_mac_ansi',
'keymap_swedish_pro_mac_iso',
'keymap_swiss_de',
'keymap_swiss_fr',
'keymap_turkish_f',
'keymap_turkish_q',
'keymap_uk',
'keymap_ukrainian',
'keymap_us_extended',
'keymap_us_international',
'keymap_us_international_linux',
'keymap_us',
'keymap_workman',
'keymap_workman_zxcvm'
],
osKeyboardLayouts,
snowflakes: false
};

Expand Down

0 comments on commit ffcfc24

Please sign in to comment.