Skip to content

Commit

Permalink
pretier
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Nov 26, 2024
1 parent c0a40fb commit fbe41e8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
14 changes: 7 additions & 7 deletions src/api/focus/keymap/language_maps.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// This file is auto-generated. Do not edit manually.
export const languageMaps = {
"de": require("./cldr_languages/de.json"),
"en": require("./cldr_languages/en.json"),
"es": require("./cldr_languages/es.json"),
"fr": require("./cldr_languages/fr.json"),
"id": require("./cldr_languages/id.json"),
de: require("./cldr_languages/de.json"),
en: require("./cldr_languages/en.json"),
es: require("./cldr_languages/es.json"),
fr: require("./cldr_languages/fr.json"),
id: require("./cldr_languages/id.json"),
"nb-NO": require("./cldr_languages/nb_no.json"),
"nl": require("./cldr_languages/nl.json"),
"zh-Hans": require("./cldr_languages/zh_hans.json")
nl: require("./cldr_languages/nl.json"),
"zh-Hans": require("./cldr_languages/zh_hans.json"),
};
44 changes: 21 additions & 23 deletions src/renderer/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,47 @@ import i18n from "i18next";
import { initReactI18next } from "react-i18next";

const resources = {
"de": {
de: {
messages: de,
},
"en": {
en: {
messages: en,
},
"es": {
es: {
messages: es,
},
"fr": {
fr: {
messages: fr,
},
"id": {
id: {
messages: id,
},
"nb-NO": {
messages: nb_NO,
},
"nl": {
nl: {
messages: nl,
},
"zh-Hans": {
messages: zh_Hans,
},
};

i18n
.use(initReactI18next)
.init({
react: {
useSuspense: true,
},
resources: resources,
lng: "en",
keySeparator: ".",
ns: ["messages"],
returnEmptyString: true,
defaultNS: "messages",
fallbackLng: "en",
interpolation: {
escapeValue: false,
},
});
i18n.use(initReactI18next).init({
react: {
useSuspense: true,
},
resources: resources,
lng: "en",
keySeparator: ".",
ns: ["messages"],
returnEmptyString: true,
defaultNS: "messages",
fallbackLng: "en",
interpolation: {
escapeValue: false,
},
});

i18n.refreshHardware = (device) => {
Object.keys(i18n.options.resources).forEach((code) => {
Expand Down
12 changes: 7 additions & 5 deletions src/renderer/utils/connectToSerialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export const connectToSerialport = async (targetVid, targetPid) => {
while (!serialPort) {
try {
let filters = supportedDeviceVIDPIDs();

// If we have target VID/PID, only look for that specific device
if (targetVid && targetPid) {
filters = [{
usbVendorId: targetVid,
usbProductId: targetPid
}];
filters = [
{
usbVendorId: targetVid,
usbProductId: targetPid,
},
];
}

serialPort = await navigator.serial.requestPort({
Expand Down

0 comments on commit fbe41e8

Please sign in to comment.