web: project monolith, localization extracted

This commit is contained in:
Ken Sternberg 2023-12-22 09:21:57 -08:00
parent ac6b8e9d80
commit 57cbcf6899
38 changed files with 17282 additions and 135 deletions

View File

@ -1,6 +1,7 @@
module.exports = {
pipeline: {
build: ["^build"],
lint: ["^lint"],
"build": ["^build"],
"lint": ["^lint"],
"localize": ["^localization:extract"],
},
};

73
web/package-lock.json generated
View File

@ -9,7 +9,8 @@
"version": "0.0.0",
"license": "MIT",
"workspaces": [
"packages/monolith"
"packages/monolith",
"packages/localization"
],
"dependencies": {
"@manypkg/cli": "^0.21.1",
@ -2148,12 +2149,10 @@
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"aix"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -2671,6 +2670,10 @@
"node_modules/@goauthentik/api": {
"version": "2023.10.5-1703167718"
},
"node_modules/@goauthentik/localization": {
"resolved": "packages/localization",
"link": true
},
"node_modules/@goauthentik/monolith": {
"resolved": "packages/monolith",
"link": true
@ -9830,10 +9833,9 @@
},
"node_modules/esbuild": {
"version": "0.19.10",
"dev": true,
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.10.tgz",
"integrity": "sha512-S1Y27QGt/snkNYrRcswgRFqZjaTG5a5xM3EQo97uNBnH505pdzSNe/HLBq1v0RO7iK/ngdbhJB6mDAp0OK+iUA==",
"hasInstallScript": true,
"license": "MIT",
"peer": true,
"bin": {
"esbuild": "bin/esbuild"
},
@ -9889,12 +9891,10 @@
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -9906,12 +9906,10 @@
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -9923,12 +9921,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"android"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -9940,12 +9936,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -9957,12 +9951,10 @@
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -9974,12 +9966,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"freebsd"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -9991,12 +9981,10 @@
"cpu": [
"arm"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10008,12 +9996,10 @@
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10025,12 +10011,10 @@
"cpu": [
"loong64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10042,12 +10026,10 @@
"cpu": [
"mips64el"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10059,12 +10041,10 @@
"cpu": [
"ppc64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10076,12 +10056,10 @@
"cpu": [
"riscv64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10093,12 +10071,10 @@
"cpu": [
"s390x"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10110,12 +10086,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10127,12 +10101,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"netbsd"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10144,12 +10116,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"openbsd"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10161,12 +10131,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"sunos"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10178,12 +10146,10 @@
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10195,12 +10161,10 @@
"cpu": [
"ia32"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -10212,12 +10176,10 @@
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
],
"peer": true,
"engines": {
"node": ">=12"
}
@ -17332,8 +17294,9 @@
},
"node_modules/typescript": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@ -18144,6 +18107,20 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"packages/localization": {
"name": "@goauthentik/localization",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"esbuild": "^0.19.10"
},
"devDependencies": {
"@lit/localize-tools": "^0.7.1",
"prettier": "^3.1.1",
"pseudolocale": "^2.0.0",
"typescript": "^5.3.3"
}
},
"packages/monolith": {
"name": "@goauthentik/monolith",
"version": "0.0.0",
@ -18194,7 +18171,6 @@
"@hcaptcha/types": "^1.0.3",
"@jackfranklin/rollup-plugin-markdown": "^0.4.0",
"@jeysal/storybook-addon-css-user-preferences": "^0.2.0",
"@lit/localize-tools": "^0.7.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
@ -18226,7 +18202,6 @@
"lit-analyzer": "^2.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"pseudolocale": "^2.0.0",
"pyright": "=1.1.338",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View File

@ -5,7 +5,8 @@
"license": "MIT",
"scripts": {
"build": "lage build",
"lint": "lage lint"
"lint": "lage lint",
"localize": "lage localize"
},
"optionalDependencies": {
"@esbuild/darwin-arm64": "^0.19.10",
@ -17,7 +18,8 @@
"lage": "^2.7.9"
},
"workspaces": [
"packages/monolith"
"packages/monolith",
"packages/localization"
],
"engines": {
"node": ">=20"

1
web/packages/localization/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
scripts/pseudolocalize.js*

View File

@ -13,7 +13,7 @@
"zh-Hant",
"de"
],
"tsConfig": "./tsconfig.json",
"inputFiles": ["../monolith/src/**/*.ts"],
"output": {
"mode": "runtime",
"outputDir": "./src/locales",

View File

@ -0,0 +1,34 @@
{
"name": "@goauthentik/localization",
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"main": "./src/locale-codes.js",
"scripts": {
"localization:extract": "lit-localize extract",
"extract": "run-s localization-extract",
"build:localize": "lit-localize build",
"build": "run-s build:localize compile",
"compile": "esbuild src/locale-codes.ts --outfile=src/locale-codes.js",
"prettier": "prettier --write ./src/**/* ./package.json ./lit-localize.json",
"pseudolocalize:build-extract-script": "cd scripts && tsc --esModuleInterop --module es2020 --moduleResolution 'node' pseudolocalize.ts && mv pseudolocalize.js pseudolocalize.mjs",
"pseudolocalize:extract": "node scripts/pseudolocalize.mjs",
"pseudolocalize": "run-s pseudolocalize:build-extract-script pseudolocalize:extract"
},
"exports": {
".": "./src/locale-codes.js",
"./*": "./src/locales/*"
},
"files": [
"./src/"
],
"devDependencies": {
"@lit/localize-tools": "^0.7.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"pseudolocale": "^2.0.0",
"typescript": "^5.3.3",
"esbuild": "^0.19.10"
}
}

View File

@ -0,0 +1,27 @@
"use strict";
export const sourceLocale = `en`;
export const targetLocales = [
`de`,
`en`,
`es`,
`fr`,
`pl`,
`pseudo-LOCALE`,
`tr`,
`zh_TW`,
`zh-Hans`,
`zh-Hant`
];
export const allLocales = [
`de`,
`en`,
`en`,
`es`,
`fr`,
`pl`,
`pseudo-LOCALE`,
`tr`,
`zh_TW`,
`zh-Hans`,
`zh-Hant`
];

View File

@ -0,0 +1 @@
{"version":3,"file":"locale-codes.js","sourceRoot":"","sources":["locale-codes.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iDAAiD;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,eAAe;IACf,IAAI;IACJ,OAAO;IACP,SAAS;IACT,SAAS;CACD,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,eAAe;IACf,IAAI;IACJ,OAAO;IACP,SAAS;IACT,SAAS;CACD,CAAC"}

View File

@ -0,0 +1,41 @@
// Do not modify this file by hand!
// Re-generate this file by running lit-localize.
/**
* The locale code that templates in this source code are written in.
*/
export const sourceLocale = `en`;
/**
* The other locale codes that this application is localized into. Sorted
* lexicographically.
*/
export const targetLocales = [
`de`,
`en`,
`es`,
`fr`,
`pl`,
`pseudo-LOCALE`,
`tr`,
`zh_TW`,
`zh-Hans`,
`zh-Hant`,
] as const;
/**
* All valid project locale codes. Sorted lexicographically.
*/
export const allLocales = [
`de`,
`en`,
`en`,
`es`,
`fr`,
`pl`,
`pseudo-LOCALE`,
`tr`,
`zh_TW`,
`zh-Hans`,
`zh-Hant`,
] as const;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.base.json",
"include": ["./src/**/*.ts"]
}

View File

@ -1363,9 +1363,9 @@
<target>Aktualisieren</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Aktualisiere
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
<source>Select providers to add to application</source>
@ -2073,9 +2073,9 @@ doesn't pass when either or both of the selected options are equal or above the
<x id="0" equiv-text="${item.policyObj?.name}"/></target>
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Gruppe
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">
<source>User <x id="0" equiv-text="${item.userObj?.name}"/></source>

View File

@ -1431,9 +1431,9 @@
<target>Update</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Update
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
<source>Select providers to add to application</source>
@ -2181,9 +2181,9 @@ doesn't pass when either or both of the selected options are equal or above the
<x id="0" equiv-text="${item.policyObj?.name}"/></target>
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Group
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">
<source>User <x id="0" equiv-text="${item.userObj?.name}"/></source>

View File

@ -1337,9 +1337,9 @@
<target>Actualización</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Actualización
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
<source>Select providers to add to application</source>
@ -2039,9 +2039,9 @@ doesn't pass when either or both of the selected options are equal or above the
<x id="0" equiv-text="${item.policyObj?.name}"/></target>
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Grupo
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">
<source>User <x id="0" equiv-text="${item.userObj?.name}"/></source>

View File

@ -1782,9 +1782,9 @@ Il y a <x id="0" equiv-text="${ago}"/> jour(s)</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Mettre à jour
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
@ -2719,9 +2719,9 @@ doesn't pass when either or both of the selected options are equal or above the
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Groupe
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">

View File

@ -1783,8 +1783,8 @@
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<target>Update <x id="0" equiv-text="${item.verboseName}"/></target>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
@ -2960,8 +2960,8 @@ slaagt niet wanneer een of beide geselecteerde opties gelijk zijn aan of boven d
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<target>Groep <x id="0" equiv-text="${item.groupObj?.name}"/></target>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Groep <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">

View File

@ -1377,9 +1377,9 @@
<target>Aktualizuj</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Zaktualizuj
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
<source>Select providers to add to application</source>
@ -2111,9 +2111,9 @@ doesn't pass when either or both of the selected options are equal or above the
<x id="0" equiv-text="${item.policyObj?.name}"/></target>
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Grupa
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">
<source>User <x id="0" equiv-text="${item.userObj?.name}"/></source>

View File

@ -1764,8 +1764,8 @@
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<target>Ũƥďàţē <x id="0" equiv-text="${item.verboseName}"/></target>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Ũƥďàţē <x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
@ -2700,8 +2700,8 @@ doesn't pass when either or both of the selected options are equal or above the
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<target>Ĝŕōũƥ <x id="0" equiv-text="${item.groupObj?.name}"/></target>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Ĝŕōũƥ <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">

View File

@ -1336,9 +1336,9 @@
<target>Güncelleme</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>Güncelleme
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
<source>Select providers to add to application</source>
@ -2038,9 +2038,9 @@ doesn't pass when either or both of the selected options are equal or above the
<x id="0" equiv-text="${item.policyObj?.name}"/></target>
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>Grup
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">
<source>User <x id="0" equiv-text="${item.userObj?.name}"/></source>

View File

@ -1783,9 +1783,9 @@
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>更新
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
@ -2721,9 +2721,9 @@ doesn't pass when either or both of the selected options are equal or above the
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>组
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">

View File

@ -1349,9 +1349,9 @@
<target>更新</target>
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>更新
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
<source>Select providers to add to application</source>
@ -2058,9 +2058,9 @@ doesn't pass when either or both of the selected options are equal or above the
<x id="0" equiv-text="${item.policyObj?.name}"/></target>
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>组
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">
<source>User <x id="0" equiv-text="${item.userObj?.name}"/></source>

View File

@ -1783,9 +1783,9 @@
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>更新
<x id="0" equiv-text="${item.verboseName}"/></target>
<x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
@ -2726,9 +2726,9 @@ doesn't pass when either or both of the selected options are equal or above the
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>组
<x id="0" equiv-text="${item.groupObj?.name}"/></target>
<x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">

View File

@ -1765,8 +1765,8 @@
</trans-unit>
<trans-unit id="sc9175cb129fdc306">
<source>Update <x id="0" equiv-text="${item.verboseName}"/></source>
<target>更新 <x id="0" equiv-text="${item.verboseName}"/></target>
<source>Update <x id="0" equiv-text="${item.stageObj?.verboseName}"/></source>
<target>更新 <x id="0" equiv-text="${item.stageObj?.verboseName}"/></target>
</trans-unit>
<trans-unit id="s398f6ba74ba8943a">
@ -2700,8 +2700,8 @@ doesn't pass when either or both of the selected options are equal or above the
</trans-unit>
<trans-unit id="s2a64d2dca3da9b0e">
<source>Group <x id="0" equiv-text="${item.groupObj?.name}"/></source>
<target>群組 <x id="0" equiv-text="${item.groupObj?.name}"/></target>
<source>Group <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></source>
<target>群組 <x id="0" equiv-text="${this.group?.name || &quot;&quot;}"/></target>
</trans-unit>
<trans-unit id="se5dc026819a32ff8">

View File

@ -4,29 +4,21 @@
"private": true,
"license": "MIT",
"scripts": {
"extract-locales": "lit-localize extract",
"build-locales": "run-s build-locales:build",
"build-locales:build": "lit-localize build",
"build-locales:repair": "prettier --write ./src/locale-codes.ts",
"rollup:build": "cross-env NODE_OPTIONS='--max_old_space_size=4096' rollup -c ./rollup.config.mjs",
"rollup:build-proxy": "cross-env NODE_OPTIONS='--max_old_space_size=4096' rollup -c ./rollup.proxy.mjs",
"rollup:watch": "cross-env NODE_OPTIONS='--max_old_space_size=4096' rollup -c -w",
"build": "run-s build-locales rollup:build",
"build-proxy": "run-s build-locales rollup:build-proxy",
"watch": "run-s build-locales rollup:watch",
"build": "run-s rollup:build",
"build-proxy": "run-s rollup:build-proxy",
"watch": "run-s rollup:watch",
"lint": "eslint . --max-warnings 0 --fix",
"lint:precommit": "eslint --max-warnings 0 --config ./.eslintrc.precommit.json $(git status --porcelain . | grep '^[M?][M?]' | cut -c8- | grep -E '\\.(ts|js|tsx|jsx)$') ",
"lint:spelling": "codespell -D - -D ../../../.github/codespell-dictionary.txt -I ../../../.github/codespell-words.txt -S './src/locales/**' ./src -s",
"lint:spelling": "codespell -D - -D ../../../.github/codespell-dictionary.txt -I ../../../.github/codespell-words.txt ./src -s",
"lit-analyse": "lit-analyzer src",
"precommit": "run-s tsc lit-analyse lint:precommit lint:spelling prettier",
"prequick": "run-s tsc:execute lit-analyse lint:precommit lint:spelling",
"prettier-check": "prettier --check .",
"prettier": "prettier --write .",
"pseudolocalize:build-extract-script": "cd scripts && tsc --esModuleInterop --module es2020 --moduleResolution 'node' pseudolocalize.ts && mv pseudolocalize.js pseudolocalize.mjs",
"pseudolocalize:extract": "node scripts/pseudolocalize.mjs",
"pseudolocalize": "run-s pseudolocalize:build-extract-script pseudolocalize:extract",
"tsc:execute": "tsc --noEmit -p .",
"tsc": "run-s build-locales tsc:execute",
"tsc": "tsc --noEmit -p .",
"storybook": "storybook dev -p 6006",
"storybook:build": "cross-env NODE_OPTIONS='--max_old_space_size=4096' storybook build",
"storybook:build-import-map": "run-s storybook:build-import-map-script storybook:run-import-map-script",
@ -43,6 +35,7 @@
"@formatjs/intl-listformat": "^7.5.3",
"@fortawesome/fontawesome-free": "^6.5.1",
"@goauthentik/api": "^2023.10.5-1703167718",
"@goauthentik/localization": "*",
"@lit-labs/context": "^0.4.0",
"@lit-labs/task": "^3.1.0",
"@lit/localize": "^0.11.4",
@ -79,7 +72,6 @@
"@hcaptcha/types": "^1.0.3",
"@jackfranklin/rollup-plugin-markdown": "^0.4.0",
"@jeysal/storybook-addon-css-user-preferences": "^0.2.0",
"@lit/localize-tools": "^0.7.1",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
@ -111,7 +103,6 @@
"lit-analyzer": "^2.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.1",
"pseudolocale": "^2.0.0",
"pyright": "=1.1.338",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View File

@ -1,4 +1,4 @@
import { sourceLocale, targetLocales } from "@goauthentik/app/locale-codes";
import { sourceLocale, targetLocales } from "@goauthentik/localization";
import { configureLocalization } from "@lit/localize";

View File

@ -1,4 +1,4 @@
import * as _enLocale from "@goauthentik/locales/en";
import * as _enLocale from "@goauthentik/localization/en.js";
import type { LocaleModule } from "@lit/localize";
import { msg } from "@lit/localize";
@ -37,20 +37,20 @@ export { enLocale };
// prettier-ignore
const debug: LocaleRow = [
"pseudo-LOCALE", /^pseudo/i, () => msg("Pseudolocale (for testing)"), async () => await import("@goauthentik/locales/pseudo-LOCALE"),
"pseudo-LOCALE", /^pseudo/i, () => msg("Pseudolocale (for testing)"), async () => await import("@goauthentik/localization/pseudo-LOCALE.js"),
];
// prettier-ignore
const LOCALE_TABLE: LocaleRow[] = [
["en", /^en([_-]|$)/i, () => msg("English"), async () => await import("@goauthentik/locales/en")],
["es", /^es([_-]|$)/i, () => msg("Spanish"), async () => await import("@goauthentik/locales/es")],
["de", /^de([_-]|$)/i, () => msg("German"), async () => await import("@goauthentik/locales/de")],
["fr", /^fr([_-]|$)/i, () => msg("French"), async () => await import("@goauthentik/locales/fr")],
["pl", /^pl([_-]|$)/i, () => msg("Polish"), async () => await import("@goauthentik/locales/pl")],
["tr", /^tr([_-]|$)/i, () => msg("Turkish"), async () => await import("@goauthentik/locales/tr")],
["zh-Hant", /^zh[_-](HK|Hant)/i, () => msg("Chinese (traditional)"), async () => await import("@goauthentik/locales/zh-Hant")],
["zh_TW", /^zh[_-]TW$/i, () => msg("Taiwanese Mandarin"), async () => await import("@goauthentik/locales/zh_TW")],
["zh-Hans", /^zh(\b|_)/i, () => msg("Chinese (simplified)"), async () => await import("@goauthentik/locales/zh-Hans")],
["en", /^en([_-]|$)/i, () => msg("English"), async () => await import("@goauthentik/localization/en.js")],
["es", /^es([_-]|$)/i, () => msg("Spanish"), async () => await import("@goauthentik/localization/es.js")],
["de", /^de([_-]|$)/i, () => msg("German"), async () => await import("@goauthentik/localization/de.js")],
["fr", /^fr([_-]|$)/i, () => msg("French"), async () => await import("@goauthentik/localization/fr.js")],
["pl", /^pl([_-]|$)/i, () => msg("Polish"), async () => await import("@goauthentik/localization/pl.js")],
["tr", /^tr([_-]|$)/i, () => msg("Turkish"), async () => await import("@goauthentik/localization/tr.js")],
["zh-Hant", /^zh[_-](HK|Hant)/i, () => msg("Chinese (traditional)"), async () => await import("@goauthentik/localization/zh-Hant.js")],
["zh_TW", /^zh[_-]TW$/i, () => msg("Taiwanese Mandarin"), async () => await import("@goauthentik/localization/zh_TW.js")],
["zh-Hans", /^zh(\b|_)/i, () => msg("Chinese (simplified)"), async () => await import("@goauthentik/localization/zh-Hans.js")],
debug
];

View File

@ -14,7 +14,7 @@ const TOMBSTONE = "⛼⛼tombstone⛼⛼";
// application is first instantiated.
export const LOCALES = RAW_LOCALES.map((locale) =>
locale.code === "en" ? { ...locale, locale: async () => enLocale } : locale,
locale.code === "en" ? { ...locale, locale: async () => enLocale } : locale
);
export function getBestMatchLocale(locale: string): AkLocale | undefined {
@ -47,8 +47,8 @@ const isLocaleCandidate = (v: unknown): v is string =>
export function autoDetectLanguage(requestedCode?: string): string {
const localeCandidates: string[] = [
globalAK()?.locale ?? TOMBSTONE,
localeCodeFromUrl("locale"),
globalAK()?.locale ?? TOMBSTONE,
requestedCode ?? TOMBSTONE,
window.navigator?.language ?? TOMBSTONE,
DEFAULT_LOCALE,
@ -58,7 +58,7 @@ export function autoDetectLanguage(requestedCode?: string): string {
if (!firstSupportedLocale) {
console.debug(
`authentik/locale: No locale found for '[${localeCandidates}.join(',')]', falling back to ${DEFAULT_LOCALE}`,
`authentik/locale: No locale found for '[${localeCandidates}.join(',')]', falling back to ${DEFAULT_LOCALE}`
);
return DEFAULT_LOCALE;
}

View File

@ -9,7 +9,6 @@
"@goauthentik/docs/*": ["../../../website/docs/*"],
"@goauthentik/elements/*": ["./src/elements/*"],
"@goauthentik/flow/*": ["./src/flow/*"],
"@goauthentik/locales/*": ["./src/locales/*"],
"@goauthentik/polyfill/*": ["./src/polyfill/*"],
"@goauthentik/standalone/*": ["./src/standalone/*"],
"@goauthentik/user/*": ["./src/user/*"]