generated from JohnBra/vite-web-extension
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from VampireChicken12/dev
Dev
- Loading branch information
Showing
12 changed files
with
265 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
body { | ||
width: max-content; | ||
width: fit-content; | ||
margin: 12px; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
|
||
min-width: 400px; | ||
max-width: 640px; | ||
position: relative; | ||
overflow-y: scroll; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type EnUS from "public/locales/en-US.json"; | ||
|
||
import { availableLocales } from "../i18n"; | ||
import { type LocaleFile, flattenLocaleValues, getLocaleFile } from "./plugins/utils"; | ||
function checkForMissingKeys(englishFile: LocaleFile, localeFile: LocaleFile) { | ||
const { keys: englishKeys } = flattenLocaleValues(englishFile); | ||
const { keys: localeKeys } = flattenLocaleValues(localeFile); | ||
if (englishKeys.length !== localeKeys.length) { | ||
const missingKeys = englishKeys.filter((key) => !localeKeys.includes(key)); | ||
const message = `${(localeFile as unknown as EnUS)["langCode"]} is missing ${missingKeys.length} keys\nMissing keys:\n${missingKeys.join(", ")}`; | ||
return message; | ||
} | ||
return false; | ||
} | ||
export default function checkLocalesForMissingKeys() { | ||
const englishFile = getLocaleFile("en-US"); | ||
const missingKeys = availableLocales | ||
.filter((availableLocales) => availableLocales !== "en-US") | ||
.map((locale) => { | ||
const localeFile = getLocaleFile(locale); | ||
return checkForMissingKeys(englishFile, localeFile); | ||
}) | ||
.filter(Boolean); | ||
if (missingKeys.length) { | ||
throw new Error(missingKeys.join("\n\n")); | ||
} | ||
} |
Oops, something went wrong.