added umlaut switch

master
cheetah 2 years ago
parent ffab66a87e
commit cceae0c843

@ -4,29 +4,29 @@
"params": { "params": {
"type": "simple", "type": "simple",
"routing": { "routing": {
"device": "birdyslim", "device": "generic",
"connectors": [ "connectors": [
[ [
"ecityruf", "dummy",
"1234567" "1234567"
] ]
] ]
} }
} }
}, },
"menuSupport": false, "germanUmlautSupport": true,
"regions": [ "regions": [
{ {
"name": "muc", "name": "muc",
"active": true, "active": true,
"dwdID": "mxx", "dwdID": "mxx",
"_id": "eyJuYW1lIjoibXVjIiwiYWN0aXZlIjp0cnVlLCJkd2RJRCI6Im14eCIsIl9pZCI6ImV5SnVZVzFsSWpvaWJYVmpJaXdpWVdOMGFYWmxJanAwY25WbExDSmtkMlJKUkNJNkltMTRlQ0lzSWw5cFpDSTZJbVY1U25WWlZ6RnNTV3B2YVdKWVZtcEphWGRwV1ZkT01HRllXbXhKYW5Bd1kyNVdiRXhEU210a01sSktVa05KTmtsdE1YUmxRMGx6U1d3NWNGcERTVFpKYlZZMVUyNVdXbFo2Um5OVFYzQjJZVmRLV1ZadGNFcGhXR1J3VjFaa1QwMUhSbGxYYlhoS1lXNUJkMWt5TlZkaVJYaEVVMjEwYTAxc1NrdFZhMDVLVG10c2RFMVlVbXhSTUc4MVNXNHdQU0o5In0=" "_id": "eyJuYW1lIjoibXVjIiwiYWN0aXZlIjp0cnVlLCJkd2RJRCI6Im14eCIsIl9pZCI6ImV5SnVZVzFsSWpvaWJYVmpJaXdpWVdOMGFYWmxJanAwY25WbExDSmtkMlJKUkNJNkltMTRlQ0lzSWw5cFpDSTZJbVY1U25WWlZ6RnNTV3B2YVdKWVZtcEphWGRwV1ZkT01HRllXbXhKYW5Bd1kyNVdiRXhEU210a01sSktVa05KTmtsdE1UUmxRMGx6U1d3NWNGcERTVFpKYlZZMVUyNVdXbFo2Um5OVFYzQjJZVmRLV1ZadGNFcGhXR1J3VjFaa1QwMUhSbGxYYlhoS1lXNUJkMWt5TlZkaVJYaEVVMjEwYTA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pYjNOMFlXeHNaMkZsZFNJc0ltRmpkR2wyWlNJNmRISjFaU3dpWkhka1NVUWlPaUp2WVd3aWZRPT0ifQ==" "_id": "eyJuYW1lIjoib2JlcmFsbGdhZXUiLCJhY3RpdmUiOnRydWUsImR3ZElEIjoib2F4IiwiX2lkIjoiZXlKdVlXMWxJam9pYjJKbGNtRnNiR2RoWlhVaUxDSmhZM1JwZG1VaU9uUnlkV1VzSW1SM1pFbEVJam9pYjJGNElpd2lYMmxrSWpvaVpYbEtkVmxYTVd4SmFtOXBZakpLYkdOdFJuTmlSMlJvV2xoVmFVeERTbWhaTTFKd1pHMVZhVTl1VW5sa1YxVnpTVzFTTTFwRmJFVkphbTlwWWpKR05FbHBkMmxZTW14clNXcHZhVnBZYkV0a1ZteFlUVmQ0U21GdE9YQlpha3BMWWtkT2RGSnVUbWxTTWxKdlYyeG9WbUZWZUVSVGJXaGFUVEZLZDFwSE1WWmhWVGwxVlc1c2ExWXhWbnBUVnpGVFRURndSbUpGVmtwaGJUbHdXV3BLUjA1RmJIQmtNbXhaVFcxNGNsTlhjSFpoVm5CWllrVjBhMVp0ZUZsVVZtUTBVMjFHZEU5WVFscGhhelZRVkZWYWMxZEhWa2xVYlVaT1lURndlbGRyV2s5VGJVMTNZa2hTVTJKWVFuSlZha296WlZaa2MxUnJjRTlpVmtwS1ZUSndSMWxXVlhwYVNFSllZVEpvY2xsVVJrOVdiRlpZWWtaQ2FGWllRWGxXTVZwclRUSkdXRmRzU2xGV1JFSndXbXhGT1ZCVFNqa2lmUT09In0="
} }
] ]
} }

@ -27,7 +27,12 @@
<v-tabs-items v-model="configTab"> <v-tabs-items v-model="configTab">
<v-tab-item key="regions"> <v-tab-item key="regions">
<v-container> <v-container>
<p>Regions:</p> <v-row>
<v-checkbox label="German Umlaut Support" v-model="configData.germanUmlautSupport"></v-checkbox>
</v-row>
<v-row>
<h3>Regions:</h3>
</v-row>
<v-row> <v-row>
<v-btn color="success" @click="addRegionCMD()" ><v-icon>mdi-plus</v-icon> Add</v-btn> <v-btn color="success" @click="addRegionCMD()" ><v-icon>mdi-plus</v-icon> Add</v-btn>
</v-row> </v-row>

@ -12,18 +12,29 @@ const stateMachine = {}
socket.on('msgmgr:event', async (eventType, eventData) => { socket.on('msgmgr:event', async (eventType, eventData) => {
console.log(eventType, eventData) console.log(eventType, eventData)
}) })
const umlautMapGermany = {
const umlautMap = { '\u00dc': ']',
'\u00dc': 'U', '\u00c4': '[',
'\u00c4': 'A', '\u00d6': "\\",
'\u00d6': 'O', '\u00fc': '}',
'\u00fc': 'u', '\u00e4': '{',
'\u00e4': 'a', '\u00f6': '|',
'\u00f6': 'o', '\u00df': '~',
'\u00df': 'ss', }
const umlautMapIntl = {
'\u00dc': 'U',
'\u00c4': 'A',
'\u00d6': 'O',
'\u00fc': 'u',
'\u00e4': 'a',
'\u00f6': 'o',
'\u00df': 'ss',
} }
function replaceUmlaute(str) { function replaceUmlaute(str) {
let umlautMap = config.germanUmlautSupport
? umlautMapGermany
: umlautMapIntl
return str return str
.replace(/[\u00dc|\u00c4|\u00d6][a-z]/g, (a) => { .replace(/[\u00dc|\u00c4|\u00d6][a-z]/g, (a) => {
const big = umlautMap[a.slice(0, 1)]; const big = umlautMap[a.slice(0, 1)];

Loading…
Cancel
Save