- Timestamp:
- 2022-01-11T11:10:56+13:00 (2 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/macron-restoration/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/macron-restoration/src/components/DirectInput.vue
r35951 r35953 2 2 import { mapState } from "vuex"; 3 3 import { saveAs } from "file-saver" 4 import { log } from "../js/Util"4 import Util, { log } from "../js/Util" 5 5 import MacronRestorationModule from "../js/MacronRestorationModule" 6 6 import { SnackController } from "./Snackbar.vue" … … 172 172 // The null check is used to default this setting to true 173 173 this.preserveExistingMacrons = (localStorage.getItem("preserveExistingMacrons") ?? "true") === "true"; 174 this.enableSpellcheck = localStorage.getItem("enableSpellcheck") === "true";175 174 this.showMacronisedWords = (localStorage.getItem("showMacronisedWords") ?? "true") === "true"; 176 175 this.normaliseLinebreaks = localStorage.getItem("normaliseLinebreaks") === "true"; 176 177 const enableSpellcheck = localStorage.getItem("enableSpellcheck"); 178 if (enableSpellcheck) { 179 this.enableSpellcheck = enableSpellcheck === "true"; 180 } 181 else { 182 this.enableSpellcheck = Util.getNavigatorLanguage().startsWith("mi"); 183 } 177 184 } 178 185 } -
main/trunk/model-interfaces-dev/atea/macron-restoration/src/js/Util.js
r35714 r35953 68 68 this.lut[d3 & 0xff] + this.lut[d3 >> 8 & 0xff] + this.lut[d3 >> 16 & 0xff] + this.lut[d3 >> 24 & 0xff]; 69 69 } 70 71 /** 72 * Gets the navigator's primary language. 73 * @returns {String} The primary language code. 74 */ 75 static getNavigatorLanguage() { 76 if (navigator.languages && navigator.languages.length) { 77 return navigator.languages[0]; 78 } 79 80 if (navigator.language) { 81 return navigator.language; 82 } 83 84 // IE Support 85 return navigator.browserLanguage || navigator.systemLanguage || navigator.userLanguage; 86 } 70 87 }
Note:
See TracChangeset
for help on using the changeset viewer.