diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 7ab3f32..eb6a5e8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,18 +2,18 @@ module.exports = { root: true, extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:svelte/recommended', - 'plugin:svelte/prettier', - 'prettier' + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:svelte/recommended", + "plugin:svelte/prettier", + "prettier" ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint"], parserOptions: { - sourceType: 'module', + sourceType: "module", ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] + extraFileExtensions: [".svelte"] }, env: { browser: true, @@ -21,14 +21,14 @@ module.exports = { node: true }, rules: { - '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: 'Slots' }] + "@typescript-eslint/no-unused-vars": ["error", { varsIgnorePattern: "Slots" }] }, overrides: [ { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', + files: ["*.svelte"], + parser: "svelte-eslint-parser", parserOptions: { - parser: '@typescript-eslint/parser' + parser: "@typescript-eslint/parser" } } ] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b5c68e5..9b77ea7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,9 +1,9 @@ --- name: Bug report about: Create a report to help us improve -title: '' -labels: '' -assignees: '' +title: "" +labels: "" +assignees: "" --- **Describe the bug** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2f28cea..2bc5d5f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,9 +1,9 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' +title: "" +labels: "" +assignees: "" --- **Is your feature request related to a problem? Please describe.** diff --git a/.prettierignore b/.prettierignore index 7d469f8..89fb5cf 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,6 +14,7 @@ yarn.lock format.utils.ts static/*.json /.vercel +/.github CodeBlock.svelte HighlightValue.svelte diff --git a/.prettierrc b/.prettierrc index 8640b98..301b168 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,8 @@ { "useTabs": true, - "singleQuote": true, + "singleQuote": false, "trailingComma": "none", "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] } diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index f30052e..0000000 --- a/.prettierrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - tabWidth: 2, - semi: true, - singleQuote: false, - trailingComma: 'es5', - plugins: ['prettier-plugin-svelte'], - printWidth: 90 -}; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3ff67a8..91969e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,9 @@ In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susa 4. Add a file with the name of your language code in the folder [./messages](./messages) (e.g. `es.json`) 5. Copy contents of the file [./messages/en.json](./messages/en.json) to your new file and start translating the strings. 6. Run project locally and check if your translations are working as expected. - - You can change language under "Settings" in the top right corner of the page. + +- You can change language under "Settings" in the top right corner of the page. + 7. Commit your changes and push to your fork and open a PR to this repository. ## License diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 4b84890..6b60f45 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -1,3 +1,3 @@ module.exports = { - extends: ['@commitlint/config-conventional'] + extends: ["@commitlint/config-conventional"] }; diff --git a/messages/en.json b/messages/en.json index a2753e7..ed36d1d 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,71 +1,71 @@ { - "$schema": "https://inlang.com/schema/inlang-message-format", - "about": "About", - "addLocale": "Add locale", - "addLocaleButton": "Add", - "alternativeUseHeading": "Alternativ use", - "alternativeUseIngress": "{method} can also be used from", - "amount": "Amount", - "and": "and", - "availableInBrowser": "Available in {browserName} from version {versionAdded}", - "blurbPart1": "is a tool for experimenting and trying out the", - "blurbPart2": "The API is available under the namespace", - "blurbPart3": "in JavaScript and provides language sensitive datetime formatting, number formatting, string comparison and more.", - "blurbPart4": "To get started either visit", - "blurbPart5": "or choose formatter you are interested in from the navigation menu.", - "blurbPart6": "The source code for this tool can be found at", - "blurbPart7": "The creator of this tool is", - "blurbWelcome": "Welcome to Intl Explorer!", - "browserDetails": "Browser details", - "browserSupport": "Browser support", - "close": "Close", - "code": "Code", - "codeTheme": "Code Theme", - "codeThemeHint": "Theme for code blocks: OceanicNext/Github", - "confirmLanguage": "Confirm language", - "copyCode": "Copy Code", - "copyCodeAriaLabel": "Copy code for options: {code}", - "copySchemaUrl": "Copy Schema URL", - "currency": "Currency", - "dark": "Dark", - "date": "Date", - "editLocale": "Edit locale", - "editLocaleButton": "Edit", - "equals": "equals", - "fullSupport": "Full support", - "input": "Input", - "language": "Language", - "languageHint": "Language for page. Press Confirm to reload page with selected language", - "light": "Light", - "list": "List", - "locale": "Locale", - "localeHint": "'Add' to add selected locale. 'Edit' to add custom locale not in list", - "menu": "Menu", - "meta": "Meta", - "method": "Method", - "no": "No", - "noSupport": "No support", - "notAvailableInBrowser": "Not available in {browserName}", - "noValue": "No value", - "options": "Options", - "output": "Output", - "partialSupport": "Partial support", - "remove": "Remove {value}", - "resolvedOptions": "Resolved Options", - "secondaryFormatters": "Secondary Formatters", - "seeAlso": "See also", - "selectCurrency": "Select a currency", - "selectLocaleButton": "Select", - "selectUnit": "Select a unit", - "settingsButton": "Settings", - "settingsHeading": "Settings", - "showBrowserSupport": "Show Browser Support", - "showBrowserSupportHint": "Toggle to hide or show Browser Details/Support", - "skipLink": "Skip to content", - "specification": "Specification", - "theme": "Theme", - "themeHint": "Page theme", - "time": "Time", - "unit": "Unit", - "value": "Value" -} \ No newline at end of file + "$schema": "https://inlang.com/schema/inlang-message-format", + "about": "About", + "addLocale": "Add locale", + "addLocaleButton": "Add", + "alternativeUseHeading": "Alternativ use", + "alternativeUseIngress": "{method} can also be used from", + "amount": "Amount", + "and": "and", + "availableInBrowser": "Available in {browserName} from version {versionAdded}", + "blurbPart1": "is a tool for experimenting and trying out the", + "blurbPart2": "The API is available under the namespace", + "blurbPart3": "in JavaScript and provides language sensitive datetime formatting, number formatting, string comparison and more.", + "blurbPart4": "To get started either visit", + "blurbPart5": "or choose formatter you are interested in from the navigation menu.", + "blurbPart6": "The source code for this tool can be found at", + "blurbPart7": "The creator of this tool is", + "blurbWelcome": "Welcome to Intl Explorer!", + "browserDetails": "Browser details", + "browserSupport": "Browser support", + "close": "Close", + "code": "Code", + "codeTheme": "Code Theme", + "codeThemeHint": "Theme for code blocks: OceanicNext/Github", + "confirmLanguage": "Confirm language", + "copyCode": "Copy Code", + "copyCodeAriaLabel": "Copy code for options: {code}", + "copySchemaUrl": "Copy Schema URL", + "currency": "Currency", + "dark": "Dark", + "date": "Date", + "editLocale": "Edit locale", + "editLocaleButton": "Edit", + "equals": "equals", + "fullSupport": "Full support", + "input": "Input", + "language": "Language", + "languageHint": "Language for page. Press Confirm to reload page with selected language", + "light": "Light", + "list": "List", + "locale": "Locale", + "localeHint": "'Add' to add selected locale. 'Edit' to add custom locale not in list", + "menu": "Menu", + "meta": "Meta", + "method": "Method", + "no": "No", + "noSupport": "No support", + "notAvailableInBrowser": "Not available in {browserName}", + "noValue": "No value", + "options": "Options", + "output": "Output", + "partialSupport": "Partial support", + "remove": "Remove {value}", + "resolvedOptions": "Resolved Options", + "secondaryFormatters": "Secondary Formatters", + "seeAlso": "See also", + "selectCurrency": "Select a currency", + "selectLocaleButton": "Select", + "selectUnit": "Select a unit", + "settingsButton": "Settings", + "settingsHeading": "Settings", + "showBrowserSupport": "Show Browser Support", + "showBrowserSupportHint": "Toggle to hide or show Browser Details/Support", + "skipLink": "Skip to content", + "specification": "Specification", + "theme": "Theme", + "themeHint": "Page theme", + "time": "Time", + "unit": "Unit", + "value": "Value" +} diff --git a/messages/sv.json b/messages/sv.json index 95d20b4..0fcc94f 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -1,71 +1,71 @@ { - "$schema": "https://inlang.com/schema/inlang-message-format", - "about": "Om", - "alternativeUseHeading": "Alternativ användning", - "alternativeUseIngress": "{method} kan också användas från", - "amount": "Summa", - "and": "och", - "addLocale": "Lägg till språk", - "addLocaleButton": "Lägg till", - "availableInBrowser": "Tillgänglig i {browserName} från version {versionAdded}", - "blurbPart1": "är ett verktyg för att experimentera med", - "blurbPart2": "APIet är tillgängligt under namnet", - "blurbPart3": "i JavaScript och ger en språkkänslig datumformattering, nummerformattering, strängjämförelse med mera.", - "blurbPart4": "För att börja antingen besök", - "blurbPart5": "eller välj en formatterare du är intresserad av i navigationsmenyn.", - "blurbPart6": "Källkoden för detta verktyg hittas på", - "blurbPart7": "Skaparen av detta verktyg är", - "blurbWelcome": "Välkommen till Intl Explorer!", - "browserDetails": "Webbläsardetaljer", - "browserSupport": "Webbläsarstöd", - "close": "Stäng", - "code": "Kod", - "codeTheme": "Kodtema", - "codeThemeHint": "Tema för kodblock: OceanicNext/Github", - "confirmLanguage": "Bekräfta språk", - "copyCode": "Kopiera kod", - "copyCodeAriaLabel": "Kopiera kod för alternativ: {code}", - "copySchemaUrl": "Kopiera Schema URL", - "currency": "Valuta", - "dark": "Mörkt", - "date": "Datum", - "editLocale": "Redigera språk", - "editLocaleButton": "Redigera", - "equals": "är lika med", - "fullSupport": "Fullt stöd", - "input": "Indata", - "language": "Språk", - "languageHint": "Språk för sidan. Bekräfta språk för att ladda om sidan med valda språk.", - "light": "Ljust", - "list": "Lista", - "locale": "Språk", - "localeHint": "'Lägg till' för att lägga till språk. 'Redigera' för att lägga till språk som inte finns i listan", - "menu": "Meny", - "meta": "Meta", - "method": "Metod", - "no": "Nej", - "noSupport": "Inget stöd", - "notAvailableInBrowser": "Inte tillgänglig i {browserName}", - "noValue": "Inget värde", - "options": "Alternativ", - "output": "Utdata", - "partialSupport": "Delvist stöd", - "remove": "Ta bort {value}", - "resolvedOptions": "Alternativ som används", - "secondaryFormatters": "Sekundära formatterare", - "seeAlso": "Se också", - "selectCurrency": "Välj valuta", - "selectLocaleButton": "Välj", - "selectUnit": "Välj enhet", - "settingsButton": "Inställningar", - "settingsHeading": "Inställningar", - "showBrowserSupport": "Visa Webbläsarstöd", - "showBrowserSupportHint": "Visa eller dölj stöd för webbläsare", - "skipLink": "Hoppa till innehåll", - "specification": "Specifikation", - "theme": "Tema", - "themeHint": "Tema för sida", - "time": "Tid", - "unit": "Enhet", - "value": "Värde" -} \ No newline at end of file + "$schema": "https://inlang.com/schema/inlang-message-format", + "about": "Om", + "alternativeUseHeading": "Alternativ användning", + "alternativeUseIngress": "{method} kan också användas från", + "amount": "Summa", + "and": "och", + "addLocale": "Lägg till språk", + "addLocaleButton": "Lägg till", + "availableInBrowser": "Tillgänglig i {browserName} från version {versionAdded}", + "blurbPart1": "är ett verktyg för att experimentera med", + "blurbPart2": "APIet är tillgängligt under namnet", + "blurbPart3": "i JavaScript och ger en språkkänslig datumformattering, nummerformattering, strängjämförelse med mera.", + "blurbPart4": "För att börja antingen besök", + "blurbPart5": "eller välj en formatterare du är intresserad av i navigationsmenyn.", + "blurbPart6": "Källkoden för detta verktyg hittas på", + "blurbPart7": "Skaparen av detta verktyg är", + "blurbWelcome": "Välkommen till Intl Explorer!", + "browserDetails": "Webbläsardetaljer", + "browserSupport": "Webbläsarstöd", + "close": "Stäng", + "code": "Kod", + "codeTheme": "Kodtema", + "codeThemeHint": "Tema för kodblock: OceanicNext/Github", + "confirmLanguage": "Bekräfta språk", + "copyCode": "Kopiera kod", + "copyCodeAriaLabel": "Kopiera kod för alternativ: {code}", + "copySchemaUrl": "Kopiera Schema URL", + "currency": "Valuta", + "dark": "Mörkt", + "date": "Datum", + "editLocale": "Redigera språk", + "editLocaleButton": "Redigera", + "equals": "är lika med", + "fullSupport": "Fullt stöd", + "input": "Indata", + "language": "Språk", + "languageHint": "Språk för sidan. Bekräfta språk för att ladda om sidan med valda språk.", + "light": "Ljust", + "list": "Lista", + "locale": "Språk", + "localeHint": "'Lägg till' för att lägga till språk. 'Redigera' för att lägga till språk som inte finns i listan", + "menu": "Meny", + "meta": "Meta", + "method": "Metod", + "no": "Nej", + "noSupport": "Inget stöd", + "notAvailableInBrowser": "Inte tillgänglig i {browserName}", + "noValue": "Inget värde", + "options": "Alternativ", + "output": "Utdata", + "partialSupport": "Delvist stöd", + "remove": "Ta bort {value}", + "resolvedOptions": "Alternativ som används", + "secondaryFormatters": "Sekundära formatterare", + "seeAlso": "Se också", + "selectCurrency": "Välj valuta", + "selectLocaleButton": "Välj", + "selectUnit": "Välj enhet", + "settingsButton": "Inställningar", + "settingsHeading": "Inställningar", + "showBrowserSupport": "Visa Webbläsarstöd", + "showBrowserSupportHint": "Visa eller dölj stöd för webbläsare", + "skipLink": "Hoppa till innehåll", + "specification": "Specifikation", + "theme": "Tema", + "themeHint": "Tema för sida", + "time": "Tid", + "unit": "Enhet", + "value": "Värde" +} diff --git a/package.json b/package.json index c21e4f4..ce37763 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test:gen": "npx playwright codegen http://localhost:5173/", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --check . && eslint .", + "lint": "eslint .", "format": "prettier --write .", "prepare": "husky install", "postinstall": "paraglide-js compile --project ./project.inlang" diff --git a/playwright.config.ts b/playwright.config.ts index b5894df..18750be 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,15 +1,15 @@ -import { devices } from '@playwright/test'; +import { devices } from "@playwright/test"; const config = { - testDir: 'tests', + testDir: "tests", forbidOnly: !!process.env.CI, projects: [ { - name: 'chromium', + name: "chromium", use: { - ...devices['Desktop Chrome'] + ...devices["Desktop Chrome"] } - }, + } ] }; diff --git a/project.inlang/settings.json b/project.inlang/settings.json index 8647cfb..4f2f18e 100644 --- a/project.inlang/settings.json +++ b/project.inlang/settings.json @@ -1,20 +1,17 @@ { - "$schema": "https://inlang.com/schema/project-settings", - "sourceLanguageTag": "en", - "languageTags": [ - "en", - "sv" - ], - "modules": [ - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js" - ], - "plugin.inlang.messageFormat": { - "pathPattern": "./messages/{languageTag}.json" - } -} \ No newline at end of file + "$schema": "https://inlang.com/schema/project-settings", + "sourceLanguageTag": "en", + "languageTags": ["en", "sv"], + "modules": [ + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js" + ], + "plugin.inlang.messageFormat": { + "pathPattern": "./messages/{languageTag}.json" + } +} diff --git a/src/app.d.ts b/src/app.d.ts index ace1e20..07992be 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -8,11 +8,11 @@ declare namespace App { } type Analytics = { - track: (name: string, data?: Record) => void -} + track: (name: string, data?: Record) => void; +}; declare interface Window { - umami?: Analytics + umami?: Analytics; } declare namespace Intl { @@ -57,7 +57,7 @@ declare namespace Intl { } const DurationFormat: { prototype: DurationFormat; - new(locales?: LocalesArgument, options?: DurationFormatOptions): DurationFormat; + new (locales?: LocalesArgument, options?: DurationFormatOptions): DurationFormat; }; // Borrowing from: https://github.com/microsoft/TypeScript/blob/e66049084b40ce85e28278c29cdd9784c7a9033a/src/lib/es2023.intl.d.ts @@ -73,15 +73,65 @@ declare namespace Intl { interface NumberFormatOptions { roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; - roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; - roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; + roundingIncrement?: + | 1 + | 2 + | 5 + | 10 + | 20 + | 25 + | 50 + | 100 + | 200 + | 250 + | 500 + | 1000 + | 2000 + | 2500 + | 5000 + | undefined; + roundingMode?: + | "ceil" + | "floor" + | "expand" + | "trunc" + | "halfCeil" + | "halfFloor" + | "halfExpand" + | "halfTrunc" + | "halfEven" + | undefined; trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined; } interface ResolvedNumberFormatOptions { roundingPriority: "auto" | "morePrecision" | "lessPrecision"; - roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; - roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; + roundingMode: + | "ceil" + | "floor" + | "expand" + | "trunc" + | "halfCeil" + | "halfFloor" + | "halfExpand" + | "halfTrunc" + | "halfEven"; + roundingIncrement: + | 1 + | 2 + | 5 + | 10 + | 20 + | 25 + | 50 + | 100 + | 200 + | 250 + | 500 + | 1000 + | 2000 + | 2500 + | 5000; trailingZeroDisplay: "auto" | "stripIfInteger"; } @@ -96,15 +146,65 @@ declare namespace Intl { interface PluralRulesOptions { roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; - roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; - roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined; + roundingIncrement?: + | 1 + | 2 + | 5 + | 10 + | 20 + | 25 + | 50 + | 100 + | 200 + | 250 + | 500 + | 1000 + | 2000 + | 2500 + | 5000 + | undefined; + roundingMode?: + | "ceil" + | "floor" + | "expand" + | "trunc" + | "halfCeil" + | "halfFloor" + | "halfExpand" + | "halfTrunc" + | "halfEven" + | undefined; trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined; } interface ResolvedPluralRulesOptions { roundingPriority: "auto" | "morePrecision" | "lessPrecision"; - roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven"; - roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000; + roundingMode: + | "ceil" + | "floor" + | "expand" + | "trunc" + | "halfCeil" + | "halfFloor" + | "halfExpand" + | "halfTrunc" + | "halfEven"; + roundingIncrement: + | 1 + | 2 + | 5 + | 10 + | 20 + | 25 + | 50 + | 100 + | 200 + | 250 + | 500 + | 1000 + | 2000 + | 2500 + | 5000; trailingZeroDisplay: "auto" | "stripIfInteger"; } -} \ No newline at end of file +} diff --git a/src/app.html b/src/app.html index 9d1496f..450647a 100644 --- a/src/app.html +++ b/src/app.html @@ -1,5 +1,5 @@ - + @@ -10,14 +10,13 @@ /> + content="Intl Explorer is an interactive tool for experimenting and trying out the ECMAScript Internationalization API." + /> Intl Explorer %sveltekit.head% -
- %sveltekit.body% -
+
%sveltekit.body%
diff --git a/src/hooks.server.ts b/src/hooks.server.ts index f2ae896..b0d8956 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,2 +1,2 @@ -import { i18n } from '$lib/i18n/i18n' -export const handle = i18n.handle() \ No newline at end of file +import { i18n } from "$lib/i18n/i18n"; +export const handle = i18n.handle(); diff --git a/src/hooks.ts b/src/hooks.ts index 69edd6a..c163db1 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -1,2 +1,2 @@ -import { i18n } from '$lib/i18n/i18n' -export const reroute = i18n.reroute() \ No newline at end of file +import { i18n } from "$lib/i18n/i18n"; +export const reroute = i18n.reroute(); diff --git a/src/lib/components/pages/Collator.svelte b/src/lib/components/pages/Collator.svelte index 6f80d18..2b63dc4 100644 --- a/src/lib/components/pages/Collator.svelte +++ b/src/lib/components/pages/Collator.svelte @@ -1,31 +1,31 @@ @@ -44,7 +44,7 @@ [option]: value }, list, - $locales, + $locales )} /> {/if} diff --git a/src/lib/components/pages/DateTimeFormat.svelte b/src/lib/components/pages/DateTimeFormat.svelte index f78633f..592b7ae 100644 --- a/src/lib/components/pages/DateTimeFormat.svelte +++ b/src/lib/components/pages/DateTimeFormat.svelte @@ -1,30 +1,30 @@ - + - + - + - + - + - + diff --git a/src/lib/components/pages/DurationFormat.svelte b/src/lib/components/pages/DurationFormat.svelte index a0aac06..c2c603d 100644 --- a/src/lib/components/pages/DurationFormat.svelte +++ b/src/lib/components/pages/DurationFormat.svelte @@ -1,31 +1,31 @@ diff --git a/src/lib/components/pages/NumberFormat.Currency.svelte b/src/lib/components/pages/NumberFormat.Currency.svelte index 6414a60..0bde660 100644 --- a/src/lib/components/pages/NumberFormat.Currency.svelte +++ b/src/lib/components/pages/NumberFormat.Currency.svelte @@ -1,37 +1,38 @@ @@ -70,8 +70,15 @@ >



@@ -85,12 +92,12 @@ {onClick} values={{ [option]: value, - style: 'currency', + style: "currency", currency: selectedCurrency }} output={format( { - style: 'currency', + style: "currency", currency: selectedCurrency, [option]: value }, diff --git a/src/lib/components/pages/NumberFormat.Unit.svelte b/src/lib/components/pages/NumberFormat.Unit.svelte index 9697290..9dbaa70 100644 --- a/src/lib/components/pages/NumberFormat.Unit.svelte +++ b/src/lib/components/pages/NumberFormat.Unit.svelte @@ -1,37 +1,37 @@ @@ -69,7 +68,24 @@ > -

new Intl.NumberFormat($locales, { style: 'unit', unit: selectedUnit }).format(number))} t="comment"/>
+

+ new Intl.NumberFormat($locales, { style: "unit", unit: selectedUnit }).format(number) + )} + t="comment" + />
{#each options as [option, values]} @@ -79,15 +95,19 @@ {/if} {/each} @@ -95,5 +115,3 @@ {/each}
- - diff --git a/src/lib/components/pages/NumberFormat.svelte b/src/lib/components/pages/NumberFormat.svelte index 458f4ca..dcc7281 100644 --- a/src/lib/components/pages/NumberFormat.svelte +++ b/src/lib/components/pages/NumberFormat.svelte @@ -1,34 +1,34 @@ @@ -58,7 +57,14 @@ >



new Intl.NumberFormat($locales).format(number))} t="comment" /> - import Spacing from '$lib/components/ui/Spacing.svelte'; - import Card from '$lib/components/ui/Card.svelte'; - import Grid from '$lib/components/ui/Grid.svelte'; - import LocalePicker from '$lib/components/ui/LocalePicker.svelte'; + import Spacing from "$lib/components/ui/Spacing.svelte"; + import Card from "$lib/components/ui/Card.svelte"; + import Grid from "$lib/components/ui/Grid.svelte"; + import LocalePicker from "$lib/components/ui/LocalePicker.svelte"; - import { getMessages } from '$lib/i18n/util'; + import { getMessages } from "$lib/i18n/util"; export let showLocalePicker: boolean = true; const m = getMessages(); diff --git a/src/lib/components/pages/Playground/Playground.svelte b/src/lib/components/pages/Playground/Playground.svelte index ff8ef44..5b7b0c2 100644 --- a/src/lib/components/pages/Playground/Playground.svelte +++ b/src/lib/components/pages/Playground/Playground.svelte @@ -1,20 +1,20 @@ @@ -127,7 +127,7 @@
{#if $settings.showBrowserSupport} - + {/if} @@ -173,7 +173,10 @@

{m.output()}

- +

{m.code()}

@@ -191,7 +194,7 @@
- + {/if} {/if} diff --git a/src/lib/components/pages/Playground/PlaygroundInput.svelte b/src/lib/components/pages/Playground/PlaygroundInput.svelte index 82b447a..d029376 100644 --- a/src/lib/components/pages/Playground/PlaygroundInput.svelte +++ b/src/lib/components/pages/Playground/PlaygroundInput.svelte @@ -1,17 +1,17 @@ @@ -83,19 +80,19 @@ )} /> - + - import Highlight from '$lib/components/ui/Highlight.svelte'; - import OptionSection from '$lib/components/ui/OptionSection.svelte'; - import Grid from '$lib/components/ui/Grid.svelte'; - import Input from '$lib/components/ui/Input.svelte'; - import PageLayout from '$lib/components/pages/PageLayout.svelte'; - import Spacing from '$lib/components/ui/Spacing.svelte'; - import Radio from '$lib/components/ui/Radio.svelte'; - import Fieldset from '$lib/components/ui/Fieldset.svelte'; + import Highlight from "$lib/components/ui/Highlight.svelte"; + import OptionSection from "$lib/components/ui/OptionSection.svelte"; + import Grid from "$lib/components/ui/Grid.svelte"; + import Input from "$lib/components/ui/Input.svelte"; + import PageLayout from "$lib/components/pages/PageLayout.svelte"; + import Spacing from "$lib/components/ui/Spacing.svelte"; + import Radio from "$lib/components/ui/Radio.svelte"; + import Fieldset from "$lib/components/ui/Fieldset.svelte"; - import { relativeTimeFormatUnits } from '$lib/format-options/relative-time-format.options'; - import { copyCode } from '$lib/utils/copy-to-clipboard'; - import type { OptionValues } from '$lib/types/OptionValues.types'; - import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; - import { formatLocalesForPrint, tryFormat } from '$lib/utils/format-utils'; - import { getMessages } from '$lib/i18n/util'; - import { locales } from '$lib/store/locales'; + import { relativeTimeFormatUnits } from "$lib/format-options/relative-time-format.options"; + import { copyCode } from "$lib/utils/copy-to-clipboard"; + import type { OptionValues } from "$lib/types/OptionValues.types"; + import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; + import { formatLocalesForPrint, tryFormat } from "$lib/utils/format-utils"; + import { getMessages } from "$lib/i18n/util"; + import { locales } from "$lib/store/locales"; export let browserCompatData: BrowserSupportDataForMethod | null; let dayValue = 2; - let style: Intl.RelativeTimeFormatStyle = 'long'; - let numeric: 'always' | 'auto' = 'auto'; + let style: Intl.RelativeTimeFormatStyle = "long"; + let numeric: "always" | "auto" = "auto"; const m = getMessages(); @@ -37,54 +37,23 @@ value: Intl.RelativeTimeFormatUnit, language: string[] ) => tryFormat(() => new Intl.RelativeTimeFormat(language, options).format(day, value)); -
- - - + + +
- - + +
- + {#each relativeTimeFormatUnits as value} {#if value !== undefined} diff --git a/src/lib/components/pages/Segmenter.svelte b/src/lib/components/pages/Segmenter.svelte index 87c73d1..45d83fc 100644 --- a/src/lib/components/pages/Segmenter.svelte +++ b/src/lib/components/pages/Segmenter.svelte @@ -1,25 +1,25 @@ diff --git a/src/lib/components/ui/BrowserSupport/BrowserSupport.svelte b/src/lib/components/ui/BrowserSupport/BrowserSupport.svelte index 811e98b..b334222 100644 --- a/src/lib/components/ui/BrowserSupport/BrowserSupport.svelte +++ b/src/lib/components/ui/BrowserSupport/BrowserSupport.svelte @@ -1,9 +1,10 @@ diff --git a/src/lib/components/ui/BrowserSupport/SpecificationUrls.svelte b/src/lib/components/ui/BrowserSupport/SpecificationUrls.svelte index 5825f8f..013e931 100644 --- a/src/lib/components/ui/BrowserSupport/SpecificationUrls.svelte +++ b/src/lib/components/ui/BrowserSupport/SpecificationUrls.svelte @@ -2,12 +2,12 @@ import { getMessages } from "$lib/i18n/util"; import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; import { getSpecUrls } from "$lib/utils/browser-support"; - export let data: BrowserSupportDataForMethod | null; - const m = getMessages(); + export let data: BrowserSupportDataForMethod | null; + const m = getMessages();
- {#each getSpecUrls(data) as url} - {m.specification()} - {/each} -
\ No newline at end of file + {#each getSpecUrls(data) as url} + {m.specification()} + {/each} + diff --git a/src/lib/components/ui/BrowserSupport/SupportLabel.svelte b/src/lib/components/ui/BrowserSupport/SupportLabel.svelte index 8983a6a..8e253ff 100644 --- a/src/lib/components/ui/BrowserSupport/SupportLabel.svelte +++ b/src/lib/components/ui/BrowserSupport/SupportLabel.svelte @@ -2,32 +2,32 @@ import { getMessages } from "$lib/i18n/util"; import type { BrowserCoverage } from "$lib/types/BrowserSupport.types"; - export let support: BrowserCoverage | undefined = undefined; - export let hideFullSupport: boolean | undefined = false; - const m = getMessages(); + export let support: BrowserCoverage | undefined = undefined; + export let hideFullSupport: boolean | undefined = false; + const m = getMessages(); -

- {#if support === "full" && !hideFullSupport} - {m.fullSupport()} - {:else if support === "none"} - {m.noSupport()} - {:else if support === "partial" } - {m.partialSupport()} - {/if} +

+ {#if support === "full" && !hideFullSupport} + {m.fullSupport()} + {:else if support === "none"} + {m.noSupport()} + {:else if support === "partial"} + {m.partialSupport()} + {/if}

\ No newline at end of file + .full { + color: var(--darkgreen); + } + .partial { + color: var(--yellow); + } + .none { + color: var(--darkred); + } + .missing { + color: var(--gray); + } + diff --git a/src/lib/components/ui/Button.svelte b/src/lib/components/ui/Button.svelte index 120934c..69d68a2 100644 --- a/src/lib/components/ui/Button.svelte +++ b/src/lib/components/ui/Button.svelte @@ -1,96 +1,97 @@ {#if href} - - - + + + {:else} - + {/if} \ No newline at end of file + .uppercase { + text-transform: uppercase; + } + .bold { + font-weight: bold; + } + .no-background { + background-color: transparent; + border-color: transparent; + color: var(--button-no-background-text-color); + } + .button:disabled { + color: rgb(118, 118, 118); + cursor: not-allowed; + } + .button.no-background:not(:disabled):hover { + background-color: transparent; + border-color: var(--button-background-hover-color); + } + .button:not(:disabled):hover { + background-color: var(--button-background-hover-color); + } + diff --git a/src/lib/components/ui/Card.svelte b/src/lib/components/ui/Card.svelte index 64f7cef..b443da5 100644 --- a/src/lib/components/ui/Card.svelte +++ b/src/lib/components/ui/Card.svelte @@ -1,12 +1,12 @@
- +
\ No newline at end of file + background-color: var(--card-color); + } + diff --git a/src/lib/components/ui/Checkbox.svelte b/src/lib/components/ui/Checkbox.svelte index d85b5f1..4386d95 100644 --- a/src/lib/components/ui/Checkbox.svelte +++ b/src/lib/components/ui/Checkbox.svelte @@ -10,14 +10,7 @@
- +
@@ -25,10 +18,10 @@ .wrapper { display: inline; } - input[type='checkbox'] { + input[type="checkbox"] { width: var(--spacing-4); height: var(--spacing-4); - color: var(--text-color); + color: var(--text-color); accent-color: var(--purple4); } diff --git a/src/lib/components/ui/Chip.svelte b/src/lib/components/ui/Chip.svelte index a07dace..3c71f6e 100644 --- a/src/lib/components/ui/Chip.svelte +++ b/src/lib/components/ui/Chip.svelte @@ -1,6 +1,8 @@
- +
\ No newline at end of file + .ui :global(.visually-hidden) { + clip: rect(0 0 0 0); + clip-path: inset(50%); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; + } + + .ui :global(.icon) { + width: 24px; + height: 24px; + fill: none; + stroke: currentColor; + stroke-width: 2; + stroke-linecap: round; + stroke-linejoin: round; + } + diff --git a/src/lib/components/ui/DarkModeToggle.svelte b/src/lib/components/ui/DarkModeToggle.svelte deleted file mode 100644 index 4343039..0000000 --- a/src/lib/components/ui/DarkModeToggle.svelte +++ /dev/null @@ -1,73 +0,0 @@ - - -
- - -
- - diff --git a/src/lib/components/ui/DateTime.svelte b/src/lib/components/ui/DateTime.svelte index 21f2441..c4aeae8 100644 --- a/src/lib/components/ui/DateTime.svelte +++ b/src/lib/components/ui/DateTime.svelte @@ -8,7 +8,7 @@ const m = getMessages(); - const [date, time] = defaultValue.split('T'); + const [date, time] = defaultValue.split("T"); let dateString = date; let timeString = time; @@ -23,15 +23,15 @@ }; -
+
- +
- +
@@ -41,7 +41,11 @@ display: flex; gap: 1rem; } - .fullWidth, .date, .time, #date, #time { + .fullWidth, + .date, + .time, + #date, + #time { width: 100%; } diff --git a/src/lib/components/ui/Dialog.svelte b/src/lib/components/ui/Dialog.svelte index fe35393..889236c 100644 --- a/src/lib/components/ui/Dialog.svelte +++ b/src/lib/components/ui/Dialog.svelte @@ -14,11 +14,7 @@ - (show = false)} - on:click|self={() => dialog.close()} -> + (show = false)} on:click|self={() => dialog.close()}>
diff --git a/src/lib/components/ui/DisplayNamesHighlight.svelte b/src/lib/components/ui/DisplayNamesHighlight.svelte index ba43c3e..f037c0a 100644 --- a/src/lib/components/ui/DisplayNamesHighlight.svelte +++ b/src/lib/components/ui/DisplayNamesHighlight.svelte @@ -1,22 +1,20 @@ - \ No newline at end of file + + diff --git a/src/lib/components/ui/Fieldset.svelte b/src/lib/components/ui/Fieldset.svelte index 28d305a..2fa2bf6 100644 --- a/src/lib/components/ui/Fieldset.svelte +++ b/src/lib/components/ui/Fieldset.svelte @@ -1,28 +1,28 @@
- {legend} - + {legend} +
\ No newline at end of file + fieldset { + display: inline-flex; + align-items: center; + margin: 0; + padding: 0; + gap: var(--spacing-4); + border: none; + } + legend { + margin-bottom: var(--spacing-2); + } + .capitalize { + text-transform: capitalize; + } + diff --git a/src/lib/components/ui/Header.svelte b/src/lib/components/ui/Header.svelte index 28cf5b2..5ea6a4c 100644 --- a/src/lib/components/ui/Header.svelte +++ b/src/lib/components/ui/Header.svelte @@ -1,15 +1,15 @@ @@ -23,7 +23,7 @@ diff --git a/src/lib/components/ui/Highlight.svelte b/src/lib/components/ui/Highlight.svelte index 232354b..c5d0de9 100644 --- a/src/lib/components/ui/Highlight.svelte +++ b/src/lib/components/ui/Highlight.svelte @@ -4,9 +4,11 @@ import Token from '$lib/components/ui/Highlight/Token.svelte'; import Button from '$lib/components/ui/Button.svelte'; import Spacing from '$lib/components/ui/Spacing.svelte'; + import CopyToClipboard from '$lib/components/ui/icons/CopyToClipboard.svelte'; + + import type { OptionValues } from '$lib/types/OptionValues.types'; + import { getMessages } from '$lib/i18n/util'; - import CopyToClipboard from './icons/CopyToClipboard.svelte'; - type OptionValues = { [key: string]: number | boolean | string }; const m = getMessages(); diff --git a/src/lib/components/ui/Highlight/HighlightLocale.svelte b/src/lib/components/ui/Highlight/HighlightLocale.svelte index ff9612d..c9ab4b7 100644 --- a/src/lib/components/ui/Highlight/HighlightLocale.svelte +++ b/src/lib/components/ui/Highlight/HighlightLocale.svelte @@ -1,14 +1,16 @@ {#if locales.length === 1} - + {:else if !locales.length} - + {:else} - `"${l}"`).join(",")} t="string" /> -{/if} \ No newline at end of file + `"${l}"`).join(",")} t="string" /> +{/if} diff --git a/src/lib/components/ui/Input.svelte b/src/lib/components/ui/Input.svelte index 161b2ba..9bdbfad 100644 --- a/src/lib/components/ui/Input.svelte +++ b/src/lib/components/ui/Input.svelte @@ -16,9 +16,19 @@ {#if label} {/if} - + {#if onInput} - + {:else} {/if} diff --git a/src/lib/components/ui/LocalePicker.svelte b/src/lib/components/ui/LocalePicker.svelte index 9a24fc6..4e10c5e 100644 --- a/src/lib/components/ui/LocalePicker.svelte +++ b/src/lib/components/ui/LocalePicker.svelte @@ -1,31 +1,31 @@ diff --git a/src/lib/components/ui/Main.svelte b/src/lib/components/ui/Main.svelte index 54b0c08..53b60f4 100644 --- a/src/lib/components/ui/Main.svelte +++ b/src/lib/components/ui/Main.svelte @@ -2,7 +2,7 @@ export let center: boolean | undefined = undefined; -
+
diff --git a/src/lib/components/ui/Navigation.svelte b/src/lib/components/ui/Navigation.svelte index ca17f9e..1c7ca7c 100644 --- a/src/lib/components/ui/Navigation.svelte +++ b/src/lib/components/ui/Navigation.svelte @@ -1,18 +1,19 @@ @@ -96,7 +99,8 @@ textTransform="uppercase" noBackground > - {m.settingsButton()} + {m.settingsButton()} +
@@ -117,33 +121,31 @@ @@ -195,7 +197,8 @@ align-items: center; gap: var(--spacing-2); } - .menu-heading, .route { + .menu-heading, + .route { margin-bottom: var(--spacing-1); } .menu-heading { diff --git a/src/lib/components/ui/OptionCard.svelte b/src/lib/components/ui/OptionCard.svelte index bb8c89e..647c2fe 100644 --- a/src/lib/components/ui/OptionCard.svelte +++ b/src/lib/components/ui/OptionCard.svelte @@ -1,9 +1,9 @@

{text}

diff --git a/src/lib/components/ui/OptionSection.svelte b/src/lib/components/ui/OptionSection.svelte index f1ddc9f..6e4a15c 100644 --- a/src/lib/components/ui/OptionSection.svelte +++ b/src/lib/components/ui/OptionSection.svelte @@ -1,7 +1,8 @@ \ No newline at end of file + @media (prefers-reduced-motion: reduce) and (hover: hover) { + input[type="radio"]:not(:disabled):hover { + transform: scale(1); + } + } + diff --git a/src/lib/components/ui/Select.svelte b/src/lib/components/ui/Select.svelte index 499d037..2d2a99a 100644 --- a/src/lib/components/ui/Select.svelte +++ b/src/lib/components/ui/Select.svelte @@ -1,5 +1,5 @@ - -
- {#each settingsKeys as key} - - {#if settingsConfiguration[key].type === "radio"} -
- {#each settingsConfiguration[key].values as option} - - {/each} -
- {/if} - {#if settingsConfiguration[key].type === "checkbox"} - - {/if} - {#if settingsConfiguration[key].hint} - -

{getHint(key)}

- {/if} -
- {/each} -
- - - + +

{m.languageHint()}

+ + +
+
\ No newline at end of file + diff --git a/src/lib/components/ui/Spacing.svelte b/src/lib/components/ui/Spacing.svelte index de139b1..9919940 100644 --- a/src/lib/components/ui/Spacing.svelte +++ b/src/lib/components/ui/Spacing.svelte @@ -1,7 +1,9 @@ +
+ \ No newline at end of file + summary:hover > .summary-icon { + opacity: 1; + } + diff --git a/src/lib/components/ui/icons/AndroidWebView.svelte b/src/lib/components/ui/icons/AndroidWebView.svelte index ecc86b5..fa8bd4a 100644 --- a/src/lib/components/ui/icons/AndroidWebView.svelte +++ b/src/lib/components/ui/icons/AndroidWebView.svelte @@ -1,8 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/Browser.svelte b/src/lib/components/ui/icons/Browser.svelte index ed6b9f2..ae173ce 100644 --- a/src/lib/components/ui/icons/Browser.svelte +++ b/src/lib/components/ui/icons/Browser.svelte @@ -1 +1,27 @@ - \ No newline at end of file + diff --git a/src/lib/components/ui/icons/BrowserType.svelte b/src/lib/components/ui/icons/BrowserType.svelte index c1287d6..6c5701f 100644 --- a/src/lib/components/ui/icons/BrowserType.svelte +++ b/src/lib/components/ui/icons/BrowserType.svelte @@ -1,17 +1,17 @@ -{#if browserType === 'desktop'} +{#if browserType === "desktop"} {/if} -{#if browserType === 'mobile'} +{#if browserType === "mobile"} {/if} -{#if browserType === 'server'} +{#if browserType === "server"} {/if} diff --git a/src/lib/components/ui/icons/ChevronUp.svelte b/src/lib/components/ui/icons/ChevronUp.svelte index e0f2ef4..8165187 100644 --- a/src/lib/components/ui/icons/ChevronUp.svelte +++ b/src/lib/components/ui/icons/ChevronUp.svelte @@ -1,12 +1,12 @@ diff --git a/src/lib/components/ui/icons/CopyToClipboard.svelte b/src/lib/components/ui/icons/CopyToClipboard.svelte index 094449c..a31b4cf 100644 --- a/src/lib/components/ui/icons/CopyToClipboard.svelte +++ b/src/lib/components/ui/icons/CopyToClipboard.svelte @@ -1 +1,21 @@ - \ No newline at end of file + diff --git a/src/lib/components/ui/icons/Deno.svelte b/src/lib/components/ui/icons/Deno.svelte index 1117b30..2230771 100644 --- a/src/lib/components/ui/icons/Deno.svelte +++ b/src/lib/components/ui/icons/Deno.svelte @@ -1,8 +1,16 @@ - + diff --git a/src/lib/components/ui/icons/Desktop.svelte b/src/lib/components/ui/icons/Desktop.svelte index a64b60d..8314dd0 100644 --- a/src/lib/components/ui/icons/Desktop.svelte +++ b/src/lib/components/ui/icons/Desktop.svelte @@ -1,9 +1,9 @@ - + + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/Firefox.svelte b/src/lib/components/ui/icons/Firefox.svelte index 1c0bf9c..2422b07 100644 --- a/src/lib/components/ui/icons/Firefox.svelte +++ b/src/lib/components/ui/icons/Firefox.svelte @@ -1,8 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/Icon.svelte b/src/lib/components/ui/icons/Icon.svelte index 6992515..54f36d3 100644 --- a/src/lib/components/ui/icons/Icon.svelte +++ b/src/lib/components/ui/icons/Icon.svelte @@ -1,40 +1,40 @@ -{#if browserName.includes('chrome')} +{#if browserName.includes("chrome")} {/if} -{#if browserName.includes('firefox')} +{#if browserName.includes("firefox")} {/if} -{#if browserName.includes('safari')} +{#if browserName.includes("safari")} {/if} -{#if browserName.includes('opera')} +{#if browserName.includes("opera")} {/if} -{#if browserName.includes('edge')} +{#if browserName.includes("edge")} {/if} -{#if browserName.includes('deno')} +{#if browserName.includes("deno")} {/if} -{#if browserName.includes('webview')} +{#if browserName.includes("webview")} {/if} -{#if browserName.includes('node')} +{#if browserName.includes("node")} {/if} -{#if browserName.includes('samsung')} +{#if browserName.includes("samsung")} {/if} diff --git a/src/lib/components/ui/icons/Mobile.svelte b/src/lib/components/ui/icons/Mobile.svelte index 2506923..06e834d 100644 --- a/src/lib/components/ui/icons/Mobile.svelte +++ b/src/lib/components/ui/icons/Mobile.svelte @@ -1,10 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 11px; + } + diff --git a/src/lib/components/ui/icons/Node.svelte b/src/lib/components/ui/icons/Node.svelte index fe3c405..af57064 100644 --- a/src/lib/components/ui/icons/Node.svelte +++ b/src/lib/components/ui/icons/Node.svelte @@ -1,8 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/OpenInNewTab.svelte b/src/lib/components/ui/icons/OpenInNewTab.svelte index d0b403a..cda3417 100644 --- a/src/lib/components/ui/icons/OpenInNewTab.svelte +++ b/src/lib/components/ui/icons/OpenInNewTab.svelte @@ -1,7 +1,7 @@ + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/Safari.svelte b/src/lib/components/ui/icons/Safari.svelte index 1e0aec3..2312ed2 100644 --- a/src/lib/components/ui/icons/Safari.svelte +++ b/src/lib/components/ui/icons/Safari.svelte @@ -1,8 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/Samsung.svelte b/src/lib/components/ui/icons/Samsung.svelte index 3562420..703b2f7 100644 --- a/src/lib/components/ui/icons/Samsung.svelte +++ b/src/lib/components/ui/icons/Samsung.svelte @@ -1,8 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/components/ui/icons/Server.svelte b/src/lib/components/ui/icons/Server.svelte index d041c30..1cf03cc 100644 --- a/src/lib/components/ui/icons/Server.svelte +++ b/src/lib/components/ui/icons/Server.svelte @@ -1,8 +1,20 @@ - + diff --git a/src/lib/components/ui/icons/Settings.svelte b/src/lib/components/ui/icons/Settings.svelte index 6226368..95117d1 100644 --- a/src/lib/components/ui/icons/Settings.svelte +++ b/src/lib/components/ui/icons/Settings.svelte @@ -5,7 +5,7 @@ viewBox="0 0 24 24" fill="none" stroke="currentColor" - aria-hidden="true" + aria-hidden="true" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" diff --git a/src/lib/components/ui/icons/chrome.svelte b/src/lib/components/ui/icons/chrome.svelte index d05929d..2015de1 100644 --- a/src/lib/components/ui/icons/chrome.svelte +++ b/src/lib/components/ui/icons/chrome.svelte @@ -1,8 +1,13 @@ - + \ No newline at end of file + svg { + height: 16px; + width: 16px; + } + diff --git a/src/lib/format-methods.ts b/src/lib/format-methods.ts index ea31970..d066f0a 100644 --- a/src/lib/format-methods.ts +++ b/src/lib/format-methods.ts @@ -1,22 +1,22 @@ export const formatMethods = [ - 'NumberFormat', - 'DateTimeFormat', - 'RelativeTimeFormat', - 'ListFormat', - 'PluralRules', - 'Collator', - 'Segmenter', - 'DisplayNames', - 'DurationFormat', + "NumberFormat", + "DateTimeFormat", + "RelativeTimeFormat", + "ListFormat", + "PluralRules", + "Collator", + "Segmenter", + "DisplayNames", + "DurationFormat" ] as const; export type FormatMethodsKeys = - | 'DateTimeFormat' - | 'NumberFormat' - | 'ListFormat' - | 'RelativeTimeFormat' - | 'PluralRules' - | 'Collator' - | 'Segmenter' - | 'DisplayNames' - | 'DurationFormat'; + | "DateTimeFormat" + | "NumberFormat" + | "ListFormat" + | "RelativeTimeFormat" + | "PluralRules" + | "Collator" + | "Segmenter" + | "DisplayNames" + | "DurationFormat"; diff --git a/src/lib/format-options/collator.options.ts b/src/lib/format-options/collator.options.ts index 029893e..f91a3d5 100644 --- a/src/lib/format-options/collator.options.ts +++ b/src/lib/format-options/collator.options.ts @@ -1,10 +1,10 @@ -import { localeMatcher } from "./common.options"; +import { localeMatcher } from "$lib/format-options/common.options"; export const collatorFormatOptions = { - usage: ['sort', 'search', undefined], + usage: ["sort", "search", undefined], numeric: [true, false, undefined], - caseFirst: ['upper', 'lower', 'false', undefined], - sensitivity: ['base', 'accent', 'case', 'variant', undefined], + caseFirst: ["upper", "lower", "false", undefined], + sensitivity: ["base", "accent", "case", "variant", undefined], ignorePunctuation: [true, false, undefined], localeMatcher } as const; diff --git a/src/lib/format-options/common.options.ts b/src/lib/format-options/common.options.ts index cf39bed..ba0d26a 100644 --- a/src/lib/format-options/common.options.ts +++ b/src/lib/format-options/common.options.ts @@ -1,6 +1,34 @@ -export const style = [undefined, 'long', 'short', 'narrow'] as const; -export const localeMatcher = [undefined, 'best fit', 'lookup'] as const; +export const style = [undefined, "long", "short", "narrow"] as const; +export const localeMatcher = [undefined, "best fit", "lookup"] as const; export const roundingPriority = ["auto", "morePrecision", "lessPrecision", undefined] as const; -export const roundingIncrement = [1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000, undefined] as const -export const roundingMode = ["ceil", "floor", "expand", "trunc", "halfCeil", "halfFloor", "halfExpand", "halfTrunc", "halfEven", undefined] as const; -export const trailingZeroDisplay = ["auto", "stripIfInteger", undefined] as const; \ No newline at end of file +export const roundingIncrement = [ + 1, + 2, + 5, + 10, + 20, + 25, + 50, + 100, + 200, + 250, + 500, + 1000, + 2000, + 2500, + 5000, + undefined +] as const; +export const roundingMode = [ + "ceil", + "floor", + "expand", + "trunc", + "halfCeil", + "halfFloor", + "halfExpand", + "halfTrunc", + "halfEven", + undefined +] as const; +export const trailingZeroDisplay = ["auto", "stripIfInteger", undefined] as const; diff --git a/src/lib/format-options/datetime-format.options.ts b/src/lib/format-options/datetime-format.options.ts index 497d8e7..6239100 100644 --- a/src/lib/format-options/datetime-format.options.ts +++ b/src/lib/format-options/datetime-format.options.ts @@ -1,43 +1,43 @@ -import { calendars, numberingSystems } from '$lib/locale-data/calendars'; -import type { AllFormatOptionsKeys } from '$lib/format-options/types'; -import { style, localeMatcher } from './common.options'; +import { calendars, numberingSystems } from "$lib/locale-data/calendars"; +import type { AllFormatOptionsKeys } from "$lib/format-options/types"; +import { style, localeMatcher } from "$lib/format-options/common.options"; export const datetimeFormatOptions = { - dateStyle: ['full', 'long', 'medium', 'short', undefined], - timeStyle: ['full', 'long', 'medium', 'short', undefined], - year: ['numeric', '2-digit', undefined], - month: ['numeric', '2-digit', ...style], - day: ['numeric', '2-digit', undefined], - hour: ['numeric', '2-digit', undefined], - minute: ['numeric', '2-digit', undefined], - second: ['numeric', '2-digit', undefined], + dateStyle: ["full", "long", "medium", "short", undefined], + timeStyle: ["full", "long", "medium", "short", undefined], + year: ["numeric", "2-digit", undefined], + month: ["numeric", "2-digit", ...style], + day: ["numeric", "2-digit", undefined], + hour: ["numeric", "2-digit", undefined], + minute: ["numeric", "2-digit", undefined], + second: ["numeric", "2-digit", undefined], weekday: style, era: style, hour12: [true, false, undefined], - hourCycle: ['h11', 'h12', 'h23', 'h24', undefined], + hourCycle: ["h11", "h12", "h23", "h24", undefined], dayPeriod: style, fractionalSecondDigits: [1, 2, 3, undefined], calendar: [...calendars, undefined], numberingSystem: [...numberingSystems, undefined], - timeZoneName: ['long', 'short', undefined], - formatMatcher: ['best fit', 'basic', undefined], + timeZoneName: ["long", "short", undefined], + formatMatcher: ["best fit", "basic", undefined], localeMatcher } as const; export const getDateTimeFormatOptions = ( - option: AllFormatOptionsKeys['DateTimeFormat'] | string, + option: AllFormatOptionsKeys["DateTimeFormat"] | string, value: string | boolean | number ): Partial => { - if (option === 'fractionalSecondDigits') { + if (option === "fractionalSecondDigits") { return { - [option as AllFormatOptionsKeys['DateTimeFormat']]: value as number, - second: 'numeric' + [option as AllFormatOptionsKeys["DateTimeFormat"]]: value as number, + second: "numeric" }; } - if (option === 'hour12' || option == 'hourCycle') { + if (option === "hour12" || option == "hourCycle") { return { - [option as AllFormatOptionsKeys['DateTimeFormat']]: value as number, - timeStyle: 'medium' + [option as AllFormatOptionsKeys["DateTimeFormat"]]: value as number, + timeStyle: "medium" }; } return { diff --git a/src/lib/format-options/display-names.options.ts b/src/lib/format-options/display-names.options.ts index 0d14cbb..6cc2d61 100644 --- a/src/lib/format-options/display-names.options.ts +++ b/src/lib/format-options/display-names.options.ts @@ -1,10 +1,9 @@ - -import { style, localeMatcher } from './common.options'; +import { style, localeMatcher } from "$lib/format-options/common.options"; export const displayNamesOptions = { style, - type: ['language', 'region', 'script', 'calendar', 'dateTimeField', 'currency', undefined], - languageDisplay: ['dialect', 'standard', undefined], - fallback: ['code', 'none', undefined], + type: ["language", "region", "script", "calendar", "dateTimeField", "currency", undefined], + languageDisplay: ["dialect", "standard", undefined], + fallback: ["code", "none", undefined], localeMatcher } as const; diff --git a/src/lib/format-options/duration-format.options.ts b/src/lib/format-options/duration-format.options.ts index 26d7dc5..eb133c9 100644 --- a/src/lib/format-options/duration-format.options.ts +++ b/src/lib/format-options/duration-format.options.ts @@ -1,31 +1,31 @@ -import { defaultNumberRange } from '$lib/utils/format-utils'; -import { style, localeMatcher } from './common.options'; +import { defaultNumberRange } from "$lib/utils/format-utils"; +import { style, localeMatcher } from "$lib/format-options/common.options"; export const durationFormatOptions = { - style, - years: style, - months: style, - weeks: style, - days: style, - hours: style, - minutes: style, - seconds: style, - milliseconds: style, - microseconds: style, - nanoseconds: style, - fractionalDigits: [...defaultNumberRange, undefined], - localeMatcher + style, + years: style, + months: style, + weeks: style, + days: style, + hours: style, + minutes: style, + seconds: style, + milliseconds: style, + microseconds: style, + nanoseconds: style, + fractionalDigits: [...defaultNumberRange, undefined], + localeMatcher } as const; export const durationValues: (keyof Intl.Duration)[] = [ - "years", - "months", - "weeks", - "days", - "hours", - "minutes", - "seconds", - "milliseconds", - "microseconds", - "nanoseconds" -]; \ No newline at end of file + "years", + "months", + "weeks", + "days", + "hours", + "minutes", + "seconds", + "milliseconds", + "microseconds", + "nanoseconds" +]; diff --git a/src/lib/format-options/index.ts b/src/lib/format-options/index.ts index fb0591a..ccd0d28 100644 --- a/src/lib/format-options/index.ts +++ b/src/lib/format-options/index.ts @@ -1,16 +1,16 @@ -import { collatorFormatOptions } from './collator.options'; -import { datetimeFormatOptions } from './datetime-format.options'; -import { displayNamesOptions } from './display-names.options'; -import { durationFormatOptions } from './duration-format.options'; -import { listFormatOptions } from './list-format.options'; +import { collatorFormatOptions } from "$lib/format-options/collator.options"; +import { datetimeFormatOptions } from "$lib/format-options/datetime-format.options"; +import { displayNamesOptions } from "$lib/format-options/display-names.options"; +import { durationFormatOptions } from "$lib/format-options/duration-format.options"; +import { listFormatOptions } from "$lib/format-options/list-format.options"; import { numberFormatOptionsCommon, numberFormatOptionsCurrency, numberFormatOptionsUnit -} from './number-format.options'; -import { pluralRulesFormatOptions } from './plural-rules.options'; -import { relativeTimeFormatOptions } from './relative-time-format.options'; -import { segmenterOptions } from './segmenter.options'; +} from "$lib/format-options/number-format.options"; +import { pluralRulesFormatOptions } from "$lib/format-options/plural-rules.options"; +import { relativeTimeFormatOptions } from "$lib/format-options/relative-time-format.options"; +import { segmenterOptions } from "$lib/format-options/segmenter.options"; export const formatOptions = { DateTimeFormat: datetimeFormatOptions, diff --git a/src/lib/format-options/list-format.options.ts b/src/lib/format-options/list-format.options.ts index 1cf0d57..51dcc0d 100644 --- a/src/lib/format-options/list-format.options.ts +++ b/src/lib/format-options/list-format.options.ts @@ -1,7 +1,7 @@ -import { style, localeMatcher } from './common.options'; +import { style, localeMatcher } from "$lib/format-options/common.options"; export const listFormatOptions = { - type: [undefined, 'conjunction', 'disjunction', 'unit'], + type: [undefined, "conjunction", "disjunction", "unit"], style, localeMatcher } as const; diff --git a/src/lib/format-options/number-format.options.ts b/src/lib/format-options/number-format.options.ts index 2b51a49..6d11ee9 100644 --- a/src/lib/format-options/number-format.options.ts +++ b/src/lib/format-options/number-format.options.ts @@ -1,11 +1,18 @@ -import { currencies } from '$lib/locale-data/currencies'; -import { units } from '$lib/locale-data/units'; -import { defaultNumberRange } from '$lib/utils/format-utils'; -import { localeMatcher, roundingIncrement, roundingMode, roundingPriority, trailingZeroDisplay, style } from './common.options'; +import { currencies } from "$lib/locale-data/currencies"; +import { units } from "$lib/locale-data/units"; +import { defaultNumberRange } from "$lib/utils/format-utils"; +import { + localeMatcher, + roundingIncrement, + roundingMode, + roundingPriority, + trailingZeroDisplay, + style +} from "$lib/format-options/common.options"; export const numberFormatOptionsCommon = { - style: ['currency', 'unit'], - signDisplay: ['auto', 'never', 'always', 'exceptZero', undefined], + style: ["currency", "unit"], + signDisplay: ["auto", "never", "always", "exceptZero", undefined], useGrouping: [true, false, undefined], minimumIntegerDigits: [...defaultNumberRange, undefined], minimumFractionDigits: [...defaultNumberRange, undefined], @@ -20,14 +27,14 @@ export const numberFormatOptionsCommon = { } as const; export const numberFormatOptionsCurrency = { - currencySign: ['standard', 'accounting', undefined], - currencyDisplay: ['code', 'symbol', 'narrowSymbol', 'name', undefined], + currencySign: ["standard", "accounting", undefined], + currencyDisplay: ["code", "symbol", "narrowSymbol", "name", undefined], currency: Object.keys(currencies) } as const; export const numberFormatOptionsUnit = { unit: units, unitDisplay: style, - compactDisplay: ['short', 'long', undefined], - notation: ['standard', 'scientific', 'engineering', 'compact', undefined] + compactDisplay: ["short", "long", undefined], + notation: ["standard", "scientific", "engineering", "compact", undefined] } as const; diff --git a/src/lib/format-options/plural-rules.options.ts b/src/lib/format-options/plural-rules.options.ts index 326f866..4eb5cb7 100644 --- a/src/lib/format-options/plural-rules.options.ts +++ b/src/lib/format-options/plural-rules.options.ts @@ -1,8 +1,14 @@ -import { defaultNumberRange } from '$lib/utils/format-utils'; -import { localeMatcher, roundingIncrement, roundingMode, roundingPriority, trailingZeroDisplay } from './common.options'; +import { defaultNumberRange } from "$lib/utils/format-utils"; +import { + localeMatcher, + roundingIncrement, + roundingMode, + roundingPriority, + trailingZeroDisplay +} from "$lib/format-options/common.options"; export const pluralRulesFormatOptions = { - type: ['cardinal', 'ordinal', undefined], + type: ["cardinal", "ordinal", undefined], minimumIntegerDigits: [...defaultNumberRange, undefined], minimumFractionDigits: [...defaultNumberRange, undefined], maximumFractionDigits: [...defaultNumberRange, undefined], diff --git a/src/lib/format-options/relative-time-format.options.ts b/src/lib/format-options/relative-time-format.options.ts index 0e47e86..0eb5092 100644 --- a/src/lib/format-options/relative-time-format.options.ts +++ b/src/lib/format-options/relative-time-format.options.ts @@ -1,26 +1,26 @@ -import { localeMatcher, style } from './common.options'; +import { localeMatcher, style } from "$lib/format-options/common.options"; export const relativeTimeFormatUnits: Intl.RelativeTimeFormatUnit[] = [ - 'year', - 'years', - 'quarter', - 'quarters', - 'month', - 'months', - 'week', - 'weeks', - 'day', - 'days', - 'hour', - 'hours', - 'minute', - 'minutes', - 'second', - 'seconds' + "year", + "years", + "quarter", + "quarters", + "month", + "months", + "week", + "weeks", + "day", + "days", + "hour", + "hours", + "minute", + "minutes", + "second", + "seconds" ]; export const relativeTimeFormatOptions = { - numeric: ['always', 'auto', undefined], + numeric: ["always", "auto", undefined], style, unit: relativeTimeFormatUnits, localeMatcher diff --git a/src/lib/format-options/segmenter.options.ts b/src/lib/format-options/segmenter.options.ts index 07539a2..ab8adde 100644 --- a/src/lib/format-options/segmenter.options.ts +++ b/src/lib/format-options/segmenter.options.ts @@ -1,6 +1,6 @@ -import { localeMatcher } from './common.options'; +import { localeMatcher } from "$lib/format-options/common.options"; export const segmenterOptions = { - granularity: ['word', 'sentence', 'grapheme', undefined], + granularity: ["word", "sentence", "grapheme", undefined], localeMatcher } as const; diff --git a/src/lib/format-options/types.ts b/src/lib/format-options/types.ts index ab59337..2a56914 100644 --- a/src/lib/format-options/types.ts +++ b/src/lib/format-options/types.ts @@ -11,14 +11,14 @@ export type AllFormatOptions = { }; export type AllFormatOptionsKeys = { - DateTimeFormat: keyof AllFormatOptions['DateTimeFormat']; - NumberFormat: keyof AllFormatOptions['NumberFormat']; - ListFormat: keyof AllFormatOptions['ListFormat']; - RelativeTimeFormat: keyof AllFormatOptions['RelativeTimeFormat']; - PluralRules: keyof AllFormatOptions['PluralRules']; - Collator: keyof AllFormatOptions['Collator']; - Segmenter: keyof AllFormatOptions['Segmenter']; - DisplayNames: keyof AllFormatOptions['DisplayNames']; + DateTimeFormat: keyof AllFormatOptions["DateTimeFormat"]; + NumberFormat: keyof AllFormatOptions["NumberFormat"]; + ListFormat: keyof AllFormatOptions["ListFormat"]; + RelativeTimeFormat: keyof AllFormatOptions["RelativeTimeFormat"]; + PluralRules: keyof AllFormatOptions["PluralRules"]; + Collator: keyof AllFormatOptions["Collator"]; + Segmenter: keyof AllFormatOptions["Segmenter"]; + DisplayNames: keyof AllFormatOptions["DisplayNames"]; DurationFormat: keyof AllFormatOptions["DurationFormat"]; }; diff --git a/src/lib/i18n/MessagesContext.svelte b/src/lib/i18n/MessagesContext.svelte index 60a872c..4e33333 100644 --- a/src/lib/i18n/MessagesContext.svelte +++ b/src/lib/i18n/MessagesContext.svelte @@ -1,8 +1,8 @@ - \ No newline at end of file + diff --git a/src/lib/i18n/Provider.svelte b/src/lib/i18n/Provider.svelte index 2e58d0e..4f17d27 100644 --- a/src/lib/i18n/Provider.svelte +++ b/src/lib/i18n/Provider.svelte @@ -1,11 +1,11 @@ - - - - \ No newline at end of file + + + + diff --git a/src/lib/i18n/i18n.ts b/src/lib/i18n/i18n.ts index 94e935d..a901490 100644 --- a/src/lib/i18n/i18n.ts +++ b/src/lib/i18n/i18n.ts @@ -1,4 +1,4 @@ -import { createI18n } from "@inlang/paraglide-js-adapter-sveltekit" -import * as runtime from "$paraglide/runtime" +import { createI18n } from "@inlang/paraglide-js-adapter-sveltekit"; +import * as runtime from "$paraglide/runtime"; export const i18n = createI18n(runtime); diff --git a/src/lib/i18n/types.ts b/src/lib/i18n/types.ts index 055e860..8d20ac2 100644 --- a/src/lib/i18n/types.ts +++ b/src/lib/i18n/types.ts @@ -1 +1 @@ -export const i18nContextKey = "i18n"; \ No newline at end of file +export const i18nContextKey = "i18n"; diff --git a/src/lib/i18n/util.ts b/src/lib/i18n/util.ts index cd641a7..e80f99a 100644 --- a/src/lib/i18n/util.ts +++ b/src/lib/i18n/util.ts @@ -1,6 +1,6 @@ import { getContext } from "svelte"; -import { i18nContextKey } from "./types"; -import * as m from "$paraglide/messages" +import { i18nContextKey } from "$lib/i18n/types"; +import * as m from "$paraglide/messages"; export const getMessages = () => getContext(i18nContextKey) as typeof m; -export const getMessagesWithoutContext = () => m; \ No newline at end of file +export const getMessagesWithoutContext = () => m; diff --git a/src/lib/locale-data/calendars.ts b/src/lib/locale-data/calendars.ts index 286d056..e97d3c1 100644 --- a/src/lib/locale-data/calendars.ts +++ b/src/lib/locale-data/calendars.ts @@ -1,40 +1,40 @@ export const calendars = [ - 'buddhist', - 'chinese', - 'coptic', - 'ethiopia', - 'ethiopic', - 'gregory', - 'hebrew', - 'indian', - 'islamic', - 'iso8601', - 'japanese', - 'persian', - 'roc' + "buddhist", + "chinese", + "coptic", + "ethiopia", + "ethiopic", + "gregory", + "hebrew", + "indian", + "islamic", + "iso8601", + "japanese", + "persian", + "roc" ] as const; export const numberingSystems = [ - 'arab', - 'arabext', - 'bali', - 'beng', - 'deva', - 'fullwide', - 'gujr', - 'guru', - 'hanidec', - 'khmr', - 'knda', - 'laoo', - 'latn', - 'limb', - 'mlym', - 'mong', - 'mymr', - 'orya', - 'tamldec', - 'telu', - 'thai', - 'tibt' + "arab", + "arabext", + "bali", + "beng", + "deva", + "fullwide", + "gujr", + "guru", + "hanidec", + "khmr", + "knda", + "laoo", + "latn", + "limb", + "mlym", + "mong", + "mymr", + "orya", + "tamldec", + "telu", + "thai", + "tibt" ] as const; diff --git a/src/lib/locale-data/currencies.ts b/src/lib/locale-data/currencies.ts index 5973853..6c2d4bc 100644 --- a/src/lib/locale-data/currencies.ts +++ b/src/lib/locale-data/currencies.ts @@ -1,182 +1,182 @@ export const currencies = { - AED: 'United Arab Emirates dirham', - AFN: 'Afghan afghani', - ALL: 'Albanian lek', - AMD: 'Armenian dram', - ANG: 'Netherlands Antillean guilder', - AOA: 'Angolan kwanza', - ARS: 'Argentine peso', - AUD: 'Australian dollar', - AWG: 'Aruban florin', - AZN: 'Azerbaijani manat', - BAM: 'Bosnia and Herzegovina convertible mark', - BBD: 'Barbados dollar', - BDT: 'Bangladeshi taka', - BGN: 'Bulgarian lev', - BHD: 'Bahraini dinar', - BIF: 'Burundian franc', - BMD: 'Bermudian dollar', - BND: 'Brunei dollar', - BOB: 'Boliviano', - BOV: 'Bolivian Mvdol (funds code)', - BRL: 'Brazilian real', - BSD: 'Bahamian dollar', - BTN: 'Bhutanese ngultrum', - BWP: 'Botswana pula', - BYN: 'Belarusian ruble', - BZD: 'Belize dollar', - CAD: 'Canadian dollar', - CDF: 'Congolese franc', - CHE: 'WIR euro (complementary currency)', - CHF: 'Swiss franc', - CHW: 'WIR franc (complementary currency)', - CLF: 'Unidad de Fomento (funds code)', - CLP: 'Chilean peso', - CNY: 'Chinese yuan[8]', - COP: 'Colombian peso', - COU: 'Unidad de Valor Real (UVR) (funds code)[9]', - CRC: 'Costa Rican colon', - CUC: 'Cuban convertible peso', - CUP: 'Cuban peso', - CVE: 'Cape Verdean escudo', - CZK: 'Czech koruna', - DJF: 'Djiboutian franc', - DKK: 'Danish krone', - DOP: 'Dominican peso', - DZD: 'Algerian dinar', - EGP: 'Egyptian pound', - ERN: 'Eritrean nakfa', - ETB: 'Ethiopian birr', - EUR: 'Euro', - FJD: 'Fiji dollar', - FKP: 'Falkland Islands pound', - GBP: 'Pound sterling', - GEL: 'Georgian lari', - GHS: 'Ghanaian cedi', - GIP: 'Gibraltar pound', - GMD: 'Gambian dalasi', - GNF: 'Guinean franc', - GTQ: 'Guatemalan quetzal', - GYD: 'Guyanese dollar', - HKD: 'Hong Kong dollar', - HNL: 'Honduran lempira', - HRK: 'Croatian kuna', - HTG: 'Haitian gourde', - HUF: 'Hungarian forint', - IDR: 'Indonesian rupiah', - ILS: 'Israeli new shekel', - INR: 'Indian rupee', - IQD: 'Iraqi dinar', - IRR: 'Iranian rial', - ISK: 'Icelandic króna (plural: krónur)', - JMD: 'Jamaican dollar', - JOD: 'Jordanian dinar', - JPY: 'Japanese yen', - KES: 'Kenyan shilling', - KGS: 'Kyrgyzstani som', - KHR: 'Cambodian riel', - KMF: 'Comoro franc', - KPW: 'North Korean won', - KRW: 'South Korean won', - KWD: 'Kuwaiti dinar', - KYD: 'Cayman Islands dollar', - KZT: 'Kazakhstani tenge', - LAK: 'Lao kip', - LBP: 'Lebanese pound', - LKR: 'Sri Lankan rupee', - LRD: 'Liberian dollar', - LSL: 'Lesotho loti', - LYD: 'Libyan dinar', - MAD: 'Moroccan dirham', - MDL: 'Moldovan leu', - MGA: 'Malagasy ariary', - MKD: 'Macedonian denar', - MMK: 'Myanmar kyat', - MNT: 'Mongolian tögrög', - MOP: 'Macanese pataca', - MRU: 'Mauritanian ouguiya', - MUR: 'Mauritian rupee', - MVR: 'Maldivian rufiyaa', - MWK: 'Malawian kwacha', - MXN: 'Mexican peso', - MXV: 'Mexican Unidad de Inversion (UDI) (funds code)', - MYR: 'Malaysian ringgit', - MZN: 'Mozambican metical', - NAD: 'Namibian dollar', - NGN: 'Nigerian naira', - NIO: 'Nicaraguan córdoba', - NOK: 'Norwegian krone', - NPR: 'Nepalese rupee', - NZD: 'New Zealand dollar', - OMR: 'Omani rial', - PAB: 'Panamanian balboa', - PEN: 'Peruvian sol', - PGK: 'Papua New Guinean kina', - PHP: 'Philippine peso[13]', - PKR: 'Pakistani rupee', - PLN: 'Polish złoty', - PYG: 'Paraguayan guaraní', - QAR: 'Qatari riyal', - RON: 'Romanian leu', - RSD: 'Serbian dinar', - RUB: 'Russian ruble', - RWF: 'Rwandan franc', - SAR: 'Saudi riyal', - SBD: 'Solomon Islands dollar', - SCR: 'Seychelles rupee', - SDG: 'Sudanese pound', - SEK: 'Swedish krona (plural: kronor)', - SGD: 'Singapore dollar', - SHP: 'Saint Helena pound', - SLL: 'Sierra Leonean leone', - SOS: 'Somali shilling', - SRD: 'Surinamese dollar', - SSP: 'South Sudanese pound', - STN: 'São Tomé and Príncipe dobra', - SVC: 'Salvadoran colón', - SYP: 'Syrian pound', - SZL: 'Swazi lilangeni', - THB: 'Thai baht', - TJS: 'Tajikistani somoni', - TMT: 'Turkmenistan manat', - TND: 'Tunisian dinar', - TOP: 'Tongan paʻanga', - TRY: 'Turkish lira', - TTD: 'Trinidad and Tobago dollar', - TWD: 'New Taiwan dollar', - TZS: 'Tanzanian shilling', - UAH: 'Ukrainian hryvnia', - UGX: 'Ugandan shilling', - USD: 'United States dollar', - USN: 'United States dollar (next day) (funds code)', - UYI: 'Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code)', - UYU: 'Uruguayan peso', - UYW: 'Unidad previsional[15]', - UZS: 'Uzbekistan som', - VED: 'Venezuelan bolívar digital[16]', - VES: 'Venezuelan bolívar soberano[13]', - VND: 'Vietnamese đồng', - VUV: 'Vanuatu vatu', - WST: 'Samoan tala', - XAF: 'CFA franc BEAC', - XAG: 'Silver (one troy ounce)', - XAU: 'Gold (one troy ounce)', - XBA: 'European Composite Unit (EURCO) (bond market unit)', - XBB: 'European Monetary Unit (E.M.U.-6) (bond market unit)', - XBC: 'European Unit of Account 9 (E.U.A.-9) (bond market unit)', - XBD: 'European Unit of Account 17 (E.U.A.-17) (bond market unit)', - XCD: 'East Caribbean dollar', - XDR: 'Special drawing rights', - XOF: 'CFA franc BCEAO', - XPD: 'Palladium (one troy ounce)', - XPF: 'CFP franc (franc Pacifique)', - XPT: 'Platinum (one troy ounce)', - XSU: 'SUCRE', - XTS: 'Code reserved for testing', - XUA: 'ADB Unit of Account', - XXX: 'No currency', - YER: 'Yemeni rial', - ZAR: 'South African rand', - ZMW: 'Zambian kwacha', - ZWL: 'Zimbabwean dollar' + AED: "United Arab Emirates dirham", + AFN: "Afghan afghani", + ALL: "Albanian lek", + AMD: "Armenian dram", + ANG: "Netherlands Antillean guilder", + AOA: "Angolan kwanza", + ARS: "Argentine peso", + AUD: "Australian dollar", + AWG: "Aruban florin", + AZN: "Azerbaijani manat", + BAM: "Bosnia and Herzegovina convertible mark", + BBD: "Barbados dollar", + BDT: "Bangladeshi taka", + BGN: "Bulgarian lev", + BHD: "Bahraini dinar", + BIF: "Burundian franc", + BMD: "Bermudian dollar", + BND: "Brunei dollar", + BOB: "Boliviano", + BOV: "Bolivian Mvdol (funds code)", + BRL: "Brazilian real", + BSD: "Bahamian dollar", + BTN: "Bhutanese ngultrum", + BWP: "Botswana pula", + BYN: "Belarusian ruble", + BZD: "Belize dollar", + CAD: "Canadian dollar", + CDF: "Congolese franc", + CHE: "WIR euro (complementary currency)", + CHF: "Swiss franc", + CHW: "WIR franc (complementary currency)", + CLF: "Unidad de Fomento (funds code)", + CLP: "Chilean peso", + CNY: "Chinese yuan[8]", + COP: "Colombian peso", + COU: "Unidad de Valor Real (UVR) (funds code)[9]", + CRC: "Costa Rican colon", + CUC: "Cuban convertible peso", + CUP: "Cuban peso", + CVE: "Cape Verdean escudo", + CZK: "Czech koruna", + DJF: "Djiboutian franc", + DKK: "Danish krone", + DOP: "Dominican peso", + DZD: "Algerian dinar", + EGP: "Egyptian pound", + ERN: "Eritrean nakfa", + ETB: "Ethiopian birr", + EUR: "Euro", + FJD: "Fiji dollar", + FKP: "Falkland Islands pound", + GBP: "Pound sterling", + GEL: "Georgian lari", + GHS: "Ghanaian cedi", + GIP: "Gibraltar pound", + GMD: "Gambian dalasi", + GNF: "Guinean franc", + GTQ: "Guatemalan quetzal", + GYD: "Guyanese dollar", + HKD: "Hong Kong dollar", + HNL: "Honduran lempira", + HRK: "Croatian kuna", + HTG: "Haitian gourde", + HUF: "Hungarian forint", + IDR: "Indonesian rupiah", + ILS: "Israeli new shekel", + INR: "Indian rupee", + IQD: "Iraqi dinar", + IRR: "Iranian rial", + ISK: "Icelandic króna (plural: krónur)", + JMD: "Jamaican dollar", + JOD: "Jordanian dinar", + JPY: "Japanese yen", + KES: "Kenyan shilling", + KGS: "Kyrgyzstani som", + KHR: "Cambodian riel", + KMF: "Comoro franc", + KPW: "North Korean won", + KRW: "South Korean won", + KWD: "Kuwaiti dinar", + KYD: "Cayman Islands dollar", + KZT: "Kazakhstani tenge", + LAK: "Lao kip", + LBP: "Lebanese pound", + LKR: "Sri Lankan rupee", + LRD: "Liberian dollar", + LSL: "Lesotho loti", + LYD: "Libyan dinar", + MAD: "Moroccan dirham", + MDL: "Moldovan leu", + MGA: "Malagasy ariary", + MKD: "Macedonian denar", + MMK: "Myanmar kyat", + MNT: "Mongolian tögrög", + MOP: "Macanese pataca", + MRU: "Mauritanian ouguiya", + MUR: "Mauritian rupee", + MVR: "Maldivian rufiyaa", + MWK: "Malawian kwacha", + MXN: "Mexican peso", + MXV: "Mexican Unidad de Inversion (UDI) (funds code)", + MYR: "Malaysian ringgit", + MZN: "Mozambican metical", + NAD: "Namibian dollar", + NGN: "Nigerian naira", + NIO: "Nicaraguan córdoba", + NOK: "Norwegian krone", + NPR: "Nepalese rupee", + NZD: "New Zealand dollar", + OMR: "Omani rial", + PAB: "Panamanian balboa", + PEN: "Peruvian sol", + PGK: "Papua New Guinean kina", + PHP: "Philippine peso[13]", + PKR: "Pakistani rupee", + PLN: "Polish złoty", + PYG: "Paraguayan guaraní", + QAR: "Qatari riyal", + RON: "Romanian leu", + RSD: "Serbian dinar", + RUB: "Russian ruble", + RWF: "Rwandan franc", + SAR: "Saudi riyal", + SBD: "Solomon Islands dollar", + SCR: "Seychelles rupee", + SDG: "Sudanese pound", + SEK: "Swedish krona (plural: kronor)", + SGD: "Singapore dollar", + SHP: "Saint Helena pound", + SLL: "Sierra Leonean leone", + SOS: "Somali shilling", + SRD: "Surinamese dollar", + SSP: "South Sudanese pound", + STN: "São Tomé and Príncipe dobra", + SVC: "Salvadoran colón", + SYP: "Syrian pound", + SZL: "Swazi lilangeni", + THB: "Thai baht", + TJS: "Tajikistani somoni", + TMT: "Turkmenistan manat", + TND: "Tunisian dinar", + TOP: "Tongan paʻanga", + TRY: "Turkish lira", + TTD: "Trinidad and Tobago dollar", + TWD: "New Taiwan dollar", + TZS: "Tanzanian shilling", + UAH: "Ukrainian hryvnia", + UGX: "Ugandan shilling", + USD: "United States dollar", + USN: "United States dollar (next day) (funds code)", + UYI: "Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code)", + UYU: "Uruguayan peso", + UYW: "Unidad previsional[15]", + UZS: "Uzbekistan som", + VED: "Venezuelan bolívar digital[16]", + VES: "Venezuelan bolívar soberano[13]", + VND: "Vietnamese đồng", + VUV: "Vanuatu vatu", + WST: "Samoan tala", + XAF: "CFA franc BEAC", + XAG: "Silver (one troy ounce)", + XAU: "Gold (one troy ounce)", + XBA: "European Composite Unit (EURCO) (bond market unit)", + XBB: "European Monetary Unit (E.M.U.-6) (bond market unit)", + XBC: "European Unit of Account 9 (E.U.A.-9) (bond market unit)", + XBD: "European Unit of Account 17 (E.U.A.-17) (bond market unit)", + XCD: "East Caribbean dollar", + XDR: "Special drawing rights", + XOF: "CFA franc BCEAO", + XPD: "Palladium (one troy ounce)", + XPF: "CFP franc (franc Pacifique)", + XPT: "Platinum (one troy ounce)", + XSU: "SUCRE", + XTS: "Code reserved for testing", + XUA: "ADB Unit of Account", + XXX: "No currency", + YER: "Yemeni rial", + ZAR: "South African rand", + ZMW: "Zambian kwacha", + ZWL: "Zimbabwean dollar" } as const; diff --git a/src/lib/locale-data/locales.ts b/src/lib/locale-data/locales.ts index 32ade35..60aa1b7 100644 --- a/src/lib/locale-data/locales.ts +++ b/src/lib/locale-data/locales.ts @@ -1,440 +1,440 @@ export const languageByLocale = { - 'af-NA': 'Afrikaans (Namibia)', - 'af-ZA': 'Afrikaans (South Africa)', - af: 'Afrikaans', - 'ak-GH': 'Akan (Ghana)', - ak: 'Akan', - 'sq-AL': 'Albanian (Albania)', - sq: 'Albanian', - 'am-ET': 'Amharic (Ethiopia)', - am: 'Amharic', - 'ar-DZ': 'Arabic (Algeria)', - 'ar-BH': 'Arabic (Bahrain)', - 'ar-EG': 'Arabic (Egypt)', - 'ar-IQ': 'Arabic (Iraq)', - 'ar-JO': 'Arabic (Jordan)', - 'ar-KW': 'Arabic (Kuwait)', - 'ar-LB': 'Arabic (Lebanon)', - 'ar-LY': 'Arabic (Libya)', - 'ar-MA': 'Arabic (Morocco)', - 'ar-OM': 'Arabic (Oman)', - 'ar-QA': 'Arabic (Qatar)', - 'ar-SA': 'Arabic (Saudi Arabia)', - 'ar-SD': 'Arabic (Sudan)', - 'ar-SY': 'Arabic (Syria)', - 'ar-TN': 'Arabic (Tunisia)', - 'ar-AE': 'Arabic (United Arab Emirates)', - 'ar-YE': 'Arabic (Yemen)', - ar: 'Arabic', - 'hy-AM': 'Armenian (Armenia)', - hy: 'Armenian', - 'as-IN': 'Assamese (India)', - as: 'Assamese', - 'asa-TZ': 'Asu (Tanzania)', - asa: 'Asu', - 'az-Cyrl': 'Azerbaijani (Cyrillic)', - 'az-Cyrl-AZ': 'Azerbaijani (Cyrillic, Azerbaijan)', - 'az-Latn': 'Azerbaijani (Latin)', - 'az-Latn-AZ': 'Azerbaijani (Latin, Azerbaijan)', - az: 'Azerbaijani', - 'bm-ML': 'Bambara (Mali)', - bm: 'Bambara', - 'eu-ES': 'Basque (Spain)', - eu: 'Basque', - 'be-BY': 'Belarusian (Belarus)', - be: 'Belarusian', - 'bem-ZM': 'Bemba (Zambia)', - bem: 'Bemba', - 'bez-TZ': 'Bena (Tanzania)', - bez: 'Bena', - 'bn-BD': 'Bengali (Bangladesh)', - 'bn-IN': 'Bengali (India)', - bn: 'Bengali', - 'bs-BA': 'Bosnian (Bosnia and Herzegovina)', - bs: 'Bosnian', - 'bg-BG': 'Bulgarian (Bulgaria)', - bg: 'Bulgarian', - 'my-MM': 'Burmese (Myanmar [Burma])', - my: 'Burmese', - 'yue-Hant-HK': 'Cantonese (Traditional, Hong Kong SAR China)', - 'ca-ES': 'Catalan (Spain)', - ca: 'Catalan', - 'tzm-Latn': 'Central Morocco Tamazight (Latin)', - 'tzm-Latn-MA': 'Central Morocco Tamazight (Latin, Morocco)', - tzm: 'Central Morocco Tamazight', - 'chr-US': 'Cherokee (United States)', - chr: 'Cherokee', - 'cgg-UG': 'Chiga (Uganda)', - cgg: 'Chiga', - 'zh-Hans': 'Chinese (Simplified Han)', - 'zh-Hans-CN': 'Chinese (Simplified Han, China)', - 'zh-Hans-HK': 'Chinese (Simplified Han, Hong Kong SAR China)', - 'zh-Hans-MO': 'Chinese (Simplified Han, Macau SAR China)', - 'zh-Hans-SG': 'Chinese (Simplified Han, Singapore)', - 'zh-Hant': 'Chinese (Traditional Han)', - 'zh-Hant-HK': 'Chinese (Traditional Han, Hong Kong SAR China)', - 'zh-Hant-MO': 'Chinese (Traditional Han, Macau SAR China)', - 'zh-Hant-TW': 'Chinese (Traditional Han, Taiwan)', - zh: 'Chinese', - 'kw-GB': 'Cornish (United Kingdom)', - kw: 'Cornish', - 'hr-HR': 'Croatian (Croatia)', - hr: 'Croatian', - 'cs-CZ': 'Czech (Czech Republic)', - cs: 'Czech', - 'da-DK': 'Danish (Denmark)', - da: 'Danish', - 'nl-BE': 'Dutch (Belgium)', - 'nl-NL': 'Dutch (Netherlands)', - nl: 'Dutch', - 'ebu-KE': 'Embu (Kenya)', - ebu: 'Embu', - 'en-AS': 'English (American Samoa)', - 'en-AU': 'English (Australia)', - 'en-BE': 'English (Belgium)', - 'en-BZ': 'English (Belize)', - 'en-BW': 'English (Botswana)', - 'en-CA': 'English (Canada)', - 'en-GU': 'English (Guam)', - 'en-HK': 'English (Hong Kong SAR China)', - 'en-IN': 'English (India)', - 'en-IE': 'English (Ireland)', - 'en-IL': 'English (Israel)', - 'en-JM': 'English (Jamaica)', - 'en-MT': 'English (Malta)', - 'en-MH': 'English (Marshall Islands)', - 'en-MU': 'English (Mauritius)', - 'en-NA': 'English (Namibia)', - 'en-NZ': 'English (New Zealand)', - 'en-MP': 'English (Northern Mariana Islands)', - 'en-PK': 'English (Pakistan)', - 'en-PH': 'English (Philippines)', - 'en-SG': 'English (Singapore)', - 'en-ZA': 'English (South Africa)', - 'en-TT': 'English (Trinidad and Tobago)', - 'en-UM': 'English (U.S. Minor Outlying Islands)', - 'en-VI': 'English (U.S. Virgin Islands)', - 'en-GB': 'English (United Kingdom)', - 'en-US': 'English (United States)', - 'en-ZW': 'English (Zimbabwe)', - en: 'English', - eo: 'Esperanto', - 'et-EE': 'Estonian (Estonia)', - et: 'Estonian', - 'ee-GH': 'Ewe (Ghana)', - 'ee-TG': 'Ewe (Togo)', - ee: 'Ewe', - 'fo-FO': 'Faroese (Faroe Islands)', - fo: 'Faroese', - 'fil-PH': 'Filipino (Philippines)', - fil: 'Filipino', - 'fi-FI': 'Finnish (Finland)', - fi: 'Finnish', - 'fr-BE': 'French (Belgium)', - 'fr-BJ': 'French (Benin)', - 'fr-BF': 'French (Burkina Faso)', - 'fr-BI': 'French (Burundi)', - 'fr-CM': 'French (Cameroon)', - 'fr-CA': 'French (Canada)', - 'fr-CF': 'French (Central African Republic)', - 'fr-TD': 'French (Chad)', - 'fr-KM': 'French (Comoros)', - 'fr-CG': 'French (Congo - Brazzaville)', - 'fr-CD': 'French (Congo - Kinshasa)', - 'fr-CI': 'French (Côte d’Ivoire)', - 'fr-DJ': 'French (Djibouti)', - 'fr-GQ': 'French (Equatorial Guinea)', - 'fr-FR': 'French (France)', - 'fr-GA': 'French (Gabon)', - 'fr-GP': 'French (Guadeloupe)', - 'fr-GN': 'French (Guinea)', - 'fr-LU': 'French (Luxembourg)', - 'fr-MG': 'French (Madagascar)', - 'fr-ML': 'French (Mali)', - 'fr-MQ': 'French (Martinique)', - 'fr-MC': 'French (Monaco)', - 'fr-NE': 'French (Niger)', - 'fr-RW': 'French (Rwanda)', - 'fr-RE': 'French (Réunion)', - 'fr-BL': 'French (Saint Barthélemy)', - 'fr-MF': 'French (Saint Martin)', - 'fr-SN': 'French (Senegal)', - 'fr-CH': 'French (Switzerland)', - 'fr-TG': 'French (Togo)', - fr: 'French', - 'ff-SN': 'Fulah (Senegal)', - ff: 'Fulah', - 'gl-ES': 'Galician (Spain)', - gl: 'Galician', - 'lg-UG': 'Ganda (Uganda)', - lg: 'Ganda', - 'ka-GE': 'Georgian (Georgia)', - ka: 'Georgian', - 'de-AT': 'German (Austria)', - 'de-BE': 'German (Belgium)', - 'de-DE': 'German (Germany)', - 'de-LI': 'German (Liechtenstein)', - 'de-LU': 'German (Luxembourg)', - 'de-CH': 'German (Switzerland)', - de: 'German', - 'el-CY': 'Greek (Cyprus)', - 'el-GR': 'Greek (Greece)', - el: 'Greek', - 'gu-IN': 'Gujarati (India)', - gu: 'Gujarati', - 'guz-KE': 'Gusii (Kenya)', - guz: 'Gusii', - 'ha-Latn': 'Hausa (Latin)', - 'ha-Latn-GH': 'Hausa (Latin, Ghana)', - 'ha-Latn-NE': 'Hausa (Latin, Niger)', - 'ha-Latn-NG': 'Hausa (Latin, Nigeria)', - ha: 'Hausa', - 'haw-US': 'Hawaiian (United States)', - haw: 'Hawaiian', - 'he-IL': 'Hebrew (Israel)', - he: 'Hebrew', - 'hi-IN': 'Hindi (India)', - hi: 'Hindi', - 'hu-HU': 'Hungarian (Hungary)', - hu: 'Hungarian', - 'is-IS': 'Icelandic (Iceland)', - is: 'Icelandic', - 'ig-NG': 'Igbo (Nigeria)', - ig: 'Igbo', - 'id-ID': 'Indonesian (Indonesia)', - id: 'Indonesian', - 'ga-IE': 'Irish (Ireland)', - ga: 'Irish', - 'it-IT': 'Italian (Italy)', - 'it-CH': 'Italian (Switzerland)', - it: 'Italian', - 'ja-JP': 'Japanese (Japan)', - ja: 'Japanese', - 'kea-CV': 'Kabuverdianu (Cape Verde)', - kea: 'Kabuverdianu', - 'kab-DZ': 'Kabyle (Algeria)', - kab: 'Kabyle', - 'kl-GL': 'Kalaallisut (Greenland)', - kl: 'Kalaallisut', - 'kln-KE': 'Kalenjin (Kenya)', - kln: 'Kalenjin', - 'kam-KE': 'Kamba (Kenya)', - kam: 'Kamba', - 'kn-IN': 'Kannada (India)', - kn: 'Kannada', - 'kk-Cyrl': 'Kazakh (Cyrillic)', - 'kk-Cyrl-KZ': 'Kazakh (Cyrillic, Kazakhstan)', - kk: 'Kazakh', - 'km-KH': 'Khmer (Cambodia)', - km: 'Khmer', - 'ki-KE': 'Kikuyu (Kenya)', - ki: 'Kikuyu', - 'rw-RW': 'Kinyarwanda (Rwanda)', - rw: 'Kinyarwanda', - 'kok-IN': 'Konkani (India)', - kok: 'Konkani', - 'ko-KR': 'Korean (South Korea)', - ko: 'Korean', - 'khq-ML': 'Koyra Chiini (Mali)', - khq: 'Koyra Chiini', - 'ses-ML': 'Koyraboro Senni (Mali)', - ses: 'Koyraboro Senni', - 'lag-TZ': 'Langi (Tanzania)', - lag: 'Langi', - 'lv-LV': 'Latvian (Latvia)', - lv: 'Latvian', - 'lt-LT': 'Lithuanian (Lithuania)', - lt: 'Lithuanian', - 'luo-KE': 'Luo (Kenya)', - luo: 'Luo', - 'luy-KE': 'Luyia (Kenya)', - luy: 'Luyia', - 'mk-MK': 'Macedonian (Macedonia)', - mk: 'Macedonian', - 'jmc-TZ': 'Machame (Tanzania)', - jmc: 'Machame', - 'kde-TZ': 'Makonde (Tanzania)', - kde: 'Makonde', - 'mg-MG': 'Malagasy (Madagascar)', - mg: 'Malagasy', - 'ms-BN': 'Malay (Brunei)', - 'ms-MY': 'Malay (Malaysia)', - ms: 'Malay', - 'ml-IN': 'Malayalam (India)', - ml: 'Malayalam', - 'mt-MT': 'Maltese (Malta)', - mt: 'Maltese', - 'gv-GB': 'Manx (United Kingdom)', - gv: 'Manx', - 'mr-IN': 'Marathi (India)', - mr: 'Marathi', - 'mas-KE': 'Masai (Kenya)', - 'mas-TZ': 'Masai (Tanzania)', - mas: 'Masai', - 'mer-KE': 'Meru (Kenya)', - mer: 'Meru', - 'mfe-MU': 'Morisyen (Mauritius)', - mfe: 'Morisyen', - 'naq-NA': 'Nama (Namibia)', - naq: 'Nama', - 'ne-IN': 'Nepali (India)', - 'ne-NP': 'Nepali (Nepal)', - ne: 'Nepali', - 'nd-ZW': 'North Ndebele (Zimbabwe)', - nd: 'North Ndebele', - 'nb-NO': 'Norwegian Bokmål (Norway)', - nb: 'Norwegian Bokmål', - 'nn-NO': 'Norwegian Nynorsk (Norway)', - nn: 'Norwegian Nynorsk', - 'nyn-UG': 'Nyankole (Uganda)', - nyn: 'Nyankole', - 'or-IN': 'Oriya (India)', - or: 'Oriya', - 'om-ET': 'Oromo (Ethiopia)', - 'om-KE': 'Oromo (Kenya)', - om: 'Oromo', - 'ps-AF': 'Pashto (Afghanistan)', - ps: 'Pashto', - 'fa-AF': 'Persian (Afghanistan)', - 'fa-IR': 'Persian (Iran)', - fa: 'Persian', - 'pl-PL': 'Polish (Poland)', - pl: 'Polish', - 'pt-BR': 'Portuguese (Brazil)', - 'pt-GW': 'Portuguese (Guinea-Bissau)', - 'pt-MZ': 'Portuguese (Mozambique)', - 'pt-PT': 'Portuguese (Portugal)', - pt: 'Portuguese', - 'pa-Arab': 'Punjabi (Arabic)', - 'pa-Arab-PK': 'Punjabi (Arabic, Pakistan)', - 'pa-Guru': 'Punjabi (Gurmukhi)', - 'pa-Guru-IN': 'Punjabi (Gurmukhi, India)', - pa: 'Punjabi', - 'ro-MD': 'Romanian (Moldova)', - 'ro-RO': 'Romanian (Romania)', - ro: 'Romanian', - 'rm-CH': 'Romansh (Switzerland)', - rm: 'Romansh', - 'rof-TZ': 'Rombo (Tanzania)', - rof: 'Rombo', - 'ru-MD': 'Russian (Moldova)', - 'ru-RU': 'Russian (Russia)', - 'ru-UA': 'Russian (Ukraine)', - ru: 'Russian', - 'rwk-TZ': 'Rwa (Tanzania)', - rwk: 'Rwa', - 'saq-KE': 'Samburu (Kenya)', - saq: 'Samburu', - 'sg-CF': 'Sango (Central African Republic)', - sg: 'Sango', - 'seh-MZ': 'Sena (Mozambique)', - seh: 'Sena', - 'sr-Cyrl': 'Serbian (Cyrillic)', - 'sr-Cyrl-BA': 'Serbian (Cyrillic, Bosnia and Herzegovina)', - 'sr-Cyrl-ME': 'Serbian (Cyrillic, Montenegro)', - 'sr-Cyrl-RS': 'Serbian (Cyrillic, Serbia)', - 'sr-Latn': 'Serbian (Latin)', - 'sr-Latn-BA': 'Serbian (Latin, Bosnia and Herzegovina)', - 'sr-Latn-ME': 'Serbian (Latin, Montenegro)', - 'sr-Latn-RS': 'Serbian (Latin, Serbia)', - sr: 'Serbian', - 'sn-ZW': 'Shona (Zimbabwe)', - sn: 'Shona', - 'ii-CN': 'Sichuan Yi (China)', - ii: 'Sichuan Yi', - 'si-LK': 'Sinhala (Sri Lanka)', - si: 'Sinhala', - 'sk-SK': 'Slovak (Slovakia)', - sk: 'Slovak', - 'sl-SI': 'Slovenian (Slovenia)', - sl: 'Slovenian', - 'xog-UG': 'Soga (Uganda)', - xog: 'Soga', - 'so-DJ': 'Somali (Djibouti)', - 'so-ET': 'Somali (Ethiopia)', - 'so-KE': 'Somali (Kenya)', - 'so-SO': 'Somali (Somalia)', - so: 'Somali', - 'es-AR': 'Spanish (Argentina)', - 'es-BO': 'Spanish (Bolivia)', - 'es-CL': 'Spanish (Chile)', - 'es-CO': 'Spanish (Colombia)', - 'es-CR': 'Spanish (Costa Rica)', - 'es-DO': 'Spanish (Dominican Republic)', - 'es-EC': 'Spanish (Ecuador)', - 'es-SV': 'Spanish (El Salvador)', - 'es-GQ': 'Spanish (Equatorial Guinea)', - 'es-GT': 'Spanish (Guatemala)', - 'es-HN': 'Spanish (Honduras)', - 'es-419': 'Spanish (Latin America)', - 'es-MX': 'Spanish (Mexico)', - 'es-NI': 'Spanish (Nicaragua)', - 'es-PA': 'Spanish (Panama)', - 'es-PY': 'Spanish (Paraguay)', - 'es-PE': 'Spanish (Peru)', - 'es-PR': 'Spanish (Puerto Rico)', - 'es-ES': 'Spanish (Spain)', - 'es-US': 'Spanish (United States)', - 'es-UY': 'Spanish (Uruguay)', - 'es-VE': 'Spanish (Venezuela)', - es: 'Spanish', - 'sw-KE': 'Swahili (Kenya)', - 'sw-TZ': 'Swahili (Tanzania)', - sw: 'Swahili', - 'sv-FI': 'Swedish (Finland)', - 'sv-SE': 'Swedish (Sweden)', - sv: 'Swedish', - 'gsw-CH': 'Swiss German (Switzerland)', - gsw: 'Swiss German', - 'shi-Latn': 'Tachelhit (Latin)', - 'shi-Latn-MA': 'Tachelhit (Latin, Morocco)', - 'shi-Tfng': 'Tachelhit (Tifinagh)', - 'shi-Tfng-MA': 'Tachelhit (Tifinagh, Morocco)', - shi: 'Tachelhit', - 'dav-KE': 'Taita (Kenya)', - dav: 'Taita', - 'ta-IN': 'Tamil (India)', - 'ta-LK': 'Tamil (Sri Lanka)', - ta: 'Tamil', - 'te-IN': 'Telugu (India)', - te: 'Telugu', - 'teo-KE': 'Teso (Kenya)', - 'teo-UG': 'Teso (Uganda)', - teo: 'Teso', - 'th-TH': 'Thai (Thailand)', - th: 'Thai', - 'bo-CN': 'Tibetan (China)', - 'bo-IN': 'Tibetan (India)', - bo: 'Tibetan', - 'ti-ER': 'Tigrinya (Eritrea)', - 'ti-ET': 'Tigrinya (Ethiopia)', - ti: 'Tigrinya', - 'to-TO': 'Tonga (Tonga)', - to: 'Tonga', - 'tr-TR': 'Turkish (Turkey)', - tr: 'Turkish', - 'uk-UA': 'Ukrainian (Ukraine)', - uk: 'Ukrainian', - 'ur-IN': 'Urdu (India)', - 'ur-PK': 'Urdu (Pakistan)', - ur: 'Urdu', - 'uz-Arab': 'Uzbek (Arabic)', - 'uz-Arab-AF': 'Uzbek (Arabic, Afghanistan)', - 'uz-Cyrl': 'Uzbek (Cyrillic)', - 'uz-Cyrl-UZ': 'Uzbek (Cyrillic, Uzbekistan)', - 'uz-Latn': 'Uzbek (Latin)', - 'uz-Latn-UZ': 'Uzbek (Latin, Uzbekistan)', - uz: 'Uzbek', - 'vi-VN': 'Vietnamese (Vietnam)', - vi: 'Vietnamese', - 'vun-TZ': 'Vunjo (Tanzania)', - vun: 'Vunjo', - 'cy-GB': 'Welsh (United Kingdom)', - cy: 'Welsh', - 'yo-NG': 'Yoruba (Nigeria)', - yo: 'Yoruba', - 'zu-ZA': 'Zulu (South Africa)', - zu: 'Zulu' + "af-NA": "Afrikaans (Namibia)", + "af-ZA": "Afrikaans (South Africa)", + af: "Afrikaans", + "ak-GH": "Akan (Ghana)", + ak: "Akan", + "sq-AL": "Albanian (Albania)", + sq: "Albanian", + "am-ET": "Amharic (Ethiopia)", + am: "Amharic", + "ar-DZ": "Arabic (Algeria)", + "ar-BH": "Arabic (Bahrain)", + "ar-EG": "Arabic (Egypt)", + "ar-IQ": "Arabic (Iraq)", + "ar-JO": "Arabic (Jordan)", + "ar-KW": "Arabic (Kuwait)", + "ar-LB": "Arabic (Lebanon)", + "ar-LY": "Arabic (Libya)", + "ar-MA": "Arabic (Morocco)", + "ar-OM": "Arabic (Oman)", + "ar-QA": "Arabic (Qatar)", + "ar-SA": "Arabic (Saudi Arabia)", + "ar-SD": "Arabic (Sudan)", + "ar-SY": "Arabic (Syria)", + "ar-TN": "Arabic (Tunisia)", + "ar-AE": "Arabic (United Arab Emirates)", + "ar-YE": "Arabic (Yemen)", + ar: "Arabic", + "hy-AM": "Armenian (Armenia)", + hy: "Armenian", + "as-IN": "Assamese (India)", + as: "Assamese", + "asa-TZ": "Asu (Tanzania)", + asa: "Asu", + "az-Cyrl": "Azerbaijani (Cyrillic)", + "az-Cyrl-AZ": "Azerbaijani (Cyrillic, Azerbaijan)", + "az-Latn": "Azerbaijani (Latin)", + "az-Latn-AZ": "Azerbaijani (Latin, Azerbaijan)", + az: "Azerbaijani", + "bm-ML": "Bambara (Mali)", + bm: "Bambara", + "eu-ES": "Basque (Spain)", + eu: "Basque", + "be-BY": "Belarusian (Belarus)", + be: "Belarusian", + "bem-ZM": "Bemba (Zambia)", + bem: "Bemba", + "bez-TZ": "Bena (Tanzania)", + bez: "Bena", + "bn-BD": "Bengali (Bangladesh)", + "bn-IN": "Bengali (India)", + bn: "Bengali", + "bs-BA": "Bosnian (Bosnia and Herzegovina)", + bs: "Bosnian", + "bg-BG": "Bulgarian (Bulgaria)", + bg: "Bulgarian", + "my-MM": "Burmese (Myanmar [Burma])", + my: "Burmese", + "yue-Hant-HK": "Cantonese (Traditional, Hong Kong SAR China)", + "ca-ES": "Catalan (Spain)", + ca: "Catalan", + "tzm-Latn": "Central Morocco Tamazight (Latin)", + "tzm-Latn-MA": "Central Morocco Tamazight (Latin, Morocco)", + tzm: "Central Morocco Tamazight", + "chr-US": "Cherokee (United States)", + chr: "Cherokee", + "cgg-UG": "Chiga (Uganda)", + cgg: "Chiga", + "zh-Hans": "Chinese (Simplified Han)", + "zh-Hans-CN": "Chinese (Simplified Han, China)", + "zh-Hans-HK": "Chinese (Simplified Han, Hong Kong SAR China)", + "zh-Hans-MO": "Chinese (Simplified Han, Macau SAR China)", + "zh-Hans-SG": "Chinese (Simplified Han, Singapore)", + "zh-Hant": "Chinese (Traditional Han)", + "zh-Hant-HK": "Chinese (Traditional Han, Hong Kong SAR China)", + "zh-Hant-MO": "Chinese (Traditional Han, Macau SAR China)", + "zh-Hant-TW": "Chinese (Traditional Han, Taiwan)", + zh: "Chinese", + "kw-GB": "Cornish (United Kingdom)", + kw: "Cornish", + "hr-HR": "Croatian (Croatia)", + hr: "Croatian", + "cs-CZ": "Czech (Czech Republic)", + cs: "Czech", + "da-DK": "Danish (Denmark)", + da: "Danish", + "nl-BE": "Dutch (Belgium)", + "nl-NL": "Dutch (Netherlands)", + nl: "Dutch", + "ebu-KE": "Embu (Kenya)", + ebu: "Embu", + "en-AS": "English (American Samoa)", + "en-AU": "English (Australia)", + "en-BE": "English (Belgium)", + "en-BZ": "English (Belize)", + "en-BW": "English (Botswana)", + "en-CA": "English (Canada)", + "en-GU": "English (Guam)", + "en-HK": "English (Hong Kong SAR China)", + "en-IN": "English (India)", + "en-IE": "English (Ireland)", + "en-IL": "English (Israel)", + "en-JM": "English (Jamaica)", + "en-MT": "English (Malta)", + "en-MH": "English (Marshall Islands)", + "en-MU": "English (Mauritius)", + "en-NA": "English (Namibia)", + "en-NZ": "English (New Zealand)", + "en-MP": "English (Northern Mariana Islands)", + "en-PK": "English (Pakistan)", + "en-PH": "English (Philippines)", + "en-SG": "English (Singapore)", + "en-ZA": "English (South Africa)", + "en-TT": "English (Trinidad and Tobago)", + "en-UM": "English (U.S. Minor Outlying Islands)", + "en-VI": "English (U.S. Virgin Islands)", + "en-GB": "English (United Kingdom)", + "en-US": "English (United States)", + "en-ZW": "English (Zimbabwe)", + en: "English", + eo: "Esperanto", + "et-EE": "Estonian (Estonia)", + et: "Estonian", + "ee-GH": "Ewe (Ghana)", + "ee-TG": "Ewe (Togo)", + ee: "Ewe", + "fo-FO": "Faroese (Faroe Islands)", + fo: "Faroese", + "fil-PH": "Filipino (Philippines)", + fil: "Filipino", + "fi-FI": "Finnish (Finland)", + fi: "Finnish", + "fr-BE": "French (Belgium)", + "fr-BJ": "French (Benin)", + "fr-BF": "French (Burkina Faso)", + "fr-BI": "French (Burundi)", + "fr-CM": "French (Cameroon)", + "fr-CA": "French (Canada)", + "fr-CF": "French (Central African Republic)", + "fr-TD": "French (Chad)", + "fr-KM": "French (Comoros)", + "fr-CG": "French (Congo - Brazzaville)", + "fr-CD": "French (Congo - Kinshasa)", + "fr-CI": "French (Côte d’Ivoire)", + "fr-DJ": "French (Djibouti)", + "fr-GQ": "French (Equatorial Guinea)", + "fr-FR": "French (France)", + "fr-GA": "French (Gabon)", + "fr-GP": "French (Guadeloupe)", + "fr-GN": "French (Guinea)", + "fr-LU": "French (Luxembourg)", + "fr-MG": "French (Madagascar)", + "fr-ML": "French (Mali)", + "fr-MQ": "French (Martinique)", + "fr-MC": "French (Monaco)", + "fr-NE": "French (Niger)", + "fr-RW": "French (Rwanda)", + "fr-RE": "French (Réunion)", + "fr-BL": "French (Saint Barthélemy)", + "fr-MF": "French (Saint Martin)", + "fr-SN": "French (Senegal)", + "fr-CH": "French (Switzerland)", + "fr-TG": "French (Togo)", + fr: "French", + "ff-SN": "Fulah (Senegal)", + ff: "Fulah", + "gl-ES": "Galician (Spain)", + gl: "Galician", + "lg-UG": "Ganda (Uganda)", + lg: "Ganda", + "ka-GE": "Georgian (Georgia)", + ka: "Georgian", + "de-AT": "German (Austria)", + "de-BE": "German (Belgium)", + "de-DE": "German (Germany)", + "de-LI": "German (Liechtenstein)", + "de-LU": "German (Luxembourg)", + "de-CH": "German (Switzerland)", + de: "German", + "el-CY": "Greek (Cyprus)", + "el-GR": "Greek (Greece)", + el: "Greek", + "gu-IN": "Gujarati (India)", + gu: "Gujarati", + "guz-KE": "Gusii (Kenya)", + guz: "Gusii", + "ha-Latn": "Hausa (Latin)", + "ha-Latn-GH": "Hausa (Latin, Ghana)", + "ha-Latn-NE": "Hausa (Latin, Niger)", + "ha-Latn-NG": "Hausa (Latin, Nigeria)", + ha: "Hausa", + "haw-US": "Hawaiian (United States)", + haw: "Hawaiian", + "he-IL": "Hebrew (Israel)", + he: "Hebrew", + "hi-IN": "Hindi (India)", + hi: "Hindi", + "hu-HU": "Hungarian (Hungary)", + hu: "Hungarian", + "is-IS": "Icelandic (Iceland)", + is: "Icelandic", + "ig-NG": "Igbo (Nigeria)", + ig: "Igbo", + "id-ID": "Indonesian (Indonesia)", + id: "Indonesian", + "ga-IE": "Irish (Ireland)", + ga: "Irish", + "it-IT": "Italian (Italy)", + "it-CH": "Italian (Switzerland)", + it: "Italian", + "ja-JP": "Japanese (Japan)", + ja: "Japanese", + "kea-CV": "Kabuverdianu (Cape Verde)", + kea: "Kabuverdianu", + "kab-DZ": "Kabyle (Algeria)", + kab: "Kabyle", + "kl-GL": "Kalaallisut (Greenland)", + kl: "Kalaallisut", + "kln-KE": "Kalenjin (Kenya)", + kln: "Kalenjin", + "kam-KE": "Kamba (Kenya)", + kam: "Kamba", + "kn-IN": "Kannada (India)", + kn: "Kannada", + "kk-Cyrl": "Kazakh (Cyrillic)", + "kk-Cyrl-KZ": "Kazakh (Cyrillic, Kazakhstan)", + kk: "Kazakh", + "km-KH": "Khmer (Cambodia)", + km: "Khmer", + "ki-KE": "Kikuyu (Kenya)", + ki: "Kikuyu", + "rw-RW": "Kinyarwanda (Rwanda)", + rw: "Kinyarwanda", + "kok-IN": "Konkani (India)", + kok: "Konkani", + "ko-KR": "Korean (South Korea)", + ko: "Korean", + "khq-ML": "Koyra Chiini (Mali)", + khq: "Koyra Chiini", + "ses-ML": "Koyraboro Senni (Mali)", + ses: "Koyraboro Senni", + "lag-TZ": "Langi (Tanzania)", + lag: "Langi", + "lv-LV": "Latvian (Latvia)", + lv: "Latvian", + "lt-LT": "Lithuanian (Lithuania)", + lt: "Lithuanian", + "luo-KE": "Luo (Kenya)", + luo: "Luo", + "luy-KE": "Luyia (Kenya)", + luy: "Luyia", + "mk-MK": "Macedonian (Macedonia)", + mk: "Macedonian", + "jmc-TZ": "Machame (Tanzania)", + jmc: "Machame", + "kde-TZ": "Makonde (Tanzania)", + kde: "Makonde", + "mg-MG": "Malagasy (Madagascar)", + mg: "Malagasy", + "ms-BN": "Malay (Brunei)", + "ms-MY": "Malay (Malaysia)", + ms: "Malay", + "ml-IN": "Malayalam (India)", + ml: "Malayalam", + "mt-MT": "Maltese (Malta)", + mt: "Maltese", + "gv-GB": "Manx (United Kingdom)", + gv: "Manx", + "mr-IN": "Marathi (India)", + mr: "Marathi", + "mas-KE": "Masai (Kenya)", + "mas-TZ": "Masai (Tanzania)", + mas: "Masai", + "mer-KE": "Meru (Kenya)", + mer: "Meru", + "mfe-MU": "Morisyen (Mauritius)", + mfe: "Morisyen", + "naq-NA": "Nama (Namibia)", + naq: "Nama", + "ne-IN": "Nepali (India)", + "ne-NP": "Nepali (Nepal)", + ne: "Nepali", + "nd-ZW": "North Ndebele (Zimbabwe)", + nd: "North Ndebele", + "nb-NO": "Norwegian Bokmål (Norway)", + nb: "Norwegian Bokmål", + "nn-NO": "Norwegian Nynorsk (Norway)", + nn: "Norwegian Nynorsk", + "nyn-UG": "Nyankole (Uganda)", + nyn: "Nyankole", + "or-IN": "Oriya (India)", + or: "Oriya", + "om-ET": "Oromo (Ethiopia)", + "om-KE": "Oromo (Kenya)", + om: "Oromo", + "ps-AF": "Pashto (Afghanistan)", + ps: "Pashto", + "fa-AF": "Persian (Afghanistan)", + "fa-IR": "Persian (Iran)", + fa: "Persian", + "pl-PL": "Polish (Poland)", + pl: "Polish", + "pt-BR": "Portuguese (Brazil)", + "pt-GW": "Portuguese (Guinea-Bissau)", + "pt-MZ": "Portuguese (Mozambique)", + "pt-PT": "Portuguese (Portugal)", + pt: "Portuguese", + "pa-Arab": "Punjabi (Arabic)", + "pa-Arab-PK": "Punjabi (Arabic, Pakistan)", + "pa-Guru": "Punjabi (Gurmukhi)", + "pa-Guru-IN": "Punjabi (Gurmukhi, India)", + pa: "Punjabi", + "ro-MD": "Romanian (Moldova)", + "ro-RO": "Romanian (Romania)", + ro: "Romanian", + "rm-CH": "Romansh (Switzerland)", + rm: "Romansh", + "rof-TZ": "Rombo (Tanzania)", + rof: "Rombo", + "ru-MD": "Russian (Moldova)", + "ru-RU": "Russian (Russia)", + "ru-UA": "Russian (Ukraine)", + ru: "Russian", + "rwk-TZ": "Rwa (Tanzania)", + rwk: "Rwa", + "saq-KE": "Samburu (Kenya)", + saq: "Samburu", + "sg-CF": "Sango (Central African Republic)", + sg: "Sango", + "seh-MZ": "Sena (Mozambique)", + seh: "Sena", + "sr-Cyrl": "Serbian (Cyrillic)", + "sr-Cyrl-BA": "Serbian (Cyrillic, Bosnia and Herzegovina)", + "sr-Cyrl-ME": "Serbian (Cyrillic, Montenegro)", + "sr-Cyrl-RS": "Serbian (Cyrillic, Serbia)", + "sr-Latn": "Serbian (Latin)", + "sr-Latn-BA": "Serbian (Latin, Bosnia and Herzegovina)", + "sr-Latn-ME": "Serbian (Latin, Montenegro)", + "sr-Latn-RS": "Serbian (Latin, Serbia)", + sr: "Serbian", + "sn-ZW": "Shona (Zimbabwe)", + sn: "Shona", + "ii-CN": "Sichuan Yi (China)", + ii: "Sichuan Yi", + "si-LK": "Sinhala (Sri Lanka)", + si: "Sinhala", + "sk-SK": "Slovak (Slovakia)", + sk: "Slovak", + "sl-SI": "Slovenian (Slovenia)", + sl: "Slovenian", + "xog-UG": "Soga (Uganda)", + xog: "Soga", + "so-DJ": "Somali (Djibouti)", + "so-ET": "Somali (Ethiopia)", + "so-KE": "Somali (Kenya)", + "so-SO": "Somali (Somalia)", + so: "Somali", + "es-AR": "Spanish (Argentina)", + "es-BO": "Spanish (Bolivia)", + "es-CL": "Spanish (Chile)", + "es-CO": "Spanish (Colombia)", + "es-CR": "Spanish (Costa Rica)", + "es-DO": "Spanish (Dominican Republic)", + "es-EC": "Spanish (Ecuador)", + "es-SV": "Spanish (El Salvador)", + "es-GQ": "Spanish (Equatorial Guinea)", + "es-GT": "Spanish (Guatemala)", + "es-HN": "Spanish (Honduras)", + "es-419": "Spanish (Latin America)", + "es-MX": "Spanish (Mexico)", + "es-NI": "Spanish (Nicaragua)", + "es-PA": "Spanish (Panama)", + "es-PY": "Spanish (Paraguay)", + "es-PE": "Spanish (Peru)", + "es-PR": "Spanish (Puerto Rico)", + "es-ES": "Spanish (Spain)", + "es-US": "Spanish (United States)", + "es-UY": "Spanish (Uruguay)", + "es-VE": "Spanish (Venezuela)", + es: "Spanish", + "sw-KE": "Swahili (Kenya)", + "sw-TZ": "Swahili (Tanzania)", + sw: "Swahili", + "sv-FI": "Swedish (Finland)", + "sv-SE": "Swedish (Sweden)", + sv: "Swedish", + "gsw-CH": "Swiss German (Switzerland)", + gsw: "Swiss German", + "shi-Latn": "Tachelhit (Latin)", + "shi-Latn-MA": "Tachelhit (Latin, Morocco)", + "shi-Tfng": "Tachelhit (Tifinagh)", + "shi-Tfng-MA": "Tachelhit (Tifinagh, Morocco)", + shi: "Tachelhit", + "dav-KE": "Taita (Kenya)", + dav: "Taita", + "ta-IN": "Tamil (India)", + "ta-LK": "Tamil (Sri Lanka)", + ta: "Tamil", + "te-IN": "Telugu (India)", + te: "Telugu", + "teo-KE": "Teso (Kenya)", + "teo-UG": "Teso (Uganda)", + teo: "Teso", + "th-TH": "Thai (Thailand)", + th: "Thai", + "bo-CN": "Tibetan (China)", + "bo-IN": "Tibetan (India)", + bo: "Tibetan", + "ti-ER": "Tigrinya (Eritrea)", + "ti-ET": "Tigrinya (Ethiopia)", + ti: "Tigrinya", + "to-TO": "Tonga (Tonga)", + to: "Tonga", + "tr-TR": "Turkish (Turkey)", + tr: "Turkish", + "uk-UA": "Ukrainian (Ukraine)", + uk: "Ukrainian", + "ur-IN": "Urdu (India)", + "ur-PK": "Urdu (Pakistan)", + ur: "Urdu", + "uz-Arab": "Uzbek (Arabic)", + "uz-Arab-AF": "Uzbek (Arabic, Afghanistan)", + "uz-Cyrl": "Uzbek (Cyrillic)", + "uz-Cyrl-UZ": "Uzbek (Cyrillic, Uzbekistan)", + "uz-Latn": "Uzbek (Latin)", + "uz-Latn-UZ": "Uzbek (Latin, Uzbekistan)", + uz: "Uzbek", + "vi-VN": "Vietnamese (Vietnam)", + vi: "Vietnamese", + "vun-TZ": "Vunjo (Tanzania)", + vun: "Vunjo", + "cy-GB": "Welsh (United Kingdom)", + cy: "Welsh", + "yo-NG": "Yoruba (Nigeria)", + yo: "Yoruba", + "zu-ZA": "Zulu (South Africa)", + zu: "Zulu" } as const; export const languageByLocaleAsComboBoxOptions = Object.entries(languageByLocale).map( diff --git a/src/lib/locale-data/units.ts b/src/lib/locale-data/units.ts index cabe480..b2c9835 100644 --- a/src/lib/locale-data/units.ts +++ b/src/lib/locale-data/units.ts @@ -1,47 +1,47 @@ export const units = [ - 'acre', - 'bit', - 'byte', - 'celsius', - 'centimeter', - 'day', - 'degree', - 'fahrenheit', - 'fluid-ounce', - 'foot', - 'gallon', - 'gigabit', - 'gigabyte', - 'gram', - 'hectare', - 'hour', - 'inch', - 'kilobit', - 'kilobyte', - 'kilogram', - 'kilometer', - 'liter', - 'megabit', - 'megabyte', - 'meter', - 'mile', - 'mile-scandinavian', - 'milliliter', - 'millimeter', - 'millisecond', - 'minute', - 'month', - 'ounce', - 'percent', - 'petabyte', - 'pound', - 'second', - 'stone', - 'terabit', - 'terabyte', - 'week', - 'yard', - 'year' + "acre", + "bit", + "byte", + "celsius", + "centimeter", + "day", + "degree", + "fahrenheit", + "fluid-ounce", + "foot", + "gallon", + "gigabit", + "gigabyte", + "gram", + "hectare", + "hour", + "inch", + "kilobit", + "kilobyte", + "kilogram", + "kilometer", + "liter", + "megabit", + "megabyte", + "meter", + "mile", + "mile-scandinavian", + "milliliter", + "millimeter", + "millisecond", + "minute", + "month", + "ounce", + "percent", + "petabyte", + "pound", + "second", + "stone", + "terabit", + "terabyte", + "week", + "yard", + "year" ] as const; export const unitsAsEntries = units.map((unit) => [unit, unit]); diff --git a/src/lib/playground/format.utils.ts b/src/lib/playground/format.utils.ts index b1b9e69..6c46093 100644 --- a/src/lib/playground/format.utils.ts +++ b/src/lib/playground/format.utils.ts @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import type { FormatMethodsKeys } from "$lib/format-methods"; import type { AllFormatOptions } from "$lib/format-options/types"; -import type { PlaygroundOption, PlaygroundSchema } from "./playground.schema"; +import type { PlaygroundOption, PlaygroundSchema } from "$lib/playground/playground.schema"; import { formatOptions } from "$lib/format-options"; import { durationValues } from "$lib/format-options/duration-format.options"; -import { optionIsActive } from "./validate"; +import { optionIsActive } from "$lib/playground/validate"; import { clampValue, fallbackDisplayNames, tryFormat, print, formatLocalesForPrint } from "$lib/utils/format-utils"; export const updateOptionOnSchema = ( diff --git a/src/lib/playground/playground.schema.ts b/src/lib/playground/playground.schema.ts index d2a08da..7cf0c91 100644 --- a/src/lib/playground/playground.schema.ts +++ b/src/lib/playground/playground.schema.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { FormatMethodsKeys } from '$lib/format-methods'; -import type { AllFormatOptions, AllMethods } from '$lib/format-options/types'; +import type { FormatMethodsKeys } from "$lib/format-methods"; +import type { AllFormatOptions, AllMethods } from "$lib/format-options/types"; -export type InputType = 'select' | 'text' | 'radio'; -export type ValueType = 'string' | 'number' | 'boolean'; -export type InputValueType = 'array' | 'date' | 'number' | 'string'; +export type InputType = "select" | "text" | "radio"; +export type ValueType = "string" | "number" | "boolean"; +export type InputValueType = "array" | "date" | "number" | "string"; export type PlaygroundOption< Method extends FormatMethodsKeys, diff --git a/src/lib/playground/schemas/collator.schema.ts b/src/lib/playground/schemas/collator.schema.ts index 32da321..871a613 100644 --- a/src/lib/playground/schemas/collator.schema.ts +++ b/src/lib/playground/schemas/collator.schema.ts @@ -1,52 +1,52 @@ -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const collatorSchema: PlaygroundSchema<'Collator'> = { - method: 'Collator', - primaryFormatter: 'compare', - inputValues: [['Z', 'a', 'z', 'ä', '1', '=', 'à']], - inputValueType: 'array', +export const collatorSchema: PlaygroundSchema<"Collator"> = { + method: "Collator", + primaryFormatter: "compare", + inputValues: [["Z", "a", "z", "ä", "1", "=", "à"]], + inputValueType: "array", options: [ { - name: 'usage', - valueType: 'string', + name: "usage", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'caseFirst', - valueType: 'string', + name: "caseFirst", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'sensitivity', - valueType: 'string', + name: "sensitivity", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'caseFirst', - valueType: 'string', + name: "caseFirst", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'numeric', - valueType: 'boolean', + name: "numeric", + valueType: "boolean", defaultValue: undefined, - inputType: 'radio' + inputType: "radio" }, { - name: 'ignorePunctuation', - valueType: 'boolean', + name: "ignorePunctuation", + valueType: "boolean", defaultValue: undefined, - inputType: 'radio' + inputType: "radio" }, { - name: 'localeMatcher', - valueType: 'string', + name: "localeMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" } ] }; diff --git a/src/lib/playground/schemas/dateTimeFormat.schema.ts b/src/lib/playground/schemas/dateTimeFormat.schema.ts index 9d00b86..4d68c23 100644 --- a/src/lib/playground/schemas/dateTimeFormat.schema.ts +++ b/src/lib/playground/schemas/dateTimeFormat.schema.ts @@ -1,150 +1,150 @@ -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; const invalidOptions = [ - 'day', - 'hour', - 'minute', - 'second', - 'weekday', - 'month', - 'era', - 'dayPeriod', - 'timeZoneName', - 'fractionalSecondDigits' + "day", + "hour", + "minute", + "second", + "weekday", + "month", + "era", + "dayPeriod", + "timeZoneName", + "fractionalSecondDigits" ]; -export const dateTimeFormatSchema: PlaygroundSchema<'DateTimeFormat'> = { - method: 'DateTimeFormat', - primaryFormatter: 'format', - inputValues: ['2022-04-24T19:00', '2022-10-24T19:00'], - inputValueType: 'date', - secondaryFormatters: ['formatToParts', 'formatRange', 'formatRangeToParts'], +export const dateTimeFormatSchema: PlaygroundSchema<"DateTimeFormat"> = { + method: "DateTimeFormat", + primaryFormatter: "format", + inputValues: ["2022-04-24T19:00", "2022-10-24T19:00"], + inputValueType: "date", + secondaryFormatters: ["formatToParts", "formatRange", "formatRangeToParts"], invalidOptionCombos: { - 'dateStyle:long': invalidOptions, - 'dateStyle:full': invalidOptions, - 'dateStyle:medium': invalidOptions, - 'dateStyle:short': invalidOptions, - 'timeStyle:long': invalidOptions, - 'timeStyle:full': invalidOptions, - 'timeStyle:medium': invalidOptions, - 'timeStyle:short': invalidOptions + "dateStyle:long": invalidOptions, + "dateStyle:full": invalidOptions, + "dateStyle:medium": invalidOptions, + "dateStyle:short": invalidOptions, + "timeStyle:long": invalidOptions, + "timeStyle:full": invalidOptions, + "timeStyle:medium": invalidOptions, + "timeStyle:short": invalidOptions }, options: [ { - name: 'dateStyle', - valueType: 'string', + name: "dateStyle", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'timeStyle', - valueType: 'string', + name: "timeStyle", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'day', - valueType: 'string', + name: "day", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'hour', - valueType: 'string', + name: "hour", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'minute', - valueType: 'string', + name: "minute", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'second', - valueType: 'string', + name: "second", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'weekday', - valueType: 'string', + name: "weekday", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'month', - valueType: 'string', + name: "month", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'era', - valueType: 'string', + name: "era", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'year', - valueType: 'string', + name: "year", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'dayPeriod', - valueType: 'string', + name: "dayPeriod", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'hourCycle', - valueType: 'string', + name: "hourCycle", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'hour12', - valueType: 'boolean', + name: "hour12", + valueType: "boolean", defaultValue: undefined, - inputType: 'radio' + inputType: "radio" }, { - name: 'calendar', - valueType: 'string', + name: "calendar", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'fractionalSecondDigits', - valueType: 'number', + name: "fractionalSecondDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 3, min: 0 }, { - name: 'numberingSystem', - valueType: 'string', + name: "numberingSystem", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'timeZoneName', - valueType: 'string', + name: "timeZoneName", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'localeMatcher', - valueType: 'string', + name: "localeMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'formatMatcher', - valueType: 'string', + name: "formatMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" } ] }; diff --git a/src/lib/playground/schemas/displayNames.schema.ts b/src/lib/playground/schemas/displayNames.schema.ts index 6bd1f9f..f0f175d 100644 --- a/src/lib/playground/schemas/displayNames.schema.ts +++ b/src/lib/playground/schemas/displayNames.schema.ts @@ -1,41 +1,41 @@ -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const displayNamesSchema: PlaygroundSchema<'DisplayNames'> = { - method: 'DisplayNames', - primaryFormatter: 'of', - inputValues: ['US'], - inputValueType: 'string', +export const displayNamesSchema: PlaygroundSchema<"DisplayNames"> = { + method: "DisplayNames", + primaryFormatter: "of", + inputValues: ["US"], + inputValueType: "string", options: [ { - name: 'type', + name: "type", removeUndefined: true, - valueType: 'string', - defaultValue: 'region', - inputType: 'select' + valueType: "string", + defaultValue: "region", + inputType: "select" }, { - name: 'style', - valueType: 'string', + name: "style", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'languageDisplay', - valueType: 'string', + name: "languageDisplay", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'fallback', - valueType: 'string', + name: "fallback", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'localeMatcher', - valueType: 'string', + name: "localeMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" } ] }; diff --git a/src/lib/playground/schemas/durationFormat.schema.ts b/src/lib/playground/schemas/durationFormat.schema.ts index fa42dd3..0113615 100644 --- a/src/lib/playground/schemas/durationFormat.schema.ts +++ b/src/lib/playground/schemas/durationFormat.schema.ts @@ -1,32 +1,32 @@ import { durationValues } from "$lib/format-options/duration-format.options"; -import type { PlaygroundOption, PlaygroundSchema } from "../playground.schema"; +import type { PlaygroundOption, PlaygroundSchema } from "$lib/playground/playground.schema"; -export const durationFormatSchema: PlaygroundSchema<'DurationFormat'> = { - method: "DurationFormat", - primaryFormatter: "format", - secondaryFormatters: ["formatToParts"], - inputValues: [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], - inputValueType: "array", - options: [ - { - name: 'style', - valueType: 'string', - defaultValue: undefined, - inputType: 'select' - }, - ...durationValues.map((duration) => ({ - name: duration, - valueType: 'string', - defaultValue: undefined, - inputType: 'select' - })) as PlaygroundOption<"DurationFormat">[], - { - name: 'fractionalDigits', - valueType: 'number', +export const durationFormatSchema: PlaygroundSchema<"DurationFormat"> = { + method: "DurationFormat", + primaryFormatter: "format", + secondaryFormatters: ["formatToParts"], + inputValues: [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], + inputValueType: "array", + options: [ + { + name: "style", + valueType: "string", defaultValue: undefined, - inputType: 'text', + inputType: "select" + }, + ...(durationValues.map((duration) => ({ + name: duration, + valueType: "string", + defaultValue: undefined, + inputType: "select" + })) as PlaygroundOption<"DurationFormat">[]), + { + name: "fractionalDigits", + valueType: "number", + defaultValue: undefined, + inputType: "text", max: 3, min: 0 - }, - ] -} \ No newline at end of file + } + ] +}; diff --git a/src/lib/playground/schemas/index.ts b/src/lib/playground/schemas/index.ts index 77990d0..b6e9a4a 100644 --- a/src/lib/playground/schemas/index.ts +++ b/src/lib/playground/schemas/index.ts @@ -1,12 +1,12 @@ -import { collatorSchema } from './collator.schema'; -import { dateTimeFormatSchema } from './dateTimeFormat.schema'; -import { displayNamesSchema } from './displayNames.schema'; -import { durationFormatSchema } from './durationFormat.schema'; -import { listFormatSchema } from './listFormat.schema'; -import { numberFormatSchema } from './numberFormat.schema'; -import { pluralRulesSchema } from './pluralRules.schema'; -import { relativeTimeFormatSchema } from './relativeTimeFormat.schema'; -import { segmenterSchema } from './segmenter.schema'; +import { collatorSchema } from "$lib/playground/schemas/collator.schema"; +import { dateTimeFormatSchema } from "$lib/playground/schemas/dateTimeFormat.schema"; +import { displayNamesSchema } from "$lib/playground/schemas/displayNames.schema"; +import { durationFormatSchema } from "$lib/playground/schemas/durationFormat.schema"; +import { listFormatSchema } from "$lib/playground/schemas/listFormat.schema"; +import { numberFormatSchema } from "$lib/playground/schemas/numberFormat.schema"; +import { pluralRulesSchema } from "$lib/playground/schemas/pluralRules.schema"; +import { relativeTimeFormatSchema } from "$lib/playground/schemas/relativeTimeFormat.schema"; +import { segmenterSchema } from "$lib/playground/schemas/segmenter.schema"; export const schemas = { NumberFormat: numberFormatSchema, @@ -17,7 +17,7 @@ export const schemas = { Collator: collatorSchema, Segmenter: segmenterSchema, DisplayNames: displayNamesSchema, - DurationFormat: durationFormatSchema, + DurationFormat: durationFormatSchema }; export type SchemaKeys = keyof typeof schemas; diff --git a/src/lib/playground/schemas/listFormat.schema.ts b/src/lib/playground/schemas/listFormat.schema.ts index af52307..06710be 100644 --- a/src/lib/playground/schemas/listFormat.schema.ts +++ b/src/lib/playground/schemas/listFormat.schema.ts @@ -1,23 +1,23 @@ -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const listFormatSchema: PlaygroundSchema<'ListFormat'> = { - method: 'ListFormat', - primaryFormatter: 'format', - secondaryFormatters: ['formatToParts'], - inputValues: [['cat', 'hat', 'rat']], - inputValueType: 'array', +export const listFormatSchema: PlaygroundSchema<"ListFormat"> = { + method: "ListFormat", + primaryFormatter: "format", + secondaryFormatters: ["formatToParts"], + inputValues: [["cat", "hat", "rat"]], + inputValueType: "array", options: [ { - name: 'type', + name: "type", defaultValue: undefined, - inputType: 'select', - valueType: 'string' + inputType: "select", + valueType: "string" }, { - name: 'style', + name: "style", defaultValue: undefined, - valueType: 'string', - inputType: 'select' + valueType: "string", + inputType: "select" } ] }; diff --git a/src/lib/playground/schemas/numberFormat.schema.ts b/src/lib/playground/schemas/numberFormat.schema.ts index a6e9f4f..b530551 100644 --- a/src/lib/playground/schemas/numberFormat.schema.ts +++ b/src/lib/playground/schemas/numberFormat.schema.ts @@ -1,156 +1,156 @@ import { numberFormatOptionsCurrency, numberFormatOptionsUnit -} from '$lib/format-options/number-format.options'; -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +} from "$lib/format-options/number-format.options"; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const numberFormatSchema: PlaygroundSchema<'NumberFormat'> = { - method: 'NumberFormat', - primaryFormatter: 'format', +export const numberFormatSchema: PlaygroundSchema<"NumberFormat"> = { + method: "NumberFormat", + primaryFormatter: "format", inputValues: [1091, 2000], - inputValueType: 'number', - secondaryFormatters: ['formatToParts', 'formatRange', 'formatRangeToParts'], + inputValueType: "number", + secondaryFormatters: ["formatToParts", "formatRange", "formatRangeToParts"], invalidOptionCombos: { - 'style:currency': Object.keys(numberFormatOptionsUnit), - 'style:unit': Object.keys(numberFormatOptionsCurrency), - 'style:undefined': [ + "style:currency": Object.keys(numberFormatOptionsUnit), + "style:unit": Object.keys(numberFormatOptionsCurrency), + "style:undefined": [ ...Object.keys(numberFormatOptionsCurrency), ...Object.keys(numberFormatOptionsUnit) ] }, options: [ { - name: 'style', - valueType: 'string', - defaultValue: 'currency', - inputType: 'select' + name: "style", + valueType: "string", + defaultValue: "currency", + inputType: "select" }, /** UNIT */ { - name: 'unit', - valueType: 'string', + name: "unit", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'compactDisplay', - valueType: 'string', + name: "compactDisplay", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'unitDisplay', - valueType: 'string', + name: "unitDisplay", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'notation', - valueType: 'string', + name: "notation", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, /** CURRENCY */ { - name: 'currency', - valueType: 'string', - defaultValue: 'USD', - inputType: 'select' + name: "currency", + valueType: "string", + defaultValue: "USD", + inputType: "select" }, { - name: 'currencySign', - valueType: 'string', + name: "currencySign", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'currencyDisplay', - valueType: 'string', + name: "currencyDisplay", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, /** COMMON */ { - name: 'signDisplay', - valueType: 'string', + name: "signDisplay", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'useGrouping', - valueType: 'boolean', + name: "useGrouping", + valueType: "boolean", defaultValue: undefined, - inputType: 'radio' + inputType: "radio" }, { - name: 'minimumIntegerDigits', - valueType: 'number', + name: "minimumIntegerDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 21, min: 1 }, { - name: 'minimumFractionDigits', - valueType: 'number', + name: "minimumFractionDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 20, min: 1 }, { - name: 'maximumFractionDigits', - valueType: 'number', + name: "maximumFractionDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 20, min: 1 }, { - name: 'minimumSignificantDigits', - valueType: 'number', + name: "minimumSignificantDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 21, min: 1 }, { - name: 'maximumSignificantDigits', - valueType: 'number', + name: "maximumSignificantDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 21, min: 1 }, { - name: 'roundingIncrement', - valueType: 'number', + name: "roundingIncrement", + valueType: "number", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'roundingMode', - valueType: 'string', + name: "roundingMode", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'roundingPriority', - valueType: 'string', + name: "roundingPriority", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'trailingZeroDisplay', - valueType: 'string', + name: "trailingZeroDisplay", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'localeMatcher', - valueType: 'string', + name: "localeMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" } ] }; diff --git a/src/lib/playground/schemas/pluralRules.schema.ts b/src/lib/playground/schemas/pluralRules.schema.ts index fdfd478..28f5d84 100644 --- a/src/lib/playground/schemas/pluralRules.schema.ts +++ b/src/lib/playground/schemas/pluralRules.schema.ts @@ -1,81 +1,82 @@ -import type { PlaygroundSchema } from '../playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const pluralRulesSchema: PlaygroundSchema<'PluralRules'> = { - method: 'PluralRules', - primaryFormatter: 'select', +export const pluralRulesSchema: PlaygroundSchema<"PluralRules"> = { + method: "PluralRules", + primaryFormatter: "select", inputValues: [2, 10], // eslint-disable-next-line @typescript-eslint/no-explicit-any - secondaryFormatters: ['selectRange' as any], - inputValueType: 'number', + secondaryFormatters: ["selectRange" as any], + inputValueType: "number", options: [ { - name: 'type', - valueType: 'string', + name: "type", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'minimumIntegerDigits', - valueType: 'number', + name: "minimumIntegerDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 21, min: 1 }, { - name: 'minimumFractionDigits', - valueType: 'number', + name: "minimumFractionDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 20, min: 1 }, { - name: 'maximumFractionDigits', - valueType: 'number', + name: "maximumFractionDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 20, min: 1 }, { - name: 'minimumSignificantDigits', - valueType: 'number', + name: "minimumSignificantDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 21, min: 1 }, { - name: 'maximumSignificantDigits', - valueType: 'number', + name: "maximumSignificantDigits", + valueType: "number", defaultValue: undefined, - inputType: 'text', + inputType: "text", max: 21, min: 1 - }, { - name: 'roundingIncrement', - valueType: 'string', - defaultValue: undefined, - inputType: 'select' }, { - name: 'roundingMode', - valueType: 'string', + name: "roundingIncrement", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'roundingPriority', - valueType: 'string', + name: "roundingMode", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'trailingZeroDisplay', - valueType: 'string', + name: "roundingPriority", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, + { + name: "trailingZeroDisplay", + valueType: "string", + defaultValue: undefined, + inputType: "select" + } ] }; diff --git a/src/lib/playground/schemas/relativeTimeFormat.schema.ts b/src/lib/playground/schemas/relativeTimeFormat.schema.ts index 663c36b..599376c 100644 --- a/src/lib/playground/schemas/relativeTimeFormat.schema.ts +++ b/src/lib/playground/schemas/relativeTimeFormat.schema.ts @@ -1,36 +1,36 @@ -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const relativeTimeFormatSchema: PlaygroundSchema<'RelativeTimeFormat'> = { - method: 'RelativeTimeFormat', - primaryFormatter: 'format', - inputValues: [2, 'days'], - inputValueType: 'number', - secondaryFormatters: ['formatToParts'], +export const relativeTimeFormatSchema: PlaygroundSchema<"RelativeTimeFormat"> = { + method: "RelativeTimeFormat", + primaryFormatter: "format", + inputValues: [2, "days"], + inputValueType: "number", + secondaryFormatters: ["formatToParts"], options: [ { - name: 'unit' as keyof Intl.RelativeTimeFormatOptions, - valueType: 'string', - defaultValue: 'day' as Intl.RelativeTimeFormatNumeric, - inputType: 'select', + name: "unit" as keyof Intl.RelativeTimeFormatOptions, + valueType: "string", + defaultValue: "day" as Intl.RelativeTimeFormatNumeric, + inputType: "select", removeUndefined: true }, { - name: 'numeric', - valueType: 'string', + name: "numeric", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'style', - valueType: 'string', + name: "style", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'localeMatcher', - valueType: 'string', + name: "localeMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" } ] }; diff --git a/src/lib/playground/schemas/segmenter.schema.ts b/src/lib/playground/schemas/segmenter.schema.ts index d2fadb6..44b0242 100644 --- a/src/lib/playground/schemas/segmenter.schema.ts +++ b/src/lib/playground/schemas/segmenter.schema.ts @@ -1,22 +1,22 @@ -import type { PlaygroundSchema } from '$lib/playground/playground.schema'; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; -export const segmenterSchema: PlaygroundSchema<'Segmenter'> = { - method: 'Segmenter', - primaryFormatter: 'segment', - inputValues: ['A normal sentence.'], - inputValueType: 'string', +export const segmenterSchema: PlaygroundSchema<"Segmenter"> = { + method: "Segmenter", + primaryFormatter: "segment", + inputValues: ["A normal sentence."], + inputValueType: "string", options: [ { - name: 'granularity', - valueType: 'string', + name: "granularity", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" }, { - name: 'localeMatcher', - valueType: 'string', + name: "localeMatcher", + valueType: "string", defaultValue: undefined, - inputType: 'select' + inputType: "select" } ] }; diff --git a/src/lib/playground/url.utils.ts b/src/lib/playground/url.utils.ts index f8676ec..3e5719f 100644 --- a/src/lib/playground/url.utils.ts +++ b/src/lib/playground/url.utils.ts @@ -1,26 +1,26 @@ -import { browser } from '$app/environment'; -import type { FormatMethodsKeys } from '$lib/format-methods'; -import type { PlaygroundSchema } from './playground.schema'; -import { validateAndUpdateSchema } from './validate'; +import { browser } from "$app/environment"; +import type { FormatMethodsKeys } from "$lib/format-methods"; +import type { PlaygroundSchema } from "$lib/playground/playground.schema"; +import { validateAndUpdateSchema } from "$lib/playground/validate"; -export const getSchemaParam = () => browser ? new URLSearchParams(window.location.search).get('schema') : undefined; +export const getSchemaParam = () => + browser ? new URLSearchParams(window.location.search).get("schema") : undefined; export const parseSchemaFromURL = (): | PlaygroundSchema | undefined => { - const params = browser ? new URLSearchParams(window.location.search).get('schema') : undefined; + const params = browser ? new URLSearchParams(window.location.search).get("schema") : undefined; const parsedParams = params ? (JSON.parse(atob(params)).schema as PlaygroundSchema) : undefined; return parsedParams ? validateAndUpdateSchema(parsedParams) : undefined; }; - export const createSchemaUrl = ( schema: PlaygroundSchema ) => { const baseEncoded = btoa(JSON.stringify({ schema })); const params = new URLSearchParams(window.location.search); - params.set('schema', baseEncoded); - return `${window.location.origin}${window.location.pathname}?${params.toString()}` + params.set("schema", baseEncoded); + return `${window.location.origin}${window.location.pathname}?${params.toString()}`; }; diff --git a/src/lib/playground/validate.ts b/src/lib/playground/validate.ts index 2f9bdc0..b901f99 100644 --- a/src/lib/playground/validate.ts +++ b/src/lib/playground/validate.ts @@ -1,19 +1,19 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { FormatMethodsKeys } from '$lib/format-methods'; -import type { PlaygroundOption, PlaygroundSchema } from '$lib/playground/playground.schema'; -import { schemas } from './schemas'; +import type { FormatMethodsKeys } from "$lib/format-methods"; +import type { PlaygroundOption, PlaygroundSchema } from "$lib/playground/playground.schema"; +import { schemas } from "$lib/playground/schemas"; export const optionIsActive = ( option: PlaygroundOption ) => { - if(option.selected !== undefined) { + if (option.selected !== undefined) { return option.selected; } - if(option.value !== undefined) { + if (option.value !== undefined) { return true; } return option.defaultValue !== undefined; -} +}; export const validateAndUpdateSchema = ( schema: PlaygroundSchema @@ -42,13 +42,14 @@ export const validateAndUpdateSchema = ( ? options.filter((option) => invalidOptions && !invalidOptions.includes(option.name as string)) : options; // Special case for numberformat as the style property requires the unit property to be set - const style = schema.method === "NumberFormat" - ? optionsWithoutInvalidOptions.find((option) => option.name === 'style') - : undefined; - if(style && style.value === 'unit') { - const unit = optionsWithoutInvalidOptions.findIndex((option) => option.name === 'unit'); - if(unit && !optionsWithoutInvalidOptions[unit].value) { - optionsWithoutInvalidOptions[unit].value = 'degree' as any; + const style = + schema.method === "NumberFormat" + ? optionsWithoutInvalidOptions.find((option) => option.name === "style") + : undefined; + if (style && style.value === "unit") { + const unit = optionsWithoutInvalidOptions.findIndex((option) => option.name === "unit"); + if (unit && !optionsWithoutInvalidOptions[unit].value) { + optionsWithoutInvalidOptions[unit].value = "degree" as any; } } return { diff --git a/src/lib/routes.ts b/src/lib/routes.ts index bc5b17e..6909c2d 100644 --- a/src/lib/routes.ts +++ b/src/lib/routes.ts @@ -8,56 +8,56 @@ export type Route = { export const routes: Route[] = [ { - path: 'NumberFormat', - name: 'NumberFormat' + path: "NumberFormat", + name: "NumberFormat" }, { - path: 'NumberFormat/Currency', - name: 'Currency', + path: "NumberFormat/Currency", + name: "Currency", sublink: true, - ariaLabel: 'NumberFormat Currency Style' + ariaLabel: "NumberFormat Currency Style" }, { - path: 'NumberFormat/Unit', - name: 'Unit', + path: "NumberFormat/Unit", + name: "Unit", sublink: true, - ariaLabel: 'NumberFormat Unit Style' + ariaLabel: "NumberFormat Unit Style" }, { - path: 'DateTimeFormat', - name: 'DateTimeFormat' + path: "DateTimeFormat", + name: "DateTimeFormat" }, { - path: 'RelativeTimeFormat', - name: 'RelativeTimeFormat' + path: "RelativeTimeFormat", + name: "RelativeTimeFormat" }, { - path: 'ListFormat', - name: 'ListFormat' + path: "ListFormat", + name: "ListFormat" }, { - path: 'PluralRules', - name: 'PluralRules' + path: "PluralRules", + name: "PluralRules" }, { - path: 'Collator', - name: 'Collator' + path: "Collator", + name: "Collator" }, { - path: 'Segmenter', - name: 'Segmenter' + path: "Segmenter", + name: "Segmenter" }, { - path: 'DisplayNames', - name: 'DisplayNames' + path: "DisplayNames", + name: "DisplayNames" }, { - path: 'DurationFormat', - name: 'DurationFormat', - experimental: true, + path: "DurationFormat", + name: "DurationFormat", + experimental: true }, { - path: 'Locale', - name: 'Locale', + path: "Locale", + name: "Locale" } ]; diff --git a/src/lib/store/locales.ts b/src/lib/store/locales.ts index 7df162d..cd3990a 100644 --- a/src/lib/store/locales.ts +++ b/src/lib/store/locales.ts @@ -1,17 +1,17 @@ -import { browser } from '$app/environment'; -import { getLocaleFromParams, localeKey } from '$lib/utils/get-locale'; -import { writable } from 'svelte/store'; +import { browser } from "$app/environment"; +import { getLocaleFromParams, localeKey } from "$lib/utils/get-locale"; +import { writable } from "svelte/store"; export const locales = writable(getLocaleFromParams()); locales.subscribe((value) => { if (browser) { const params = new URLSearchParams(window.location.search); - params.set(localeKey, value.join(',')); + params.set(localeKey, value.join(",")); const formatted = value.length ? `?${params.toString()}` : ""; window.history.replaceState( {}, - '', + "", `${window.location.origin}${window.location.pathname}${formatted}` ); } diff --git a/src/lib/store/settings.ts b/src/lib/store/settings.ts index 895dd2f..31fb7b2 100644 --- a/src/lib/store/settings.ts +++ b/src/lib/store/settings.ts @@ -1,80 +1,80 @@ -import { browser } from '$app/environment'; -import { writable } from 'svelte/store'; +import { browser } from "$app/environment"; +import { writable } from "svelte/store"; export type DarkMode = "dark" | "light"; type HintKeys = "codeThemeHint" | "themeHint" | "showBrowserSupportHint"; type Setting = { - type: "radio" | "checkbox", - values: Value[], - hint?: HintKeys; -} + type: "radio" | "checkbox"; + values: Value[]; + hint?: HintKeys; +}; type SettingsConfiguration = { - codeTheme: Setting - theme: Setting - showBrowserSupport: Setting; -} + codeTheme: Setting; + theme: Setting; + showBrowserSupport: Setting; +}; export const settingsConfiguration: SettingsConfiguration = { - codeTheme: { - type: 'radio', - values: ["dark", "light"], - hint: "codeThemeHint" - }, - theme: { - type: 'radio', - values: ["dark", "light"], - hint: "themeHint", - }, - showBrowserSupport: { - type: 'checkbox', - values: [true], - hint: "showBrowserSupportHint", - } -} + codeTheme: { + type: "radio", + values: ["dark", "light"], + hint: "codeThemeHint" + }, + theme: { + type: "radio", + values: ["dark", "light"], + hint: "themeHint" + }, + showBrowserSupport: { + type: "checkbox", + values: [true], + hint: "showBrowserSupportHint" + } +}; export type Settings = { - codeTheme: DarkMode; - theme: DarkMode; - showBrowserSupport: boolean; -} + codeTheme: DarkMode; + theme: DarkMode; + showBrowserSupport: boolean; +}; -const defaultSettings: Settings = { - codeTheme: "dark", - theme: 'light', - showBrowserSupport: true -} +const defaultSettings: Settings = { + codeTheme: "dark", + theme: "light", + showBrowserSupport: true +}; -export const settingsKeys = Object.keys(defaultSettings) as (keyof Settings)[] +export const settingsKeys = Object.keys(defaultSettings) as (keyof Settings)[]; export const settingsLocalStorageKey = "intl-explorer-settings"; const getSettings = () => { - if(!browser) return defaultSettings; - const stored = localStorage.getItem(settingsLocalStorageKey); - if(!stored) return defaultSettings; - return { - ...defaultSettings, - ...JSON.parse(stored) - } as Settings; -} + if (!browser) return defaultSettings; + const stored = localStorage.getItem(settingsLocalStorageKey); + if (!stored) return defaultSettings; + return { + ...defaultSettings, + ...JSON.parse(stored) + } as Settings; +}; export const settings = writable(getSettings()); settings.subscribe((value) => { if (browser) { - if(value.theme === "dark") { + if (value.theme === "dark") { document.querySelector("html")?.setAttribute("data-dark-mode", "true"); - } else if(value.theme === "light") { - document.querySelector("html")?.removeAttribute("data-dark-mode"); - } - if(value.codeTheme === "light") { + } else if (value.theme === "light") { + document.querySelector("html")?.removeAttribute("data-dark-mode"); + } + if (value.codeTheme === "light") { document.querySelector("html")?.setAttribute("data-code-light-mode", "true"); } else if (value.codeTheme === "dark") { - document.querySelector("html")?.removeAttribute("data-code-light-mode"); - } - localStorage.setItem(settingsLocalStorageKey, JSON.stringify(value)) + document.querySelector("html")?.removeAttribute("data-code-light-mode"); + } + localStorage.setItem(settingsLocalStorageKey, JSON.stringify(value)); } }); diff --git a/src/lib/types/BrowserSupport.types.ts b/src/lib/types/BrowserSupport.types.ts index 444aad6..a2be044 100644 --- a/src/lib/types/BrowserSupport.types.ts +++ b/src/lib/types/BrowserSupport.types.ts @@ -1,4 +1,4 @@ -import type { BrowserType, VersionValue } from '@mdn/browser-compat-data'; +import type { BrowserType, VersionValue } from "@mdn/browser-compat-data"; export type BrowserCoverage = "full" | "partial" | "none"; @@ -10,8 +10,8 @@ export type BrowserReleaseData = { export type BrowserSupportForOption = { coverage?: BrowserCoverage; - support?: Record -} + support?: Record; +}; export type BrowserSupportDataForOptions = Record; diff --git a/src/lib/utils/analytics.ts b/src/lib/utils/analytics.ts index 6f90904..3e3e021 100644 --- a/src/lib/utils/analytics.ts +++ b/src/lib/utils/analytics.ts @@ -1,14 +1,9 @@ -export type AnalyticEvents = - | 'Copy Schema' - | 'Copy Code' +export type AnalyticEvents = "Copy Schema" | "Copy Code"; -export const trackEvent = ( - name: AnalyticEvents, - data?: Record -) => { - try { - window?.umami?.track(name, data) - } catch (error) { - // noop - } -} \ No newline at end of file +export const trackEvent = (name: AnalyticEvents, data?: Record) => { + try { + window?.umami?.track(name, data); + } catch (error) { + // noop + } +}; diff --git a/src/lib/utils/browser-support.ts b/src/lib/utils/browser-support.ts index aab11c6..d85f88e 100644 --- a/src/lib/utils/browser-support.ts +++ b/src/lib/utils/browser-support.ts @@ -1,7 +1,8 @@ import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; -export const getSpecUrls = (data: BrowserSupportDataForMethod | null) => data && Array.isArray(data.specUrl) - ? data.specUrl - : typeof data?.specUrl === 'string' - ? [data.specUrl] - : []; \ No newline at end of file +export const getSpecUrls = (data: BrowserSupportDataForMethod | null) => + data && Array.isArray(data.specUrl) + ? data.specUrl + : typeof data?.specUrl === "string" + ? [data.specUrl] + : []; diff --git a/src/lib/utils/copy-to-clipboard.ts b/src/lib/utils/copy-to-clipboard.ts index 7879bbc..c8dbfc2 100644 --- a/src/lib/utils/copy-to-clipboard.ts +++ b/src/lib/utils/copy-to-clipboard.ts @@ -1,27 +1,27 @@ -import { trackEvent } from "./analytics"; +import { trackEvent } from "$lib/utils/analytics"; export function copyToClipboard(textToCopy: string): Promise { if (navigator.clipboard && window.isSecureContext) { return navigator.clipboard.writeText(textToCopy); } else { - const textArea = document.createElement('textarea'); + const textArea = document.createElement("textarea"); textArea.value = textToCopy; - textArea.style.position = 'fixed'; - textArea.style.left = '-999999px'; - textArea.style.top = '-999999px'; + textArea.style.position = "fixed"; + textArea.style.left = "-999999px"; + textArea.style.top = "-999999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); return new Promise((resolve, reject) => { - document.execCommand('copy') ? resolve() : reject(); + document.execCommand("copy") ? resolve() : reject(); textArea.remove(); }); } } -export const copyCode = async (code: string) => { +export const copyCode = async (code: string) => { await copyToClipboard(code); - trackEvent('Copy Code', { + trackEvent("Copy Code", { code }); -} +}; diff --git a/src/lib/utils/directives.ts b/src/lib/utils/directives.ts index 3088f13..c379f3f 100644 --- a/src/lib/utils/directives.ts +++ b/src/lib/utils/directives.ts @@ -1,20 +1,20 @@ export function onClickOutside(element: HTMLElement, callback: () => void) { - const onClick = (event: MouseEvent) => { - const target = event.target as Node | null; - if(!element.contains(target)) { - callback(); - } - } + const onClick = (event: MouseEvent) => { + const target = event.target as Node | null; + if (!element.contains(target)) { + callback(); + } + }; - document.body.addEventListener("mousedown", onClick); + document.body.addEventListener("mousedown", onClick); - return { - update(newCallback: () => void) { - callback = newCallback; - }, + return { + update(newCallback: () => void) { + callback = newCallback; + }, - destroy() { - document.body.removeEventListener("mousedown", onClick); - } - }; -} \ No newline at end of file + destroy() { + document.body.removeEventListener("mousedown", onClick); + } + }; +} diff --git a/src/lib/utils/dom-utils.ts b/src/lib/utils/dom-utils.ts index bf2a14d..67f56a7 100644 --- a/src/lib/utils/dom-utils.ts +++ b/src/lib/utils/dom-utils.ts @@ -1,3 +1,3 @@ export const testIds = { - navigation: "navigation" -} \ No newline at end of file + navigation: "navigation" +}; diff --git a/src/lib/utils/format-utils.ts b/src/lib/utils/format-utils.ts index a878e4e..fca2612 100644 --- a/src/lib/utils/format-utils.ts +++ b/src/lib/utils/format-utils.ts @@ -1,5 +1,5 @@ -import type { FormatMethodsKeys } from '$lib/format-methods'; -import type { PlaygroundOption } from '$lib/playground/playground.schema'; +import type { FormatMethodsKeys } from "$lib/format-methods"; +import type { PlaygroundOption } from "$lib/playground/playground.schema"; export const defaultNumberRange = [1, 2, 3, 4, 5]; @@ -7,26 +7,26 @@ export const clampValue = ( option: PlaygroundOption, value: string | boolean | null | undefined ) => { - if (option.valueType !== 'number') return value; - if (typeof value !== 'string') return value; + if (option.valueType !== "number") return value; + if (typeof value !== "string") return value; const parsed = parseInt(value, 10); if (isNaN(parsed)) return option.defaultValue; - if(!option.max && !option.min) return parsed; + if (!option.max && !option.min) return parsed; const clampedMax = option.max && parsed > option.max ? option.max : parsed; return option.min && parsed < option.min ? Math.max(option.min, clampedMax) : clampedMax; }; export const print = (values: unknown) => { return JSON.stringify(values, null, 2); -} +}; -export const fallbackDisplayNames: Record = { - language: 'en-US', - region: 'US', - script: 'Latn', - calendar: 'gregory', - dateTimeField: 'month', - currency: 'USD' +export const fallbackDisplayNames: Record = { + language: "en-US", + region: "US", + script: "Latn", + calendar: "gregory", + dateTimeField: "month", + currency: "USD" }; export const tryDisplayNames = ( @@ -49,25 +49,24 @@ export const tryFormat = (format: () => string): string => { } }; - -export const camelCaseToWords = (s: string) => { - const result = s.replace(/([A-Z])/g, ' $1'); - return result.charAt(0).toUpperCase() + result.slice(1); -} +export const camelCaseToWords = (s: string) => { + const result = s.replace(/([A-Z])/g, " $1"); + return result.charAt(0).toUpperCase() + result.slice(1); +}; export const formatLocalesForPrint = (locales: string[]) => { - if(!locales.length) { + if (!locales.length) { return `undefined`; } - if(locales.length === 1) { + if (locales.length === 1) { return `"${locales[0]}"`; } - return `[${locales.map(l => `"${l}"`).join(",")}]` -} + return `[${locales.map((l) => `"${l}"`).join(",")}]`; +}; export const formatLocaleForUrl = (locales: string[]) => { - if(locales.length) { - return `?locale=${locales.join(",")}` + if (locales.length) { + return `?locale=${locales.join(",")}`; } return ""; -} \ No newline at end of file +}; diff --git a/src/lib/utils/get-locale.ts b/src/lib/utils/get-locale.ts index fd6603a..475bb3f 100644 --- a/src/lib/utils/get-locale.ts +++ b/src/lib/utils/get-locale.ts @@ -1,11 +1,9 @@ -import type { Page } from '@sveltejs/kit'; -import { browser } from '$app/environment'; +import type { Page } from "@sveltejs/kit"; +import { browser } from "$app/environment"; -export const localeKey = 'locale'; +export const localeKey = "locale"; -export const localeFallback = browser - ? window.navigator.language - : 'en-US'; +export const localeFallback = browser ? window.navigator.language : "en-US"; export const getLocaleForSSR = (page?: Page>): string[] => { return page?.url.searchParams.get(localeKey)?.split(",") ?? []; diff --git a/src/lib/utils/load-json.ts b/src/lib/utils/load-json.ts index d9e729a..607d277 100644 --- a/src/lib/utils/load-json.ts +++ b/src/lib/utils/load-json.ts @@ -1,9 +1,9 @@ -import type { ServerLoadEvent } from '@sveltejs/kit'; +import type { ServerLoadEvent } from "@sveltejs/kit"; export const loadJson = async ({ route, fetch }: ServerLoadEvent) => { try { - const isNumberFormat = route.id?.includes('NumberFormat'); - const routeName = isNumberFormat ? '/NumberFormat' : route.id; + const isNumberFormat = route.id?.includes("NumberFormat"); + const routeName = isNumberFormat ? "/NumberFormat" : route.id; const response = await fetch(`${routeName}-compat-data.json`); return response.json(); } catch (e: unknown) { diff --git a/src/lib/utils/write-compat-data.ts b/src/lib/utils/write-compat-data.ts index cee9e10..5bedb76 100644 --- a/src/lib/utils/write-compat-data.ts +++ b/src/lib/utils/write-compat-data.ts @@ -1,6 +1,6 @@ -import { formatMethods, type FormatMethodsKeys } from '$lib/format-methods'; -import { writeFile } from 'node:fs'; -import { resolve } from 'node:path'; +import { formatMethods, type FormatMethodsKeys } from "$lib/format-methods"; +import { writeFile } from "node:fs"; +import { resolve } from "node:path"; import bcd, { type BrowserName, type Browsers, @@ -10,12 +10,12 @@ import bcd, { type Identifier, type SimpleSupportStatement, type SupportStatement -} from '@mdn/browser-compat-data'; +} from "@mdn/browser-compat-data"; import type { BrowserSupportDataForMethod, BrowserCoverage, - BrowserReleaseData, -} from '$lib/types/BrowserSupport.types'; + BrowserReleaseData +} from "$lib/types/BrowserSupport.types"; const browserTypePosition: Record = { desktop: 0, @@ -24,12 +24,12 @@ const browserTypePosition: Record = { xr: 4 }; -const excludedBrowserNames: BrowserName[] = ['ie', 'oculus']; +const excludedBrowserNames: BrowserName[] = ["ie", "oculus"]; const secondaryFormatterNames = [ - 'formatRange', - 'formatToParts', - 'formatRangeToParts', - 'selectRange' + "formatRange", + "formatToParts", + "formatRangeToParts", + "selectRange" ]; const compatKey = "__compat"; @@ -58,16 +58,17 @@ const getSupportDataForProperty = (value: Identifier) => { const getPropertiesForMethod = (compatData: CompatData, property: MethodsToWriteFor) => { const allPropertiesOnMethod = compatData.javascript.builtins.Intl[property]; - return Object.entries(allPropertiesOnMethod) - .filter(([key]) => key !== property && !excludedPropertiesOnMethod.includes(key)) -} + return Object.entries(allPropertiesOnMethod).filter( + ([key]) => key !== property && !excludedPropertiesOnMethod.includes(key) + ); +}; const getOptionsForProperty = (compatData: CompatData, property: MethodsToWriteFor) => { const allPropertiesOnMethod = compatData.javascript.builtins.Intl[property][property]; - const options = Object.entries(allPropertiesOnMethod).filter(([key]) => key.includes('options')); - const hasNestedObjectProperty = options && options[0] && options[0][0] === 'options_parameter'; + const options = Object.entries(allPropertiesOnMethod).filter(([key]) => key.includes("options")); + const hasNestedObjectProperty = options && options[0] && options[0][0] === "options_parameter"; if (hasNestedObjectProperty) { - return Object.entries(options[0][1]).filter(([key]) => key.includes('options')); + return Object.entries(options[0][1]).filter(([key]) => key.includes("options")); } return options; }; @@ -81,18 +82,16 @@ const getFormattersForProperty = (compatData: CompatData, property: MethodsToWri const browserToSupportData = (browsers: Browsers) => - ( - [browserName, data]: [BrowserName, SupportStatement], - ): [BrowserName, BrowserReleaseData] => { - const versionAdded = getPropertyFromSupportStatement(data, 'version_added'); - const browser = browsers[browserName]; - const supportData: BrowserReleaseData = { - browserName: browser.name, - versionAdded, - browserType: browser.type, - }; - return [browserName, supportData]; + ([browserName, data]: [BrowserName, SupportStatement]): [BrowserName, BrowserReleaseData] => { + const versionAdded = getPropertyFromSupportStatement(data, "version_added"); + const browser = browsers[browserName]; + const supportData: BrowserReleaseData = { + browserName: browser.name, + versionAdded, + browserType: browser.type }; + return [browserName, supportData]; + }; const sortCompatData = ( [, aData]: [BrowserName, BrowserReleaseData], @@ -105,39 +104,37 @@ const filterExludedBrowsers = ([browserName]: [BrowserName, SupportStatement]) = !excludedBrowserNames.includes(browserName); export const getCoverage = (data: [BrowserName, BrowserReleaseData][]): BrowserCoverage => { - const withVersion = data - .filter(([, browserSupport]) => Boolean(browserSupport.versionAdded)) + const withVersion = data.filter(([, browserSupport]) => Boolean(browserSupport.versionAdded)); if (withVersion.length === 0) { return "none"; } if (withVersion.length === data.length) { return "full"; } - return "partial" -} + return "partial"; +}; const optionKeyFormatter = (key: string) => { const [, option] = key.split("_"); return option; -} - -const formatSupportData = ( - browsers: Browsers, - keyFormatter?: (key: string) => string -) => ([key, value]: [string, Identifier | CompatStatement]) => { - const supportDataForOption = getSupportDataForProperty(value as unknown as Identifier); - const formattedOptions = supportDataForOption - .filter(filterExludedBrowsers) - .map(browserToSupportData(browsers)) - .sort(sortCompatData); - return [ - keyFormatter ? keyFormatter(key) : key, - { - coverage: getCoverage(formattedOptions), - support: Object.fromEntries(formattedOptions) - } - ]; -} +}; + +const formatSupportData = + (browsers: Browsers, keyFormatter?: (key: string) => string) => + ([key, value]: [string, Identifier | CompatStatement]) => { + const supportDataForOption = getSupportDataForProperty(value as unknown as Identifier); + const formattedOptions = supportDataForOption + .filter(filterExludedBrowsers) + .map(browserToSupportData(browsers)) + .sort(sortCompatData); + return [ + keyFormatter ? keyFormatter(key) : key, + { + coverage: getCoverage(formattedOptions), + support: Object.fromEntries(formattedOptions) + } + ]; + }; const getCompatDataWithBrowserData = ( compatData: CompatData, @@ -152,10 +149,10 @@ const getCompatDataWithBrowserData = ( const options = getOptionsForProperty(compatData, property).map( formatSupportData(browsers, optionKeyFormatter) ); - const formatters = getFormattersForProperty(compatData, property) - .map(formatSupportData(browsers)); - const properties = getPropertiesForMethod(compatData, property) - .map(formatSupportData(browsers)); + const formatters = getFormattersForProperty(compatData, property).map( + formatSupportData(browsers) + ); + const properties = getPropertiesForMethod(compatData, property).map(formatSupportData(browsers)); return { mdnUrl: propertyData?.__compat?.mdn_url, specUrl: propertyData?.__compat?.spec_url, @@ -165,7 +162,7 @@ const getCompatDataWithBrowserData = ( formattersSupport: Object.fromEntries(formatters), propertiesSupport: shouldAddPropertiesSupport(property) ? Object.fromEntries(properties) - : undefined, + : undefined }; }; @@ -175,7 +172,7 @@ export const writeCompatData = () => { getCompatDataWithBrowserData(bcd, method) ]); writeFile( - resolve(process.cwd(), 'static', `Playground-compat-data.json`), + resolve(process.cwd(), "static", `Playground-compat-data.json`), JSON.stringify(Object.fromEntries(writeData.filter(([key]) => key !== "Locale"))), (error) => { if (error) { @@ -184,9 +181,9 @@ export const writeCompatData = () => { } ); writeData.forEach(([method, data]) => { - if(method === "NumberFormat") { + if (method === "NumberFormat") { writeFile( - resolve(process.cwd(), 'static', 'NumberFormat', 'NumberFormat-compat-data.json'), + resolve(process.cwd(), "static", "NumberFormat", "NumberFormat-compat-data.json"), JSON.stringify(data), (error) => { if (error) { @@ -196,7 +193,7 @@ export const writeCompatData = () => { ); } writeFile( - resolve(process.cwd(), 'static', `${method}-compat-data.json`), + resolve(process.cwd(), "static", `${method}-compat-data.json`), JSON.stringify(data), (error) => { if (error) { diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index c2af54b..c65937f 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,37 +1,37 @@ - {routeId ?? 'Intl Explorer'} + {routeId ?? "Intl Explorer"} {#if !dev} @@ -10,7 +10,7 @@ Intl Explorer -{#if $navigating } +{#if $navigating} {/if} @@ -20,21 +20,25 @@

- Intl Explorer {m.blurbPart1()} - ECMAScript Internationalization API. {m.blurbPart2()} Intl {m.blurbPart3()} + Intl Explorer + {m.blurbPart1()} + ECMAScript Internationalization API. {m.blurbPart2()} Intl + {m.blurbPart3()}

- {m.blurbPart4()} The Playground {m.blurbPart5()} + {m.blurbPart4()} The Playground + {m.blurbPart5()}

- {m.blurbPart6()} GitHubGitHub. {m.blurbPart7()} Jesper Orb.

diff --git a/src/routes/Collator/+page.server.ts b/src/routes/Collator/+page.server.ts index 950b59a..6790c07 100644 --- a/src/routes/Collator/+page.server.ts +++ b/src/routes/Collator/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import { loadJson } from '$lib/utils/load-json'; -import type { ServerLoadEvent } from '@sveltejs/kit'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import { loadJson } from "$lib/utils/load-json"; +import type { ServerLoadEvent } from "@sveltejs/kit"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/Collator/+page.svelte b/src/routes/Collator/+page.svelte index 2c2b7b2..c1cdf52 100644 --- a/src/routes/Collator/+page.svelte +++ b/src/routes/Collator/+page.svelte @@ -1,12 +1,11 @@ {#if $settings.showBrowserSupport} @@ -20,4 +18,3 @@ {/if} - diff --git a/src/routes/DisplayNames/+page.server.ts b/src/routes/DisplayNames/+page.server.ts index 950b59a..6790c07 100644 --- a/src/routes/DisplayNames/+page.server.ts +++ b/src/routes/DisplayNames/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import { loadJson } from '$lib/utils/load-json'; -import type { ServerLoadEvent } from '@sveltejs/kit'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import { loadJson } from "$lib/utils/load-json"; +import type { ServerLoadEvent } from "@sveltejs/kit"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/DisplayNames/+page.svelte b/src/routes/DisplayNames/+page.svelte index 043df22..fd64881 100644 --- a/src/routes/DisplayNames/+page.svelte +++ b/src/routes/DisplayNames/+page.svelte @@ -1,14 +1,13 @@ {#if $settings.showBrowserSupport} @@ -17,5 +16,3 @@ {/if} - - diff --git a/src/routes/DurationFormat/+page.server.ts b/src/routes/DurationFormat/+page.server.ts index 8712bd3..969d730 100644 --- a/src/routes/DurationFormat/+page.server.ts +++ b/src/routes/DurationFormat/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import { loadJson } from '$lib/utils/load-json'; -import type { ServerLoadEvent } from '@sveltejs/kit'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import { loadJson } from "$lib/utils/load-json"; +import type { ServerLoadEvent } from "@sveltejs/kit"; export const ssr = false; diff --git a/src/routes/DurationFormat/+page.svelte b/src/routes/DurationFormat/+page.svelte index 0910c0e..a7aa69e 100644 --- a/src/routes/DurationFormat/+page.svelte +++ b/src/routes/DurationFormat/+page.svelte @@ -1,16 +1,15 @@ {#if $settings.showBrowserSupport} diff --git a/src/routes/ListFormat/+page.server.ts b/src/routes/ListFormat/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/ListFormat/+page.server.ts +++ b/src/routes/ListFormat/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/ListFormat/+page.svelte b/src/routes/ListFormat/+page.svelte index 0ebbb8d..18941b2 100644 --- a/src/routes/ListFormat/+page.svelte +++ b/src/routes/ListFormat/+page.svelte @@ -1,17 +1,15 @@ {#if $settings.showBrowserSupport} diff --git a/src/routes/Locale/+page.server.ts b/src/routes/Locale/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/Locale/+page.server.ts +++ b/src/routes/Locale/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/Locale/+page.svelte b/src/routes/Locale/+page.svelte index 7891b30..406ec94 100644 --- a/src/routes/Locale/+page.svelte +++ b/src/routes/Locale/+page.svelte @@ -4,12 +4,11 @@ import Spacing from "$lib/components/ui/Spacing.svelte"; import { settings } from "$lib/store/settings"; - import type { PageData } from './$types'; + import type { PageData } from "./$types"; export let data: PageData; let browserCompatData = $settings.showBrowserSupport ? data : null; - {#if $settings.showBrowserSupport} @@ -18,4 +17,3 @@ {/if} - diff --git a/src/routes/NumberFormat/+page.server.ts b/src/routes/NumberFormat/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/NumberFormat/+page.server.ts +++ b/src/routes/NumberFormat/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/NumberFormat/+page.svelte b/src/routes/NumberFormat/+page.svelte index 5889ccb..2f825db 100644 --- a/src/routes/NumberFormat/+page.svelte +++ b/src/routes/NumberFormat/+page.svelte @@ -1,19 +1,18 @@ {#if $settings.showBrowserSupport} @@ -21,8 +20,8 @@ {/if}

- {m.seeAlso()} Currency {m.and()} Unit. + {m.seeAlso()} Currency + {m.and()} Unit.

- diff --git a/src/routes/NumberFormat/Currency/+page.server.ts b/src/routes/NumberFormat/Currency/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/NumberFormat/Currency/+page.server.ts +++ b/src/routes/NumberFormat/Currency/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/NumberFormat/Currency/+page.svelte b/src/routes/NumberFormat/Currency/+page.svelte index b7c814f..0833b28 100644 --- a/src/routes/NumberFormat/Currency/+page.svelte +++ b/src/routes/NumberFormat/Currency/+page.svelte @@ -1,17 +1,15 @@ {#if $settings.showBrowserSupport} diff --git a/src/routes/NumberFormat/Unit/+page.server.ts b/src/routes/NumberFormat/Unit/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/NumberFormat/Unit/+page.server.ts +++ b/src/routes/NumberFormat/Unit/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/NumberFormat/Unit/+page.svelte b/src/routes/NumberFormat/Unit/+page.svelte index cf493bb..a03c2f9 100644 --- a/src/routes/NumberFormat/Unit/+page.svelte +++ b/src/routes/NumberFormat/Unit/+page.svelte @@ -1,25 +1,20 @@ - {#if $settings.showBrowserSupport} {/if} - - diff --git a/src/routes/Playground/+page.server.ts b/src/routes/Playground/+page.server.ts index f659d3b..d17b5ec 100644 --- a/src/routes/Playground/+page.server.ts +++ b/src/routes/Playground/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export const prerender = false; export const ssr = false; diff --git a/src/routes/Playground/+page.svelte b/src/routes/Playground/+page.svelte index 3a3c00f..9557204 100644 --- a/src/routes/Playground/+page.svelte +++ b/src/routes/Playground/+page.svelte @@ -1,19 +1,18 @@ - {#if $settings.codeTheme === "light"} + {#if $settings.codeTheme === "light"} {@html github} {:else} {@html oceanicNext} diff --git a/src/routes/PluralRules/+page.server.ts b/src/routes/PluralRules/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/PluralRules/+page.server.ts +++ b/src/routes/PluralRules/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/PluralRules/+page.svelte b/src/routes/PluralRules/+page.svelte index 10e3d79..56517c8 100644 --- a/src/routes/PluralRules/+page.svelte +++ b/src/routes/PluralRules/+page.svelte @@ -1,17 +1,15 @@ {#if $settings.showBrowserSupport} @@ -20,5 +18,3 @@ {/if} - - diff --git a/src/routes/RelativeTimeFormat/+page.server.ts b/src/routes/RelativeTimeFormat/+page.server.ts index 620ecc4..717d0af 100644 --- a/src/routes/RelativeTimeFormat/+page.server.ts +++ b/src/routes/RelativeTimeFormat/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import type { ServerLoadEvent } from '@sveltejs/kit'; -import { loadJson } from '$lib/utils/load-json'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import type { ServerLoadEvent } from "@sveltejs/kit"; +import { loadJson } from "$lib/utils/load-json"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/RelativeTimeFormat/+page.svelte b/src/routes/RelativeTimeFormat/+page.svelte index 992fdfe..3388462 100644 --- a/src/routes/RelativeTimeFormat/+page.svelte +++ b/src/routes/RelativeTimeFormat/+page.svelte @@ -1,16 +1,15 @@ - {#if $settings.showBrowserSupport} diff --git a/src/routes/Segmenter/+page.server.ts b/src/routes/Segmenter/+page.server.ts index 950b59a..6790c07 100644 --- a/src/routes/Segmenter/+page.server.ts +++ b/src/routes/Segmenter/+page.server.ts @@ -1,6 +1,6 @@ -import type { BrowserSupportDataForMethod } from '$lib/types/BrowserSupport.types'; -import { loadJson } from '$lib/utils/load-json'; -import type { ServerLoadEvent } from '@sveltejs/kit'; +import type { BrowserSupportDataForMethod } from "$lib/types/BrowserSupport.types"; +import { loadJson } from "$lib/utils/load-json"; +import type { ServerLoadEvent } from "@sveltejs/kit"; export async function load(loadEvent: ServerLoadEvent): Promise { return loadJson(loadEvent); diff --git a/src/routes/Segmenter/+page.svelte b/src/routes/Segmenter/+page.svelte index ee0c597..3e3c44f 100644 --- a/src/routes/Segmenter/+page.svelte +++ b/src/routes/Segmenter/+page.svelte @@ -1,17 +1,17 @@ + {#if $settings.showBrowserSupport} diff --git a/src/routes/utils/+server.ts b/src/routes/utils/+server.ts index 4422a0c..813f4dd 100644 --- a/src/routes/utils/+server.ts +++ b/src/routes/utils/+server.ts @@ -1,12 +1,12 @@ -import { writeCompatData } from '$lib/utils/write-compat-data'; -import type { RequestEvent } from '@sveltejs/kit'; +import { writeCompatData } from "$lib/utils/write-compat-data"; +import type { RequestEvent } from "@sveltejs/kit"; export function POST(event: RequestEvent) { - const secret = event.url.searchParams.get('secret'); + const secret = event.url.searchParams.get("secret"); const envSecret = process.env.SECRET; if (envSecret && secret && secret === process.env.SECRET) { writeCompatData(); - return new Response('ok'); + return new Response("ok"); } - return new Response('no no'); + return new Response("no no"); } diff --git a/static/NumberFormat/NumberFormat-compat-data.json b/static/NumberFormat/NumberFormat-compat-data.json index 91160db..0433223 100644 --- a/static/NumberFormat/NumberFormat-compat-data.json +++ b/static/NumberFormat/NumberFormat-compat-data.json @@ -1 +1,1052 @@ -{"mdnUrl":"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat","specUrl":"https://tc39.es/ecma402/#numberformat-objects","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}},"coverage":"full","optionsSupport":{"compactDisplay":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"currencyDisplay":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"currencySign":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"currency":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"localeMatcher":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"maximumFractionDigits":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"maximumSignificantDigits":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"minimumFractionDigits":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"minimumIntegerDigits":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"minimumSignificantDigits":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"notation":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"numberingSystem":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"roundingIncrement":{"coverage":"partial","support":{"chrome":{"browserName":"Chrome","versionAdded":"106","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"106","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"116","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"92","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"15.4","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"106","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"116","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"72","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"15.4","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"20.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"106","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":false,"browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"19.0.0","browserType":"server"}}},"roundingMode":{"coverage":"partial","support":{"chrome":{"browserName":"Chrome","versionAdded":"106","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"106","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"116","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"92","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"15.4","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"106","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"116","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"72","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"15.4","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"20.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"106","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":false,"browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"19.0.0","browserType":"server"}}},"roundingPriority":{"coverage":"partial","support":{"chrome":{"browserName":"Chrome","versionAdded":"106","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"106","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"116","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"92","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"15.4","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"106","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"116","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"72","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"15.4","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"20.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"106","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":false,"browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"19.0.0","browserType":"server"}}},"signDisplay":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"style":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"0.12.0","browserType":"server"}}},"trailingZeroDisplay":{"coverage":"partial","support":{"chrome":{"browserName":"Chrome","versionAdded":"106","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"106","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"116","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"92","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"15.4","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"106","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"116","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"72","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"15.4","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"20.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"106","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":false,"browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"19.0.0","browserType":"server"}}},"unitDisplay":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"unit":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"77","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"79","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"78","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"64","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"14.1","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"77","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"79","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"55","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"14.5","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"12.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"77","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"12.11.0","browserType":"server"}}},"useGrouping":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"24","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"29","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"15","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"10","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"25","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"56","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"14","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"10","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"1.5","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"4.4","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"13.0.0","browserType":"server"}}}},"formattersSupport":{"formatRange":{"coverage":"partial","support":{"chrome":{"browserName":"Chrome","versionAdded":"106","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"106","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"116","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"92","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"15.4","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"106","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"116","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"72","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"15.4","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"20.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"106","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":false,"browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"19.0.0","browserType":"server"}}},"formatRangeToParts":{"coverage":"partial","support":{"chrome":{"browserName":"Chrome","versionAdded":"106","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"106","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"116","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"92","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"15.4","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"106","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"116","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"72","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"15.4","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"20.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"106","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":false,"browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"19.0.0","browserType":"server"}}},"formatToParts":{"coverage":"full","support":{"chrome":{"browserName":"Chrome","versionAdded":"64","browserType":"desktop"},"edge":{"browserName":"Edge","versionAdded":"12","browserType":"desktop"},"firefox":{"browserName":"Firefox","versionAdded":"58","browserType":"desktop"},"opera":{"browserName":"Opera","versionAdded":"51","browserType":"desktop"},"safari":{"browserName":"Safari","versionAdded":"13","browserType":"desktop"},"chrome_android":{"browserName":"Chrome Android","versionAdded":"64","browserType":"mobile"},"firefox_android":{"browserName":"Firefox for Android","versionAdded":"58","browserType":"mobile"},"opera_android":{"browserName":"Opera Android","versionAdded":"47","browserType":"mobile"},"safari_ios":{"browserName":"Safari on iOS","versionAdded":"13","browserType":"mobile"},"samsunginternet_android":{"browserName":"Samsung Internet","versionAdded":"9.0","browserType":"mobile"},"webview_android":{"browserName":"WebView Android","versionAdded":"64","browserType":"mobile"},"deno":{"browserName":"Deno","versionAdded":"1.8","browserType":"server"},"nodejs":{"browserName":"Node.js","versionAdded":"10.0.0","browserType":"server"}}}}} \ No newline at end of file +{ + "mdnUrl": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat", + "specUrl": "https://tc39.es/ecma402/#numberformat-objects", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { "browserName": "Safari on iOS", "versionAdded": "10", "browserType": "mobile" }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + }, + "coverage": "full", + "optionsSupport": { + "compactDisplay": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "currencyDisplay": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "currencySign": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "currency": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "localeMatcher": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "maximumFractionDigits": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "maximumSignificantDigits": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "minimumFractionDigits": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "minimumIntegerDigits": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "minimumSignificantDigits": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "notation": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "numberingSystem": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "roundingIncrement": { + "coverage": "partial", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "106", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "106", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "116", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "92", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "15.4", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "116", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "72", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "15.4", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "20.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": false, "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "19.0.0", "browserType": "server" } + } + }, + "roundingMode": { + "coverage": "partial", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "106", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "106", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "116", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "92", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "15.4", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "116", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "72", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "15.4", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "20.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": false, "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "19.0.0", "browserType": "server" } + } + }, + "roundingPriority": { + "coverage": "partial", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "106", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "106", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "116", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "92", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "15.4", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "116", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "72", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "15.4", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "20.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": false, "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "19.0.0", "browserType": "server" } + } + }, + "signDisplay": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "style": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "0.12.0", "browserType": "server" } + } + }, + "trailingZeroDisplay": { + "coverage": "partial", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "106", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "106", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "116", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "92", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "15.4", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "116", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "72", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "15.4", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "20.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": false, "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "19.0.0", "browserType": "server" } + } + }, + "unitDisplay": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "unit": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "77", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "79", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "78", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "64", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "14.1", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "79", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "55", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "14.5", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "12.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "77", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "12.11.0", "browserType": "server" } + } + }, + "useGrouping": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "24", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "29", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "15", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "10", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "25", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "56", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "14", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "10", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "1.5", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "4.4", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "13.0.0", "browserType": "server" } + } + } + }, + "formattersSupport": { + "formatRange": { + "coverage": "partial", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "106", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "106", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "116", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "92", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "15.4", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "116", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "72", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "15.4", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "20.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": false, "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "19.0.0", "browserType": "server" } + } + }, + "formatRangeToParts": { + "coverage": "partial", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "106", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "106", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "116", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "92", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "15.4", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "116", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "72", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "15.4", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "20.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "106", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": false, "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "19.0.0", "browserType": "server" } + } + }, + "formatToParts": { + "coverage": "full", + "support": { + "chrome": { "browserName": "Chrome", "versionAdded": "64", "browserType": "desktop" }, + "edge": { "browserName": "Edge", "versionAdded": "12", "browserType": "desktop" }, + "firefox": { "browserName": "Firefox", "versionAdded": "58", "browserType": "desktop" }, + "opera": { "browserName": "Opera", "versionAdded": "51", "browserType": "desktop" }, + "safari": { "browserName": "Safari", "versionAdded": "13", "browserType": "desktop" }, + "chrome_android": { + "browserName": "Chrome Android", + "versionAdded": "64", + "browserType": "mobile" + }, + "firefox_android": { + "browserName": "Firefox for Android", + "versionAdded": "58", + "browserType": "mobile" + }, + "opera_android": { + "browserName": "Opera Android", + "versionAdded": "47", + "browserType": "mobile" + }, + "safari_ios": { + "browserName": "Safari on iOS", + "versionAdded": "13", + "browserType": "mobile" + }, + "samsunginternet_android": { + "browserName": "Samsung Internet", + "versionAdded": "9.0", + "browserType": "mobile" + }, + "webview_android": { + "browserName": "WebView Android", + "versionAdded": "64", + "browserType": "mobile" + }, + "deno": { "browserName": "Deno", "versionAdded": "1.8", "browserType": "server" }, + "nodejs": { "browserName": "Node.js", "versionAdded": "10.0.0", "browserType": "server" } + } + } + } +} diff --git a/svelte.config.js b/svelte.config.js index fab2964..7bfd7b1 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,5 @@ -import adapter from '@sveltejs/adapter-vercel'; -import preprocess from 'svelte-preprocess'; +import adapter from "@sveltejs/adapter-vercel"; +import preprocess from "svelte-preprocess"; /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -11,7 +11,13 @@ const config = { adapter: adapter(), alias: { $paraglide: "./src/paraglide", - }, + $ui: "./src/lib/components/ui", + $pages: "./src/lib/components/pages", + $utils: "./src/lib/utils", + $i18n: "./src/lib/i18n", + $store: "./src/lib/store", + $types: "./src/lib/types", + } } }; diff --git a/tests/IntlPage.ts b/tests/IntlPage.ts index 5e90a49..c3220cf 100644 --- a/tests/IntlPage.ts +++ b/tests/IntlPage.ts @@ -1,7 +1,7 @@ -import { expect, type Page } from '@playwright/test'; -import { defaultPageUnderTest, localBaseURL, mdnUrl } from './contstants'; -import { checkA11y } from 'axe-playwright'; -import { testIds } from '../src/lib/utils/dom-utils'; +import { expect, type Page } from "@playwright/test"; +import { defaultPageUnderTest, localBaseURL, mdnUrl } from "./contstants"; +import { checkA11y } from "axe-playwright"; +import { testIds } from "../src/lib/utils/dom-utils"; export type IntlPageConfig = { page: Page; @@ -16,7 +16,7 @@ export class IntlPage { private pageUnderTest: string; public page: Page; - constructor({ page, tabKey = 'Tab', baseURL }: IntlPageConfig) { + constructor({ page, tabKey = "Tab", baseURL }: IntlPageConfig) { this.page = page; this.tabKey = tabKey; this.baseURL = baseURL ?? localBaseURL; @@ -36,10 +36,10 @@ export class IntlPage { } private getUrl(method: string, locale?: string): string { - return `${this.baseURL}/${method}?locale=${locale ?? 'en-US'}`; + return `${this.baseURL}/${method}?locale=${locale ?? "en-US"}`; } - public async goToHome(){ + public async goToHome() { await this.page.goto(this.baseURL); } @@ -55,11 +55,11 @@ export class IntlPage { } public async assertTitle(prefix = true) { - expect(await this.page.textContent('h1')).toBe(`${prefix ? "Intl." : ""}${this.pageUnderTest}`); + expect(await this.page.textContent("h1")).toBe(`${prefix ? "Intl." : ""}${this.pageUnderTest}`); } public async assertMDNLink() { - expect(await this.page.textContent('h1')).toBe(`Intl.${this.pageUnderTest}`); + expect(await this.page.textContent("h1")).toBe(`Intl.${this.pageUnderTest}`); expect(await this.page.textContent(this.getMDNLinkLocator(this.pageUnderTest))).toBe( this.getMDNLinkText(this.pageUnderTest) ); @@ -85,4 +85,4 @@ export class IntlPage { detailedReportOptions: { html: true } }); } -} \ No newline at end of file +} diff --git a/tests/contstants.ts b/tests/contstants.ts index 3c714b3..ff37f82 100644 --- a/tests/contstants.ts +++ b/tests/contstants.ts @@ -1,4 +1,5 @@ -export const mdnUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl'; -export const localePort = '5173' -export const localBaseURL = `http://localhost:${localePort}` -export const defaultPageUnderTest = '/'; \ No newline at end of file +export const mdnUrl = + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl"; +export const localePort = "5173"; +export const localBaseURL = `http://localhost:${localePort}`; +export const defaultPageUnderTest = "/"; diff --git a/tests/pages.spec.ts b/tests/pages.spec.ts index 141630d..e227d3a 100644 --- a/tests/pages.spec.ts +++ b/tests/pages.spec.ts @@ -1,27 +1,27 @@ -import { formatMethods } from '../src/lib/format-methods'; -import { test } from './test'; +import { formatMethods } from "../src/lib/format-methods"; +import { test } from "./test"; test.describe("Pages", () => { - formatMethods.forEach(method => { + formatMethods.forEach((method) => { test(method, async ({ intlPage }) => { await test.step("Setup", async () => { intlPage.setPageUnderTest(method); await intlPage.goToPage(); - }) + }); await test.step("Check a11y", async () => { await intlPage.checkAlly(); - }) - }) - }) -}) + }); + }); + }); +}); test("Playground", async ({ intlPage }) => { await test.step("Setup", async () => { intlPage.setPageUnderTest("Playground"); await intlPage.clickOnNavigationLink(); - await intlPage.page.waitForURL("**/Playground?locale=en-US") - }) + await intlPage.page.waitForURL("**/Playground?locale=en-US"); + }); await test.step("Check a11y", async () => { await intlPage.checkAlly(); - }) -}) + }); +}); diff --git a/tests/test.ts b/tests/test.ts index 5c03abc..48e1700 100644 --- a/tests/test.ts +++ b/tests/test.ts @@ -1,14 +1,14 @@ -import { test as base } from '@playwright/test'; -import { IntlPage } from './IntlPage'; -import { injectAxe } from 'axe-playwright'; +import { test as base } from "@playwright/test"; +import { IntlPage } from "./IntlPage"; +import { injectAxe } from "axe-playwright"; export const test = base.extend<{ intlPage: IntlPage }>({ - intlPage: async ({ page }, use) => { - const intlPage = new IntlPage({ page }) - await intlPage.goToHome(); - await injectAxe(intlPage.page); - await use(intlPage); - } -}) + intlPage: async ({ page }, use) => { + const intlPage = new IntlPage({ page }); + await intlPage.goToHome(); + await injectAxe(intlPage.page); + await use(intlPage); + } +}); -export { expect } from '@playwright/test'; \ No newline at end of file +export { expect } from "@playwright/test"; diff --git a/vite.config.ts b/vite.config.ts index 1de3788..7bf9f0c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,18 +1,18 @@ -import { sveltekit } from '@sveltejs/kit/vite'; -import type { UserConfig } from 'vite'; -import { defineConfig, mergeConfig } from 'vitest/config'; -import { paraglide } from "@inlang/paraglide-js-adapter-sveltekit/vite" +import { sveltekit } from "@sveltejs/kit/vite"; +import type { UserConfig } from "vite"; +import { defineConfig, mergeConfig } from "vitest/config"; +import { paraglide } from "@inlang/paraglide-js-adapter-sveltekit/vite"; const config: UserConfig = { plugins: [ sveltekit(), paraglide({ project: "./project.inlang", - outdir: "./src/paraglide", - }), + outdir: "./src/paraglide" + }) ], optimizeDeps: { - include: ['highlight.js', 'highlight.js/lib/core'] + include: ["highlight.js", "highlight.js/lib/core"] } }; @@ -20,8 +20,8 @@ export default mergeConfig( config, defineConfig({ test: { - environment: 'jsdom', - include: ['src/**/*.{test,spec}.ts'] + environment: "jsdom", + include: ["src/**/*.{test,spec}.ts"] } }) );