From 741db1778be57164260dd67c33fa83dd2445192e Mon Sep 17 00:00:00 2001 From: Restray Date: Fri, 1 Apr 2022 22:50:55 +0200 Subject: [PATCH 01/23] feat: install svelte-18n and init setup --- .vscode/settings.json | 7 + package.json | 4 +- pnpm-lock.yaml | 102 +++++ src/routes/__error.svelte | 4 +- src/routes/__layout.svelte | 764 +++++++++++++++++++------------------ static/locales/en.json | 13 + svelte.config.js | 6 + 7 files changed, 525 insertions(+), 375 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 static/locales/en.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..1cc7be6e1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "i18n-ally.localesPaths": ["locales"], + "i18n-ally.keystyle": "nested", + "i18n-ally.extract.ignoredByFiles": { + "src\\routes\\__layout.svelte": ["Coolify", "coolLabs logo"] + } +} diff --git a/package.json b/package.json index 6c7237198..7a0a8e4bf 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "2.2.7", "license": "AGPL-3.0", "scripts": { - "dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev", + "dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev", "dev:stop": "docker-compose -f docker-compose-dev.yaml down", "dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10", "studio": "npx prisma studio", @@ -37,6 +37,7 @@ "@typescript-eslint/parser": "4.31.1", "@zerodevx/svelte-toast": "0.7.1", "autoprefixer": "10.4.4", + "cross-env": "^7.0.3", "cross-var": "1.1.0", "eslint": "7.32.0", "eslint-config-prettier": "8.5.0", @@ -50,6 +51,7 @@ "prisma": "3.11.1", "svelte": "3.46.4", "svelte-check": "2.4.6", + "svelte-i18n": "^3.3.13", "svelte-preprocess": "4.10.4", "svelte-select": "^4.4.7", "tailwindcss": "3.0.23", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a89edbf25..e7594b347 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,7 @@ specifiers: compare-versions: 4.1.3 cookie: 0.4.2 cooltipz-css: ^2.1.0 + cross-env: ^7.0.3 cross-var: 1.1.0 cuid: 2.1.8 dayjs: 1.11.0 @@ -45,6 +46,7 @@ specifiers: prisma: 3.11.1 svelte: 3.46.4 svelte-check: 2.4.6 + svelte-i18n: ^3.3.13 svelte-kit-cookie-session: 2.1.2 svelte-preprocess: 4.10.4 svelte-select: ^4.4.7 @@ -92,6 +94,7 @@ devDependencies: '@typescript-eslint/parser': 4.31.1_eslint@7.32.0+typescript@4.6.3 '@zerodevx/svelte-toast': 0.7.1 autoprefixer: 10.4.4_postcss@8.4.12 + cross-env: 7.0.3 cross-var: 1.1.0 eslint: 7.32.0 eslint-config-prettier: 8.5.0_eslint@7.32.0 @@ -105,6 +108,7 @@ devDependencies: prisma: 3.11.1 svelte: 3.46.4 svelte-check: 2.4.6_postcss@8.4.12+svelte@3.46.4 + svelte-i18n: 3.3.13_svelte@3.46.4 svelte-preprocess: 4.10.4_296873641a0ad9f42fe92172d27bcedd svelte-select: 4.4.7 tailwindcss: 3.0.23_b89136460714832cdda11d1e9d57d1ff @@ -180,6 +184,55 @@ packages: - supports-color dev: true + /@formatjs/ecma402-abstract/1.11.4: + resolution: + { + integrity: sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw== + } + dependencies: + '@formatjs/intl-localematcher': 0.2.25 + tslib: 2.3.1 + dev: true + + /@formatjs/fast-memoize/1.2.1: + resolution: + { + integrity: sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg== + } + dependencies: + tslib: 2.3.1 + dev: true + + /@formatjs/icu-messageformat-parser/2.0.19: + resolution: + { + integrity: sha512-8HsLm9YLyVVIDMyBJb7wmve2wGd461cUwJ470eUog5YH5ZsF4p5lgvaJ+oGKxz1mrSMNNdDHU9v/NDsS+z+ilg== + } + dependencies: + '@formatjs/ecma402-abstract': 1.11.4 + '@formatjs/icu-skeleton-parser': 1.3.6 + tslib: 2.3.1 + dev: true + + /@formatjs/icu-skeleton-parser/1.3.6: + resolution: + { + integrity: sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg== + } + dependencies: + '@formatjs/ecma402-abstract': 1.11.4 + tslib: 2.3.1 + dev: true + + /@formatjs/intl-localematcher/0.2.25: + resolution: + { + integrity: sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA== + } + dependencies: + tslib: 2.3.1 + dev: true + /@humanwhocodes/config-array/0.5.0: resolution: { @@ -2081,6 +2134,17 @@ packages: luxon: 1.28.0 dev: false + /cross-env/7.0.3: + resolution: + { + integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw== + } + engines: { node: '>=10.14', npm: '>=6', yarn: '>=1' } + hasBin: true + dependencies: + cross-spawn: 7.0.3 + dev: true + /cross-spawn/5.1.0: resolution: { integrity: sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= } dependencies: @@ -2190,6 +2254,14 @@ packages: } dev: true + /deepmerge/4.2.2: + resolution: + { + integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + } + engines: { node: '>=0.10.0' } + dev: true + /defer-to-connect/2.0.1: resolution: { @@ -3390,6 +3462,18 @@ packages: integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== } + /intl-messageformat/9.12.0: + resolution: + { + integrity: sha512-5Q9j21JreB1G27/CqMYsA+pvJ19JjHyhiTSeUuvZK9BCDJGHtOLgpUUcGM+GLHiUuoVMKVeeX1smamiVHQrSKQ== + } + dependencies: + '@formatjs/ecma402-abstract': 1.11.4 + '@formatjs/fast-memoize': 1.2.1 + '@formatjs/icu-messageformat-parser': 2.0.19 + tslib: 2.3.1 + dev: true + /invariant/2.2.4: resolution: { @@ -5159,6 +5243,24 @@ packages: svelte: 3.46.4 dev: true + /svelte-i18n/3.3.13_svelte@3.46.4: + resolution: + { + integrity: sha512-RQM+ys4+Y9ztH//tX22H1UL2cniLNmIR+N4xmYygV6QpQ6EyQvloZiENRew8XrVzfvJ8HaE8NU6/yurLkl7z3g== + } + engines: { node: '>= 11.15.0' } + hasBin: true + peerDependencies: + svelte: ^3.25.1 + dependencies: + deepmerge: 4.2.2 + estree-walker: 2.0.2 + intl-messageformat: 9.12.0 + sade: 1.7.4 + svelte: 3.46.4 + tiny-glob: 0.2.9 + dev: true + /svelte-kit-cookie-session/2.1.2: resolution: { diff --git a/src/routes/__error.svelte b/src/routes/__error.svelte index 6e9d9f184..67693e70a 100644 --- a/src/routes/__error.svelte +++ b/src/routes/__error.svelte @@ -12,6 +12,7 @@ @@ -20,7 +21,8 @@
{status}
Ooops you are lost! But don't be afraid!
- You can find your way back here + {$_('error.you_can_find_your_way_back')} + {$_('error.here')}
 import('../../static/locales/en.json'));
+
+		return await Promise.allSettled([
+			// TODO: add some more stuff you want to init ...
+			init({ initialLocale: getLocaleFromNavigator(), fallbackLocale: 'en' })
+		]);
+	}
+
+	const setupResult = setup();
 
 	let isUpdateAvailable = false;
 
@@ -104,7 +115,7 @@
 				return window.location.reload();
 			} else {
 				await post(`/update.json`, { type: 'update', latestVersion });
-				toast.push('Update completed.

Waiting for the new version to start...'); + toast.push(`${$_('layout.update_done')}

${$_('layout.wait_new_version_startup')}`); let reachable = false; let tries = 0; do { @@ -118,7 +129,7 @@ if (reachable) break; tries++; } while (!reachable || tries < 120); - toast.push('New version reachable. Reloading...'); + toast.push($_('layout.new_version')); updateStatus.loading = false; updateStatus.success = true; await asyncSleep(3000); @@ -135,332 +146,23 @@ Coolify - -{#if $session.userId} - + + {/if} +
+ +
+{:catch error} +

{error.message}

+{/await} diff --git a/static/locales/en.json b/static/locales/en.json new file mode 100644 index 000000000..aa64ad4e5 --- /dev/null +++ b/static/locales/en.json @@ -0,0 +1,13 @@ +{ + "layout": { + "update_done": "Update completed.", + "wait_new_version_startup": "Waiting for the new version to start...", + "new_version": "New version reachable. Reloading...", + "switch_to_a_different_team": "Switch to a different team...", + "update_available": "Update available" + }, + "error": { + "you_can_find_your_way_back": "You can find your way back", + "here": "here" + } +} diff --git a/svelte.config.js b/svelte.config.js index 4e8bc8966..9d711910b 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -12,6 +12,12 @@ const config = { vite: { optimizeDeps: { exclude: ['svelte-kit-cookie-session'] + }, + server: { + fs: { + // Allow serving files from one level up to the project root + allow: ['../locales'] + } } } } From d910b21185783a8cb194d03b25cd4803ce1fec41 Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 16:15:00 +0200 Subject: [PATCH 02/23] Add Locale URL --- .vscode/settings.json | 6 +- package.json | 2 +- pnpm-lock.yaml | 124 +-- src/hooks.ts | 43 +- src/lib/form.ts | 11 +- src/lib/lang.json | 4 + src/lib/settings.ts | 6 +- src/lib/translations.ts | 26 + .../applications/[id]/__layout.svelte | 0 .../applications/[id]/check.json.ts | 0 .../[id]/configuration/_BuildPack.svelte | 0 .../configuration/_GithubRepositories.svelte | 0 .../configuration/_GitlabRepositories.svelte | 0 .../[id]/configuration/buildpack.json.ts | 0 .../[id]/configuration/buildpack.svelte | 0 .../[id]/configuration/deploykey.json.ts | 0 .../[id]/configuration/destination.json.ts | 0 .../[id]/configuration/destination.svelte | 0 .../[id]/configuration/githubToken.json.ts | 0 .../[id]/configuration/repository.json.ts | 0 .../[id]/configuration/repository.svelte | 0 .../[id]/configuration/source.json.ts | 0 .../[id]/configuration/source.svelte | 0 .../[id]/configuration/sshkey.json.ts | 0 .../applications/[id]/delete.json.ts | 0 .../applications/[id]/deploy.json.ts | 0 .../applications/[id]/index.json.ts | 0 .../applications/[id]/index.svelte | 0 .../applications/[id]/logs/_Loading.svelte | 0 .../[id]/logs/build/_BuildLog.svelte | 0 .../[id]/logs/build/build.json.ts | 0 .../[id]/logs/build/index.json.ts | 0 .../applications/[id]/logs/build/index.svelte | 0 .../applications/[id]/logs/index.json.ts | 0 .../applications/[id]/logs/index.svelte | 0 .../applications/[id]/previews/index.json.ts | 0 .../applications/[id]/previews/index.svelte | 0 .../applications/[id]/secrets/_Secret.svelte | 0 .../applications/[id]/secrets/index.json.ts | 0 .../applications/[id]/secrets/index.svelte | 0 .../applications/[id]/settings.json.ts | 4 +- .../applications/[id]/stop.json.ts | 0 .../applications/[id]/storage/_Storage.svelte | 0 .../applications/[id]/storage/index.json.ts | 0 .../applications/[id]/storage/index.svelte | 0 .../applications/_Application.svelte | 3 +- .../{ => [lang]}/applications/index.svelte | 5 +- src/routes/{ => [lang]}/applications/index.ts | 0 src/routes/{ => [lang]}/applications/new.ts | 0 .../{ => [lang]}/common/getUniqueName.json.ts | 0 .../databases/[id]/_Databases/_CouchDb.svelte | 0 .../[id]/_Databases/_Databases.svelte | 0 .../databases/[id]/_Databases/_MongoDB.svelte | 0 .../databases/[id]/_Databases/_MySQL.svelte | 0 .../[id]/_Databases/_PostgreSQL.svelte | 0 .../databases/[id]/_Databases/_Redis.svelte | 0 .../databases/[id]/__layout.svelte | 0 .../[id]/configuration/destination.json.ts | 0 .../[id]/configuration/destination.svelte | 0 .../databases/[id]/configuration/type.json.ts | 0 .../databases/[id]/configuration/type.svelte | 0 .../[id]/configuration/version.json.ts | 0 .../[id]/configuration/version.svelte | 0 .../databases/[id]/delete.json.ts | 0 .../{ => [lang]}/databases/[id]/index.json.ts | 0 .../{ => [lang]}/databases/[id]/index.svelte | 0 .../databases/[id]/settings.json.ts | 0 .../{ => [lang]}/databases/[id]/start.json.ts | 0 .../{ => [lang]}/databases/[id]/stop.json.ts | 0 .../{ => [lang]}/databases/index.svelte | 0 src/routes/{ => [lang]}/databases/index.ts | 0 src/routes/{ => [lang]}/databases/new.ts | 0 .../destinations/[id]/_FoundApp.svelte | 0 .../destinations/[id]/_LocalDocker.svelte | 0 .../destinations/[id]/_RemoteDocker.svelte | 0 .../destinations/[id]/__layout.svelte | 0 .../destinations/[id]/index.json.ts | 0 .../destinations/[id]/index.svelte | 0 .../destinations/[id]/restart.json.ts | 0 .../destinations/[id]/scan.json.ts | 0 .../destinations/[id]/settings.json.ts | 0 .../destinations/[id]/start.json.ts | 0 .../destinations/[id]/stop.json.ts | 0 .../{ => [lang]}/destinations/index.json.ts | 0 .../{ => [lang]}/destinations/index.svelte | 0 src/routes/{ => [lang]}/login/index.json.ts | 0 src/routes/{ => [lang]}/login/index.svelte | 17 +- src/routes/{ => [lang]}/logout/index.json.ts | 0 .../new/destination/_LocalDocker.svelte | 0 .../new/destination/_RemoteDocker.svelte | 0 .../new/destination/check.json.ts | 0 .../new/destination/docker.json.ts | 0 .../{ => [lang]}/new/destination/index.svelte | 0 .../{ => [lang]}/new/source/_Github.svelte | 0 .../{ => [lang]}/new/source/_Gitlab.svelte | 0 .../{ => [lang]}/new/source/index.json.ts | 0 .../{ => [lang]}/new/source/index.svelte | 0 .../{ => [lang]}/new/team/index.json.ts | 0 src/routes/{ => [lang]}/new/team/index.svelte | 0 src/routes/{ => [lang]}/register/index.svelte | 15 +- src/routes/{ => [lang]}/register/index.ts | 0 src/routes/{ => [lang]}/reset/index.json.ts | 2 +- src/routes/{ => [lang]}/reset/index.svelte | 0 .../{ => [lang]}/reset/password.json.ts | 2 +- .../services/[id]/_Services/_Ghost.svelte | 0 .../services/[id]/_Services/_MinIO.svelte | 0 .../[id]/_Services/_PlausibleAnalytics.svelte | 0 .../services/[id]/_Services/_Services.svelte | 0 .../[id]/_Services/_VSCodeServer.svelte | 0 .../services/[id]/_Services/_Wordpress.svelte | 0 .../services/[id]/__layout.svelte | 0 .../{ => [lang]}/services/[id]/check.json.ts | 0 .../[id]/configuration/destination.json.ts | 0 .../[id]/configuration/destination.svelte | 0 .../services/[id]/configuration/type.json.ts | 0 .../services/[id]/configuration/type.svelte | 0 .../[id]/configuration/version.json.ts | 0 .../[id]/configuration/version.svelte | 0 .../{ => [lang]}/services/[id]/delete.json.ts | 0 .../services/[id]/ghost/index.json.ts | 0 .../services/[id]/ghost/start.json.ts | 0 .../services/[id]/ghost/stop.json.ts | 0 .../{ => [lang]}/services/[id]/index.json.ts | 0 .../{ => [lang]}/services/[id]/index.svelte | 0 .../services/[id]/languagetool/index.json.ts | 0 .../services/[id]/languagetool/start.json.ts | 0 .../services/[id]/languagetool/stop.json.ts | 0 .../services/[id]/minio/index.json.ts | 0 .../services/[id]/minio/start.json.ts | 0 .../services/[id]/minio/stop.json.ts | 0 .../services/[id]/n8n/index.json.ts | 0 .../services/[id]/n8n/start.json.ts | 0 .../services/[id]/n8n/stop.json.ts | 0 .../services/[id]/nocodb/index.json.ts | 0 .../services/[id]/nocodb/start.json.ts | 0 .../services/[id]/nocodb/stop.json.ts | 0 .../[id]/plausibleanalytics/activate.json.ts | 0 .../[id]/plausibleanalytics/index.json.ts | 0 .../[id]/plausibleanalytics/start.json.ts | 0 .../[id]/plausibleanalytics/stop.json.ts | 0 .../services/[id]/secrets/_Secret.svelte | 0 .../services/[id]/secrets/index.json.ts | 0 .../services/[id]/secrets/index.svelte | 0 .../services/[id]/settings.json.ts | 0 .../services/[id]/uptimekuma/index.json.ts | 0 .../services/[id]/uptimekuma/start.json.ts | 0 .../services/[id]/uptimekuma/stop.json.ts | 0 .../services/[id]/vaultwarden/index.json.ts | 0 .../services/[id]/vaultwarden/start.json.ts | 0 .../services/[id]/vaultwarden/stop.json.ts | 0 .../services/[id]/vscodeserver/index.json.ts | 0 .../services/[id]/vscodeserver/start.json.ts | 0 .../services/[id]/vscodeserver/stop.json.ts | 0 .../services/[id]/wordpress/index.json.ts | 0 .../services/[id]/wordpress/start.json.ts | 0 .../services/[id]/wordpress/stop.json.ts | 0 src/routes/{ => [lang]}/services/index.svelte | 0 src/routes/{ => [lang]}/services/index.ts | 0 src/routes/{ => [lang]}/services/new.ts | 0 .../{ => [lang]}/settings/check.json.ts | 0 .../{ => [lang]}/settings/index.json.ts | 0 src/routes/{ => [lang]}/settings/index.svelte | 0 .../{ => [lang]}/sources/[id]/_Github.svelte | 17 +- .../{ => [lang]}/sources/[id]/_Gitlab.svelte | 0 .../{ => [lang]}/sources/[id]/__layout.svelte | 9 +- .../{ => [lang]}/sources/[id]/check.json.ts | 0 .../{ => [lang]}/sources/[id]/gitlab.json.ts | 0 .../{ => [lang]}/sources/[id]/index.json.ts | 0 .../{ => [lang]}/sources/[id]/index.svelte | 0 .../sources/[id]/newGithubApp.svelte | 0 src/routes/{ => [lang]}/sources/index.json.ts | 0 src/routes/{ => [lang]}/sources/index.svelte | 7 +- .../{ => [lang]}/teams/[id]/__layout.svelte | 0 .../{ => [lang]}/teams/[id]/index.json.ts | 0 .../{ => [lang]}/teams/[id]/index.svelte | 0 .../teams/[id]/invitation/accept.json.ts | 0 .../teams/[id]/invitation/invite.json.ts | 0 .../teams/[id]/invitation/revoke.json.ts | 0 .../teams/[id]/permission/change.json.ts | 0 .../teams/[id]/remove/user.json.ts | 0 src/routes/{ => [lang]}/teams/index.json.ts | 0 src/routes/{ => [lang]}/teams/index.svelte | 0 src/routes/__error.svelte | 8 +- src/routes/__layout.svelte | 762 +++++++++--------- src/routes/index.svelte | 21 +- static/locales/en.json | 55 +- static/locales/fr.json | 66 ++ 187 files changed, 683 insertions(+), 532 deletions(-) create mode 100644 src/lib/lang.json create mode 100644 src/lib/translations.ts rename src/routes/{ => [lang]}/applications/[id]/__layout.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/check.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/_BuildPack.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/_GithubRepositories.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/_GitlabRepositories.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/buildpack.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/buildpack.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/deploykey.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/destination.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/destination.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/githubToken.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/repository.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/repository.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/source.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/source.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/configuration/sshkey.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/delete.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/deploy.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/index.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/index.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/_Loading.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/build/_BuildLog.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/build/build.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/build/index.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/build/index.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/index.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/logs/index.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/previews/index.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/previews/index.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/secrets/_Secret.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/secrets/index.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/secrets/index.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/settings.json.ts (85%) rename src/routes/{ => [lang]}/applications/[id]/stop.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/storage/_Storage.svelte (100%) rename src/routes/{ => [lang]}/applications/[id]/storage/index.json.ts (100%) rename src/routes/{ => [lang]}/applications/[id]/storage/index.svelte (100%) rename src/routes/{ => [lang]}/applications/_Application.svelte (96%) rename src/routes/{ => [lang]}/applications/index.svelte (84%) rename src/routes/{ => [lang]}/applications/index.ts (100%) rename src/routes/{ => [lang]}/applications/new.ts (100%) rename src/routes/{ => [lang]}/common/getUniqueName.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/_Databases/_CouchDb.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/_Databases/_Databases.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/_Databases/_MongoDB.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/_Databases/_MySQL.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/_Databases/_PostgreSQL.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/_Databases/_Redis.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/__layout.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/configuration/destination.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/configuration/destination.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/configuration/type.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/configuration/type.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/configuration/version.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/configuration/version.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/delete.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/index.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/index.svelte (100%) rename src/routes/{ => [lang]}/databases/[id]/settings.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/start.json.ts (100%) rename src/routes/{ => [lang]}/databases/[id]/stop.json.ts (100%) rename src/routes/{ => [lang]}/databases/index.svelte (100%) rename src/routes/{ => [lang]}/databases/index.ts (100%) rename src/routes/{ => [lang]}/databases/new.ts (100%) rename src/routes/{ => [lang]}/destinations/[id]/_FoundApp.svelte (100%) rename src/routes/{ => [lang]}/destinations/[id]/_LocalDocker.svelte (100%) rename src/routes/{ => [lang]}/destinations/[id]/_RemoteDocker.svelte (100%) rename src/routes/{ => [lang]}/destinations/[id]/__layout.svelte (100%) rename src/routes/{ => [lang]}/destinations/[id]/index.json.ts (100%) rename src/routes/{ => [lang]}/destinations/[id]/index.svelte (100%) rename src/routes/{ => [lang]}/destinations/[id]/restart.json.ts (100%) rename src/routes/{ => [lang]}/destinations/[id]/scan.json.ts (100%) rename src/routes/{ => [lang]}/destinations/[id]/settings.json.ts (100%) rename src/routes/{ => [lang]}/destinations/[id]/start.json.ts (100%) rename src/routes/{ => [lang]}/destinations/[id]/stop.json.ts (100%) rename src/routes/{ => [lang]}/destinations/index.json.ts (100%) rename src/routes/{ => [lang]}/destinations/index.svelte (100%) rename src/routes/{ => [lang]}/login/index.json.ts (100%) rename src/routes/{ => [lang]}/login/index.svelte (81%) rename src/routes/{ => [lang]}/logout/index.json.ts (100%) rename src/routes/{ => [lang]}/new/destination/_LocalDocker.svelte (100%) rename src/routes/{ => [lang]}/new/destination/_RemoteDocker.svelte (100%) rename src/routes/{ => [lang]}/new/destination/check.json.ts (100%) rename src/routes/{ => [lang]}/new/destination/docker.json.ts (100%) rename src/routes/{ => [lang]}/new/destination/index.svelte (100%) rename src/routes/{ => [lang]}/new/source/_Github.svelte (100%) rename src/routes/{ => [lang]}/new/source/_Gitlab.svelte (100%) rename src/routes/{ => [lang]}/new/source/index.json.ts (100%) rename src/routes/{ => [lang]}/new/source/index.svelte (100%) rename src/routes/{ => [lang]}/new/team/index.json.ts (100%) rename src/routes/{ => [lang]}/new/team/index.svelte (100%) rename src/routes/{ => [lang]}/register/index.svelte (84%) rename src/routes/{ => [lang]}/register/index.ts (100%) rename src/routes/{ => [lang]}/reset/index.json.ts (91%) rename src/routes/{ => [lang]}/reset/index.svelte (100%) rename src/routes/{ => [lang]}/reset/password.json.ts (93%) rename src/routes/{ => [lang]}/services/[id]/_Services/_Ghost.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/_Services/_MinIO.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/_Services/_PlausibleAnalytics.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/_Services/_Services.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/_Services/_VSCodeServer.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/_Services/_Wordpress.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/__layout.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/check.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/configuration/destination.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/configuration/destination.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/configuration/type.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/configuration/type.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/configuration/version.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/configuration/version.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/delete.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/ghost/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/ghost/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/ghost/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/index.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/languagetool/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/languagetool/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/languagetool/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/minio/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/minio/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/minio/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/n8n/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/n8n/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/n8n/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/nocodb/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/nocodb/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/nocodb/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/plausibleanalytics/activate.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/plausibleanalytics/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/plausibleanalytics/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/plausibleanalytics/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/secrets/_Secret.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/secrets/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/secrets/index.svelte (100%) rename src/routes/{ => [lang]}/services/[id]/settings.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/uptimekuma/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/uptimekuma/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/uptimekuma/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/vaultwarden/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/vaultwarden/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/vaultwarden/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/vscodeserver/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/vscodeserver/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/vscodeserver/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/wordpress/index.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/wordpress/start.json.ts (100%) rename src/routes/{ => [lang]}/services/[id]/wordpress/stop.json.ts (100%) rename src/routes/{ => [lang]}/services/index.svelte (100%) rename src/routes/{ => [lang]}/services/index.ts (100%) rename src/routes/{ => [lang]}/services/new.ts (100%) rename src/routes/{ => [lang]}/settings/check.json.ts (100%) rename src/routes/{ => [lang]}/settings/index.json.ts (100%) rename src/routes/{ => [lang]}/settings/index.svelte (100%) rename src/routes/{ => [lang]}/sources/[id]/_Github.svelte (81%) rename src/routes/{ => [lang]}/sources/[id]/_Gitlab.svelte (100%) rename src/routes/{ => [lang]}/sources/[id]/__layout.svelte (82%) rename src/routes/{ => [lang]}/sources/[id]/check.json.ts (100%) rename src/routes/{ => [lang]}/sources/[id]/gitlab.json.ts (100%) rename src/routes/{ => [lang]}/sources/[id]/index.json.ts (100%) rename src/routes/{ => [lang]}/sources/[id]/index.svelte (100%) rename src/routes/{ => [lang]}/sources/[id]/newGithubApp.svelte (100%) rename src/routes/{ => [lang]}/sources/index.json.ts (100%) rename src/routes/{ => [lang]}/sources/index.svelte (88%) rename src/routes/{ => [lang]}/teams/[id]/__layout.svelte (100%) rename src/routes/{ => [lang]}/teams/[id]/index.json.ts (100%) rename src/routes/{ => [lang]}/teams/[id]/index.svelte (100%) rename src/routes/{ => [lang]}/teams/[id]/invitation/accept.json.ts (100%) rename src/routes/{ => [lang]}/teams/[id]/invitation/invite.json.ts (100%) rename src/routes/{ => [lang]}/teams/[id]/invitation/revoke.json.ts (100%) rename src/routes/{ => [lang]}/teams/[id]/permission/change.json.ts (100%) rename src/routes/{ => [lang]}/teams/[id]/remove/user.json.ts (100%) rename src/routes/{ => [lang]}/teams/index.json.ts (100%) rename src/routes/{ => [lang]}/teams/index.svelte (100%) create mode 100644 static/locales/fr.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 1cc7be6e1..9a291b28c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,5 @@ { - "i18n-ally.localesPaths": ["locales"], + "i18n-ally.localesPaths": ["static/locales"], "i18n-ally.keystyle": "nested", - "i18n-ally.extract.ignoredByFiles": { - "src\\routes\\__layout.svelte": ["Coolify", "coolLabs logo"] - } + "i18n-ally.extract.ignored": ["Coolify", "coolLabs logo"] } diff --git a/package.json b/package.json index 7a0a8e4bf..39696ce59 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "prisma": "3.11.1", "svelte": "3.46.4", "svelte-check": "2.4.6", - "svelte-i18n": "^3.3.13", "svelte-preprocess": "4.10.4", "svelte-select": "^4.4.7", "tailwindcss": "3.0.23", @@ -82,6 +81,7 @@ "mustache": "^4.2.0", "node-forge": "1.3.0", "svelte-kit-cookie-session": "2.1.2", + "sveltekit-i18n": "^2.1.2", "tailwindcss-scrollbar": "^0.1.0", "unique-names-generator": "4.7.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7594b347..2b7677e8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,10 +46,10 @@ specifiers: prisma: 3.11.1 svelte: 3.46.4 svelte-check: 2.4.6 - svelte-i18n: ^3.3.13 svelte-kit-cookie-session: 2.1.2 svelte-preprocess: 4.10.4 svelte-select: ^4.4.7 + sveltekit-i18n: ^2.1.2 tailwindcss: 3.0.23 tailwindcss-scrollbar: ^0.1.0 ts-node: 10.7.0 @@ -79,6 +79,7 @@ dependencies: mustache: 4.2.0 node-forge: 1.3.0 svelte-kit-cookie-session: 2.1.2 + sveltekit-i18n: 2.1.2_svelte@3.46.4 tailwindcss-scrollbar: 0.1.0_tailwindcss@3.0.23 unique-names-generator: 4.7.1 @@ -108,7 +109,6 @@ devDependencies: prisma: 3.11.1 svelte: 3.46.4 svelte-check: 2.4.6_postcss@8.4.12+svelte@3.46.4 - svelte-i18n: 3.3.13_svelte@3.46.4 svelte-preprocess: 4.10.4_296873641a0ad9f42fe92172d27bcedd svelte-select: 4.4.7 tailwindcss: 3.0.23_b89136460714832cdda11d1e9d57d1ff @@ -184,55 +184,6 @@ packages: - supports-color dev: true - /@formatjs/ecma402-abstract/1.11.4: - resolution: - { - integrity: sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw== - } - dependencies: - '@formatjs/intl-localematcher': 0.2.25 - tslib: 2.3.1 - dev: true - - /@formatjs/fast-memoize/1.2.1: - resolution: - { - integrity: sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg== - } - dependencies: - tslib: 2.3.1 - dev: true - - /@formatjs/icu-messageformat-parser/2.0.19: - resolution: - { - integrity: sha512-8HsLm9YLyVVIDMyBJb7wmve2wGd461cUwJ470eUog5YH5ZsF4p5lgvaJ+oGKxz1mrSMNNdDHU9v/NDsS+z+ilg== - } - dependencies: - '@formatjs/ecma402-abstract': 1.11.4 - '@formatjs/icu-skeleton-parser': 1.3.6 - tslib: 2.3.1 - dev: true - - /@formatjs/icu-skeleton-parser/1.3.6: - resolution: - { - integrity: sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg== - } - dependencies: - '@formatjs/ecma402-abstract': 1.11.4 - tslib: 2.3.1 - dev: true - - /@formatjs/intl-localematcher/0.2.25: - resolution: - { - integrity: sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA== - } - dependencies: - tslib: 2.3.1 - dev: true - /@humanwhocodes/config-array/0.5.0: resolution: { @@ -495,6 +446,26 @@ packages: - supports-color dev: true + /@sveltekit-i18n/base/1.1.1_svelte@3.46.4: + resolution: + { + integrity: sha512-J/sMU0OwS3dCLOuilHMBqu8vZHuuXiNV9vFJx8Nb4/b5BlR/KCZ4bCXI8wZR02GHeCOYKZxWus07CM1scxa/jw== + } + peerDependencies: + svelte: ^3.x + dependencies: + svelte: 3.46.4 + optionalDependencies: + '@sveltekit-i18n/parser-default': 1.0.3 + dev: false + + /@sveltekit-i18n/parser-default/1.0.3: + resolution: + { + integrity: sha512-HheveklTjp3hxpYQhoHfyA6B4bQaUeSV5MQf2usIv/58UF2jY/YqhCAWj9bDBjufbuZc5pSz4BXvdX3WVT+viA== + } + dev: false + /@szmarczak/http-timer/5.0.1: resolution: { @@ -2254,14 +2225,6 @@ packages: } dev: true - /deepmerge/4.2.2: - resolution: - { - integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - } - engines: { node: '>=0.10.0' } - dev: true - /defer-to-connect/2.0.1: resolution: { @@ -3462,18 +3425,6 @@ packages: integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== } - /intl-messageformat/9.12.0: - resolution: - { - integrity: sha512-5Q9j21JreB1G27/CqMYsA+pvJ19JjHyhiTSeUuvZK9BCDJGHtOLgpUUcGM+GLHiUuoVMKVeeX1smamiVHQrSKQ== - } - dependencies: - '@formatjs/ecma402-abstract': 1.11.4 - '@formatjs/fast-memoize': 1.2.1 - '@formatjs/icu-messageformat-parser': 2.0.19 - tslib: 2.3.1 - dev: true - /invariant/2.2.4: resolution: { @@ -5243,24 +5194,6 @@ packages: svelte: 3.46.4 dev: true - /svelte-i18n/3.3.13_svelte@3.46.4: - resolution: - { - integrity: sha512-RQM+ys4+Y9ztH//tX22H1UL2cniLNmIR+N4xmYygV6QpQ6EyQvloZiENRew8XrVzfvJ8HaE8NU6/yurLkl7z3g== - } - engines: { node: '>= 11.15.0' } - hasBin: true - peerDependencies: - svelte: ^3.25.1 - dependencies: - deepmerge: 4.2.2 - estree-walker: 2.0.2 - intl-messageformat: 9.12.0 - sade: 1.7.4 - svelte: 3.46.4 - tiny-glob: 0.2.9 - dev: true - /svelte-kit-cookie-session/2.1.2: resolution: { @@ -5338,6 +5271,19 @@ packages: engines: { node: '>= 8' } dev: true + /sveltekit-i18n/2.1.2_svelte@3.46.4: + resolution: + { + integrity: sha512-s5YxcbNd2EWNZaZR1A4Drt8s53E4fpUkN4XIWd3VRpw1pihZVWssqmBW1qkjQ6AB0kiu1Qwule+vt1HkbQOjrg== + } + peerDependencies: + svelte: ^3.x + dependencies: + '@sveltekit-i18n/base': 1.1.1_svelte@3.46.4 + '@sveltekit-i18n/parser-default': 1.0.3 + svelte: 3.46.4 + dev: false + /table/6.7.2: resolution: { diff --git a/src/hooks.ts b/src/hooks.ts index d6c6eca6d..4a0fa2e87 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -6,6 +6,9 @@ import { getUserDetails, sentry } from '$lib/common'; import { version } from '$lib/common'; import cookie from 'cookie'; import { dev } from '$app/env'; +import { locales } from '$lib/translations'; + +const routeRegex = new RegExp(/^\/[^.]*([?#].*)?$/); export const handle = handleSession( { @@ -62,9 +65,45 @@ export const handle = handleSession( expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT') }) ); - } finally { - return response; } + + const { url, request } = event; + const { pathname } = url; + + // If this request is a route request + if (routeRegex.test(pathname)) { + // Get defined locales + const supportedLocales = locales.get(); + + // Try to get locale from `pathname`. + let locale = supportedLocales.find( + (l) => `${l}`.toLowerCase() === `${pathname.match(/[^/]+?(?=\/|$)/)}`.toLowerCase() + ); + + // If route locale is not supported + if (!locale) { + // Get user preferred locale + locale = `${`${request.headers['accept-language']}`.match( + /[a-zA-Z]+?(?=-|_|,|;)/ + )}`.toLowerCase(); + + // Set default locale if user preferred locale does not match + if (!supportedLocales.includes(locale)) locale = 'en'; + + // 301 redirect + return new Response(undefined, { + headers: { location: `/${locale}${pathname}` }, + status: 301 + }); + } + + // Add html `lang` attribute + const body = await response.text(); + + return new Response(`${body}`.replace(//, ``), response); + } + + return response; } ); diff --git a/src/lib/form.ts b/src/lib/form.ts index 08099576d..94871a66e 100644 --- a/src/lib/form.ts +++ b/src/lib/form.ts @@ -1,10 +1,15 @@ import { toast } from '@zerodevx/svelte-toast'; -export function errorNotification(message: string) { +import { t } from '$lib/translations'; + +let formatMessage; +t.subscribe((storeFormat) => (formatMessage = storeFormat)); + +export function errorNotification(message: string): void { console.error(message); if (typeof message !== 'string') { - toast.push('Ooops, something is not okay, are you okay?'); + toast.push(formatMessage('error.generic_message')); } else { - toast.push(message); + toast.push(formatMessage(message)); } } export function enhance( diff --git a/src/lib/lang.json b/src/lib/lang.json new file mode 100644 index 000000000..b01c522bb --- /dev/null +++ b/src/lib/lang.json @@ -0,0 +1,4 @@ +{ + "en": "English", + "fr": "Français" +} diff --git a/src/lib/settings.ts b/src/lib/settings.ts index 211852c06..437f1e415 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -1,4 +1,4 @@ -export const publicPaths = [ +const publicPaths = [ '/login', '/register', '/reset', @@ -8,3 +8,7 @@ export const publicPaths = [ '/webhooks/github/install', '/webhooks/gitlab' ]; + +export function isPublicPath(path: string): boolean { + return publicPaths.includes(path); +} diff --git a/src/lib/translations.ts b/src/lib/translations.ts new file mode 100644 index 000000000..299c8a75b --- /dev/null +++ b/src/lib/translations.ts @@ -0,0 +1,26 @@ +import i18n from 'sveltekit-i18n'; +import lang from './lang.json'; + +/** @type {import('sveltekit-i18n').Config} */ +export const config = { + fallbackLocale: 'en', + translations: { + en: { lang }, + fr: { lang } + }, + loaders: [ + { + locale: 'en', + key: '', + loader: async () => (await import('../../static/locales/en.json')).default + }, + { + locale: 'fr', + key: '', + loader: async () => (await import('../../static/locales/fr.json')).default + } + ] +}; + +export const { t, loading, locales, locale, loadTranslations } = new i18n(config); +loading.subscribe(($loading) => $loading && console.log('Loading translations...')); diff --git a/src/routes/applications/[id]/__layout.svelte b/src/routes/[lang]/applications/[id]/__layout.svelte similarity index 100% rename from src/routes/applications/[id]/__layout.svelte rename to src/routes/[lang]/applications/[id]/__layout.svelte diff --git a/src/routes/applications/[id]/check.json.ts b/src/routes/[lang]/applications/[id]/check.json.ts similarity index 100% rename from src/routes/applications/[id]/check.json.ts rename to src/routes/[lang]/applications/[id]/check.json.ts diff --git a/src/routes/applications/[id]/configuration/_BuildPack.svelte b/src/routes/[lang]/applications/[id]/configuration/_BuildPack.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/_BuildPack.svelte rename to src/routes/[lang]/applications/[id]/configuration/_BuildPack.svelte diff --git a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte b/src/routes/[lang]/applications/[id]/configuration/_GithubRepositories.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/_GithubRepositories.svelte rename to src/routes/[lang]/applications/[id]/configuration/_GithubRepositories.svelte diff --git a/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte b/src/routes/[lang]/applications/[id]/configuration/_GitlabRepositories.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/_GitlabRepositories.svelte rename to src/routes/[lang]/applications/[id]/configuration/_GitlabRepositories.svelte diff --git a/src/routes/applications/[id]/configuration/buildpack.json.ts b/src/routes/[lang]/applications/[id]/configuration/buildpack.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/buildpack.json.ts rename to src/routes/[lang]/applications/[id]/configuration/buildpack.json.ts diff --git a/src/routes/applications/[id]/configuration/buildpack.svelte b/src/routes/[lang]/applications/[id]/configuration/buildpack.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/buildpack.svelte rename to src/routes/[lang]/applications/[id]/configuration/buildpack.svelte diff --git a/src/routes/applications/[id]/configuration/deploykey.json.ts b/src/routes/[lang]/applications/[id]/configuration/deploykey.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/deploykey.json.ts rename to src/routes/[lang]/applications/[id]/configuration/deploykey.json.ts diff --git a/src/routes/applications/[id]/configuration/destination.json.ts b/src/routes/[lang]/applications/[id]/configuration/destination.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/destination.json.ts rename to src/routes/[lang]/applications/[id]/configuration/destination.json.ts diff --git a/src/routes/applications/[id]/configuration/destination.svelte b/src/routes/[lang]/applications/[id]/configuration/destination.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/destination.svelte rename to src/routes/[lang]/applications/[id]/configuration/destination.svelte diff --git a/src/routes/applications/[id]/configuration/githubToken.json.ts b/src/routes/[lang]/applications/[id]/configuration/githubToken.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/githubToken.json.ts rename to src/routes/[lang]/applications/[id]/configuration/githubToken.json.ts diff --git a/src/routes/applications/[id]/configuration/repository.json.ts b/src/routes/[lang]/applications/[id]/configuration/repository.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/repository.json.ts rename to src/routes/[lang]/applications/[id]/configuration/repository.json.ts diff --git a/src/routes/applications/[id]/configuration/repository.svelte b/src/routes/[lang]/applications/[id]/configuration/repository.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/repository.svelte rename to src/routes/[lang]/applications/[id]/configuration/repository.svelte diff --git a/src/routes/applications/[id]/configuration/source.json.ts b/src/routes/[lang]/applications/[id]/configuration/source.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/source.json.ts rename to src/routes/[lang]/applications/[id]/configuration/source.json.ts diff --git a/src/routes/applications/[id]/configuration/source.svelte b/src/routes/[lang]/applications/[id]/configuration/source.svelte similarity index 100% rename from src/routes/applications/[id]/configuration/source.svelte rename to src/routes/[lang]/applications/[id]/configuration/source.svelte diff --git a/src/routes/applications/[id]/configuration/sshkey.json.ts b/src/routes/[lang]/applications/[id]/configuration/sshkey.json.ts similarity index 100% rename from src/routes/applications/[id]/configuration/sshkey.json.ts rename to src/routes/[lang]/applications/[id]/configuration/sshkey.json.ts diff --git a/src/routes/applications/[id]/delete.json.ts b/src/routes/[lang]/applications/[id]/delete.json.ts similarity index 100% rename from src/routes/applications/[id]/delete.json.ts rename to src/routes/[lang]/applications/[id]/delete.json.ts diff --git a/src/routes/applications/[id]/deploy.json.ts b/src/routes/[lang]/applications/[id]/deploy.json.ts similarity index 100% rename from src/routes/applications/[id]/deploy.json.ts rename to src/routes/[lang]/applications/[id]/deploy.json.ts diff --git a/src/routes/applications/[id]/index.json.ts b/src/routes/[lang]/applications/[id]/index.json.ts similarity index 100% rename from src/routes/applications/[id]/index.json.ts rename to src/routes/[lang]/applications/[id]/index.json.ts diff --git a/src/routes/applications/[id]/index.svelte b/src/routes/[lang]/applications/[id]/index.svelte similarity index 100% rename from src/routes/applications/[id]/index.svelte rename to src/routes/[lang]/applications/[id]/index.svelte diff --git a/src/routes/applications/[id]/logs/_Loading.svelte b/src/routes/[lang]/applications/[id]/logs/_Loading.svelte similarity index 100% rename from src/routes/applications/[id]/logs/_Loading.svelte rename to src/routes/[lang]/applications/[id]/logs/_Loading.svelte diff --git a/src/routes/applications/[id]/logs/build/_BuildLog.svelte b/src/routes/[lang]/applications/[id]/logs/build/_BuildLog.svelte similarity index 100% rename from src/routes/applications/[id]/logs/build/_BuildLog.svelte rename to src/routes/[lang]/applications/[id]/logs/build/_BuildLog.svelte diff --git a/src/routes/applications/[id]/logs/build/build.json.ts b/src/routes/[lang]/applications/[id]/logs/build/build.json.ts similarity index 100% rename from src/routes/applications/[id]/logs/build/build.json.ts rename to src/routes/[lang]/applications/[id]/logs/build/build.json.ts diff --git a/src/routes/applications/[id]/logs/build/index.json.ts b/src/routes/[lang]/applications/[id]/logs/build/index.json.ts similarity index 100% rename from src/routes/applications/[id]/logs/build/index.json.ts rename to src/routes/[lang]/applications/[id]/logs/build/index.json.ts diff --git a/src/routes/applications/[id]/logs/build/index.svelte b/src/routes/[lang]/applications/[id]/logs/build/index.svelte similarity index 100% rename from src/routes/applications/[id]/logs/build/index.svelte rename to src/routes/[lang]/applications/[id]/logs/build/index.svelte diff --git a/src/routes/applications/[id]/logs/index.json.ts b/src/routes/[lang]/applications/[id]/logs/index.json.ts similarity index 100% rename from src/routes/applications/[id]/logs/index.json.ts rename to src/routes/[lang]/applications/[id]/logs/index.json.ts diff --git a/src/routes/applications/[id]/logs/index.svelte b/src/routes/[lang]/applications/[id]/logs/index.svelte similarity index 100% rename from src/routes/applications/[id]/logs/index.svelte rename to src/routes/[lang]/applications/[id]/logs/index.svelte diff --git a/src/routes/applications/[id]/previews/index.json.ts b/src/routes/[lang]/applications/[id]/previews/index.json.ts similarity index 100% rename from src/routes/applications/[id]/previews/index.json.ts rename to src/routes/[lang]/applications/[id]/previews/index.json.ts diff --git a/src/routes/applications/[id]/previews/index.svelte b/src/routes/[lang]/applications/[id]/previews/index.svelte similarity index 100% rename from src/routes/applications/[id]/previews/index.svelte rename to src/routes/[lang]/applications/[id]/previews/index.svelte diff --git a/src/routes/applications/[id]/secrets/_Secret.svelte b/src/routes/[lang]/applications/[id]/secrets/_Secret.svelte similarity index 100% rename from src/routes/applications/[id]/secrets/_Secret.svelte rename to src/routes/[lang]/applications/[id]/secrets/_Secret.svelte diff --git a/src/routes/applications/[id]/secrets/index.json.ts b/src/routes/[lang]/applications/[id]/secrets/index.json.ts similarity index 100% rename from src/routes/applications/[id]/secrets/index.json.ts rename to src/routes/[lang]/applications/[id]/secrets/index.json.ts diff --git a/src/routes/applications/[id]/secrets/index.svelte b/src/routes/[lang]/applications/[id]/secrets/index.svelte similarity index 100% rename from src/routes/applications/[id]/secrets/index.svelte rename to src/routes/[lang]/applications/[id]/secrets/index.svelte diff --git a/src/routes/applications/[id]/settings.json.ts b/src/routes/[lang]/applications/[id]/settings.json.ts similarity index 85% rename from src/routes/applications/[id]/settings.json.ts rename to src/routes/[lang]/applications/[id]/settings.json.ts index aea78ff96..222eff807 100644 --- a/src/routes/applications/[id]/settings.json.ts +++ b/src/routes/[lang]/applications/[id]/settings.json.ts @@ -2,6 +2,7 @@ import { getUserDetails } from '$lib/common'; import * as db from '$lib/database'; import { ErrorHandler } from '$lib/database'; import type { RequestHandler } from '@sveltejs/kit'; +import { _ } from 'svelte-i18n'; export const post: RequestHandler = async (event) => { const { teamId, status, body } = await getUserDetails(event); @@ -14,8 +15,7 @@ export const post: RequestHandler = async (event) => { const isDouble = await db.checkDoubleBranch(branch, projectId); if (isDouble && autodeploy) { throw { - message: - 'Cannot activate automatic deployments until only one application is defined for this repository / branch.' + message: $_('application.app.error_double_app_for_one_branch') }; } await db.setApplicationSettings({ id, debug, previews, dualCerts, autodeploy }); diff --git a/src/routes/applications/[id]/stop.json.ts b/src/routes/[lang]/applications/[id]/stop.json.ts similarity index 100% rename from src/routes/applications/[id]/stop.json.ts rename to src/routes/[lang]/applications/[id]/stop.json.ts diff --git a/src/routes/applications/[id]/storage/_Storage.svelte b/src/routes/[lang]/applications/[id]/storage/_Storage.svelte similarity index 100% rename from src/routes/applications/[id]/storage/_Storage.svelte rename to src/routes/[lang]/applications/[id]/storage/_Storage.svelte diff --git a/src/routes/applications/[id]/storage/index.json.ts b/src/routes/[lang]/applications/[id]/storage/index.json.ts similarity index 100% rename from src/routes/applications/[id]/storage/index.json.ts rename to src/routes/[lang]/applications/[id]/storage/index.json.ts diff --git a/src/routes/applications/[id]/storage/index.svelte b/src/routes/[lang]/applications/[id]/storage/index.svelte similarity index 100% rename from src/routes/applications/[id]/storage/index.svelte rename to src/routes/[lang]/applications/[id]/storage/index.svelte diff --git a/src/routes/applications/_Application.svelte b/src/routes/[lang]/applications/_Application.svelte similarity index 96% rename from src/routes/applications/_Application.svelte rename to src/routes/[lang]/applications/_Application.svelte index 16d19a42f..910c8e0c4 100644 --- a/src/routes/applications/_Application.svelte +++ b/src/routes/[lang]/applications/_Application.svelte @@ -15,6 +15,7 @@ import Docker from '$lib/components/svg/applications/Docker.svelte'; import Astro from '$lib/components/svg/applications/Astro.svelte'; import Eleventy from '$lib/components/svg/applications/Eleventy.svelte'; + import { t } from '$lib/translations'; const buildPack = application?.buildPack?.toLowerCase(); @@ -59,7 +60,7 @@ {/if} {#if !application.gitSourceId || !application.destinationDockerId}
- Configuration missing + {$t('application.configuration_missing')}
{/if}
diff --git a/src/routes/applications/index.svelte b/src/routes/[lang]/applications/index.svelte similarity index 84% rename from src/routes/applications/index.svelte rename to src/routes/[lang]/applications/index.svelte index 5f6056ac5..d559fd7b9 100644 --- a/src/routes/applications/index.svelte +++ b/src/routes/[lang]/applications/index.svelte @@ -4,6 +4,7 @@ import Application from './_Application.svelte'; import { post } from '$lib/api'; import { goto } from '$app/navigation'; + import { t } from '$lib/translations'; async function newApplication() { const { id } = await post('/applications/new', {}); return await goto(`/applications/${id}`, { replaceState: true }); @@ -11,7 +12,7 @@
-
Applications
+
{$t('index.applications')}
{#if $session.isAdmin}
{#if !applications || applications.length === 0}
-
No applications found
+
{$t('application.no_applications_found')}
{:else} {#each applications as application} diff --git a/src/routes/applications/index.ts b/src/routes/[lang]/applications/index.ts similarity index 100% rename from src/routes/applications/index.ts rename to src/routes/[lang]/applications/index.ts diff --git a/src/routes/applications/new.ts b/src/routes/[lang]/applications/new.ts similarity index 100% rename from src/routes/applications/new.ts rename to src/routes/[lang]/applications/new.ts diff --git a/src/routes/common/getUniqueName.json.ts b/src/routes/[lang]/common/getUniqueName.json.ts similarity index 100% rename from src/routes/common/getUniqueName.json.ts rename to src/routes/[lang]/common/getUniqueName.json.ts diff --git a/src/routes/databases/[id]/_Databases/_CouchDb.svelte b/src/routes/[lang]/databases/[id]/_Databases/_CouchDb.svelte similarity index 100% rename from src/routes/databases/[id]/_Databases/_CouchDb.svelte rename to src/routes/[lang]/databases/[id]/_Databases/_CouchDb.svelte diff --git a/src/routes/databases/[id]/_Databases/_Databases.svelte b/src/routes/[lang]/databases/[id]/_Databases/_Databases.svelte similarity index 100% rename from src/routes/databases/[id]/_Databases/_Databases.svelte rename to src/routes/[lang]/databases/[id]/_Databases/_Databases.svelte diff --git a/src/routes/databases/[id]/_Databases/_MongoDB.svelte b/src/routes/[lang]/databases/[id]/_Databases/_MongoDB.svelte similarity index 100% rename from src/routes/databases/[id]/_Databases/_MongoDB.svelte rename to src/routes/[lang]/databases/[id]/_Databases/_MongoDB.svelte diff --git a/src/routes/databases/[id]/_Databases/_MySQL.svelte b/src/routes/[lang]/databases/[id]/_Databases/_MySQL.svelte similarity index 100% rename from src/routes/databases/[id]/_Databases/_MySQL.svelte rename to src/routes/[lang]/databases/[id]/_Databases/_MySQL.svelte diff --git a/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte b/src/routes/[lang]/databases/[id]/_Databases/_PostgreSQL.svelte similarity index 100% rename from src/routes/databases/[id]/_Databases/_PostgreSQL.svelte rename to src/routes/[lang]/databases/[id]/_Databases/_PostgreSQL.svelte diff --git a/src/routes/databases/[id]/_Databases/_Redis.svelte b/src/routes/[lang]/databases/[id]/_Databases/_Redis.svelte similarity index 100% rename from src/routes/databases/[id]/_Databases/_Redis.svelte rename to src/routes/[lang]/databases/[id]/_Databases/_Redis.svelte diff --git a/src/routes/databases/[id]/__layout.svelte b/src/routes/[lang]/databases/[id]/__layout.svelte similarity index 100% rename from src/routes/databases/[id]/__layout.svelte rename to src/routes/[lang]/databases/[id]/__layout.svelte diff --git a/src/routes/databases/[id]/configuration/destination.json.ts b/src/routes/[lang]/databases/[id]/configuration/destination.json.ts similarity index 100% rename from src/routes/databases/[id]/configuration/destination.json.ts rename to src/routes/[lang]/databases/[id]/configuration/destination.json.ts diff --git a/src/routes/databases/[id]/configuration/destination.svelte b/src/routes/[lang]/databases/[id]/configuration/destination.svelte similarity index 100% rename from src/routes/databases/[id]/configuration/destination.svelte rename to src/routes/[lang]/databases/[id]/configuration/destination.svelte diff --git a/src/routes/databases/[id]/configuration/type.json.ts b/src/routes/[lang]/databases/[id]/configuration/type.json.ts similarity index 100% rename from src/routes/databases/[id]/configuration/type.json.ts rename to src/routes/[lang]/databases/[id]/configuration/type.json.ts diff --git a/src/routes/databases/[id]/configuration/type.svelte b/src/routes/[lang]/databases/[id]/configuration/type.svelte similarity index 100% rename from src/routes/databases/[id]/configuration/type.svelte rename to src/routes/[lang]/databases/[id]/configuration/type.svelte diff --git a/src/routes/databases/[id]/configuration/version.json.ts b/src/routes/[lang]/databases/[id]/configuration/version.json.ts similarity index 100% rename from src/routes/databases/[id]/configuration/version.json.ts rename to src/routes/[lang]/databases/[id]/configuration/version.json.ts diff --git a/src/routes/databases/[id]/configuration/version.svelte b/src/routes/[lang]/databases/[id]/configuration/version.svelte similarity index 100% rename from src/routes/databases/[id]/configuration/version.svelte rename to src/routes/[lang]/databases/[id]/configuration/version.svelte diff --git a/src/routes/databases/[id]/delete.json.ts b/src/routes/[lang]/databases/[id]/delete.json.ts similarity index 100% rename from src/routes/databases/[id]/delete.json.ts rename to src/routes/[lang]/databases/[id]/delete.json.ts diff --git a/src/routes/databases/[id]/index.json.ts b/src/routes/[lang]/databases/[id]/index.json.ts similarity index 100% rename from src/routes/databases/[id]/index.json.ts rename to src/routes/[lang]/databases/[id]/index.json.ts diff --git a/src/routes/databases/[id]/index.svelte b/src/routes/[lang]/databases/[id]/index.svelte similarity index 100% rename from src/routes/databases/[id]/index.svelte rename to src/routes/[lang]/databases/[id]/index.svelte diff --git a/src/routes/databases/[id]/settings.json.ts b/src/routes/[lang]/databases/[id]/settings.json.ts similarity index 100% rename from src/routes/databases/[id]/settings.json.ts rename to src/routes/[lang]/databases/[id]/settings.json.ts diff --git a/src/routes/databases/[id]/start.json.ts b/src/routes/[lang]/databases/[id]/start.json.ts similarity index 100% rename from src/routes/databases/[id]/start.json.ts rename to src/routes/[lang]/databases/[id]/start.json.ts diff --git a/src/routes/databases/[id]/stop.json.ts b/src/routes/[lang]/databases/[id]/stop.json.ts similarity index 100% rename from src/routes/databases/[id]/stop.json.ts rename to src/routes/[lang]/databases/[id]/stop.json.ts diff --git a/src/routes/databases/index.svelte b/src/routes/[lang]/databases/index.svelte similarity index 100% rename from src/routes/databases/index.svelte rename to src/routes/[lang]/databases/index.svelte diff --git a/src/routes/databases/index.ts b/src/routes/[lang]/databases/index.ts similarity index 100% rename from src/routes/databases/index.ts rename to src/routes/[lang]/databases/index.ts diff --git a/src/routes/databases/new.ts b/src/routes/[lang]/databases/new.ts similarity index 100% rename from src/routes/databases/new.ts rename to src/routes/[lang]/databases/new.ts diff --git a/src/routes/destinations/[id]/_FoundApp.svelte b/src/routes/[lang]/destinations/[id]/_FoundApp.svelte similarity index 100% rename from src/routes/destinations/[id]/_FoundApp.svelte rename to src/routes/[lang]/destinations/[id]/_FoundApp.svelte diff --git a/src/routes/destinations/[id]/_LocalDocker.svelte b/src/routes/[lang]/destinations/[id]/_LocalDocker.svelte similarity index 100% rename from src/routes/destinations/[id]/_LocalDocker.svelte rename to src/routes/[lang]/destinations/[id]/_LocalDocker.svelte diff --git a/src/routes/destinations/[id]/_RemoteDocker.svelte b/src/routes/[lang]/destinations/[id]/_RemoteDocker.svelte similarity index 100% rename from src/routes/destinations/[id]/_RemoteDocker.svelte rename to src/routes/[lang]/destinations/[id]/_RemoteDocker.svelte diff --git a/src/routes/destinations/[id]/__layout.svelte b/src/routes/[lang]/destinations/[id]/__layout.svelte similarity index 100% rename from src/routes/destinations/[id]/__layout.svelte rename to src/routes/[lang]/destinations/[id]/__layout.svelte diff --git a/src/routes/destinations/[id]/index.json.ts b/src/routes/[lang]/destinations/[id]/index.json.ts similarity index 100% rename from src/routes/destinations/[id]/index.json.ts rename to src/routes/[lang]/destinations/[id]/index.json.ts diff --git a/src/routes/destinations/[id]/index.svelte b/src/routes/[lang]/destinations/[id]/index.svelte similarity index 100% rename from src/routes/destinations/[id]/index.svelte rename to src/routes/[lang]/destinations/[id]/index.svelte diff --git a/src/routes/destinations/[id]/restart.json.ts b/src/routes/[lang]/destinations/[id]/restart.json.ts similarity index 100% rename from src/routes/destinations/[id]/restart.json.ts rename to src/routes/[lang]/destinations/[id]/restart.json.ts diff --git a/src/routes/destinations/[id]/scan.json.ts b/src/routes/[lang]/destinations/[id]/scan.json.ts similarity index 100% rename from src/routes/destinations/[id]/scan.json.ts rename to src/routes/[lang]/destinations/[id]/scan.json.ts diff --git a/src/routes/destinations/[id]/settings.json.ts b/src/routes/[lang]/destinations/[id]/settings.json.ts similarity index 100% rename from src/routes/destinations/[id]/settings.json.ts rename to src/routes/[lang]/destinations/[id]/settings.json.ts diff --git a/src/routes/destinations/[id]/start.json.ts b/src/routes/[lang]/destinations/[id]/start.json.ts similarity index 100% rename from src/routes/destinations/[id]/start.json.ts rename to src/routes/[lang]/destinations/[id]/start.json.ts diff --git a/src/routes/destinations/[id]/stop.json.ts b/src/routes/[lang]/destinations/[id]/stop.json.ts similarity index 100% rename from src/routes/destinations/[id]/stop.json.ts rename to src/routes/[lang]/destinations/[id]/stop.json.ts diff --git a/src/routes/destinations/index.json.ts b/src/routes/[lang]/destinations/index.json.ts similarity index 100% rename from src/routes/destinations/index.json.ts rename to src/routes/[lang]/destinations/index.json.ts diff --git a/src/routes/destinations/index.svelte b/src/routes/[lang]/destinations/index.svelte similarity index 100% rename from src/routes/destinations/index.svelte rename to src/routes/[lang]/destinations/index.svelte diff --git a/src/routes/login/index.json.ts b/src/routes/[lang]/login/index.json.ts similarity index 100% rename from src/routes/login/index.json.ts rename to src/routes/[lang]/login/index.json.ts diff --git a/src/routes/login/index.svelte b/src/routes/[lang]/login/index.svelte similarity index 81% rename from src/routes/login/index.svelte rename to src/routes/[lang]/login/index.svelte index b321bc086..dccbc90c9 100644 --- a/src/routes/login/index.svelte +++ b/src/routes/[lang]/login/index.svelte @@ -5,6 +5,8 @@ import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; import { onMount } from 'svelte'; + import { t } from '$lib/translations'; + let loading = false; let emailEl; let email, password; @@ -39,7 +41,7 @@
{#if $session.userId} -
Already logged in...
+
{$t('login.already_logged_in')}
{:else}
@@ -48,7 +50,7 @@ @@ -69,16 +71,19 @@ class="hover:opacity-90 text-white" class:bg-transparent={loading} class:text-stone-600={loading} - class:bg-coollabs={!loading}>{loading ? 'Authenticating...' : 'Login'}{loading ? $t('login.authenticating') : $t('login.login')} {$t('register.register')} goto('/reset')} + >{$t('reset_password.reset_password')}
diff --git a/src/routes/logout/index.json.ts b/src/routes/[lang]/logout/index.json.ts similarity index 100% rename from src/routes/logout/index.json.ts rename to src/routes/[lang]/logout/index.json.ts diff --git a/src/routes/new/destination/_LocalDocker.svelte b/src/routes/[lang]/new/destination/_LocalDocker.svelte similarity index 100% rename from src/routes/new/destination/_LocalDocker.svelte rename to src/routes/[lang]/new/destination/_LocalDocker.svelte diff --git a/src/routes/new/destination/_RemoteDocker.svelte b/src/routes/[lang]/new/destination/_RemoteDocker.svelte similarity index 100% rename from src/routes/new/destination/_RemoteDocker.svelte rename to src/routes/[lang]/new/destination/_RemoteDocker.svelte diff --git a/src/routes/new/destination/check.json.ts b/src/routes/[lang]/new/destination/check.json.ts similarity index 100% rename from src/routes/new/destination/check.json.ts rename to src/routes/[lang]/new/destination/check.json.ts diff --git a/src/routes/new/destination/docker.json.ts b/src/routes/[lang]/new/destination/docker.json.ts similarity index 100% rename from src/routes/new/destination/docker.json.ts rename to src/routes/[lang]/new/destination/docker.json.ts diff --git a/src/routes/new/destination/index.svelte b/src/routes/[lang]/new/destination/index.svelte similarity index 100% rename from src/routes/new/destination/index.svelte rename to src/routes/[lang]/new/destination/index.svelte diff --git a/src/routes/new/source/_Github.svelte b/src/routes/[lang]/new/source/_Github.svelte similarity index 100% rename from src/routes/new/source/_Github.svelte rename to src/routes/[lang]/new/source/_Github.svelte diff --git a/src/routes/new/source/_Gitlab.svelte b/src/routes/[lang]/new/source/_Gitlab.svelte similarity index 100% rename from src/routes/new/source/_Gitlab.svelte rename to src/routes/[lang]/new/source/_Gitlab.svelte diff --git a/src/routes/new/source/index.json.ts b/src/routes/[lang]/new/source/index.json.ts similarity index 100% rename from src/routes/new/source/index.json.ts rename to src/routes/[lang]/new/source/index.json.ts diff --git a/src/routes/new/source/index.svelte b/src/routes/[lang]/new/source/index.svelte similarity index 100% rename from src/routes/new/source/index.svelte rename to src/routes/[lang]/new/source/index.svelte diff --git a/src/routes/new/team/index.json.ts b/src/routes/[lang]/new/team/index.json.ts similarity index 100% rename from src/routes/new/team/index.json.ts rename to src/routes/[lang]/new/team/index.json.ts diff --git a/src/routes/new/team/index.svelte b/src/routes/[lang]/new/team/index.svelte similarity index 100% rename from src/routes/new/team/index.svelte rename to src/routes/[lang]/new/team/index.svelte diff --git a/src/routes/register/index.svelte b/src/routes/[lang]/register/index.svelte similarity index 84% rename from src/routes/register/index.svelte rename to src/routes/[lang]/register/index.svelte index 35501fce2..ee4e0a61e 100644 --- a/src/routes/register/index.svelte +++ b/src/routes/[lang]/register/index.svelte @@ -7,6 +7,7 @@ import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; import { onMount } from 'svelte'; + import { t } from '$lib/translations'; let loading = false; let emailEl; @@ -20,7 +21,7 @@ }); async function handleSubmit() { if (password !== passwordCheck) { - return errorNotification('Passwords do not match.'); + return errorNotification($t('register.passwords_do_not_match')); } loading = true; try { @@ -57,7 +58,7 @@
{#if $session.userId} -
Already logged in...
+
{$t('login.already_logged_in')}
{:else}
@@ -66,7 +67,7 @@
{$t('register.register')}
{#if userCount === 0}
- You are registering the first user. It will be the administrator of your Coolify instance. + {$t('register.register_first_user')}
{/if} {/if} diff --git a/src/routes/register/index.ts b/src/routes/[lang]/register/index.ts similarity index 100% rename from src/routes/register/index.ts rename to src/routes/[lang]/register/index.ts diff --git a/src/routes/reset/index.json.ts b/src/routes/[lang]/reset/index.json.ts similarity index 91% rename from src/routes/reset/index.json.ts rename to src/routes/[lang]/reset/index.json.ts index a75ea4766..21e403509 100644 --- a/src/routes/reset/index.json.ts +++ b/src/routes/[lang]/reset/index.json.ts @@ -16,7 +16,7 @@ export const post: RequestHandler = async (event) => { return { status: 500, body: { - error: 'Invalid secret key.' + error: 'reset_password.invalid_secret_key' } }; } diff --git a/src/routes/reset/index.svelte b/src/routes/[lang]/reset/index.svelte similarity index 100% rename from src/routes/reset/index.svelte rename to src/routes/[lang]/reset/index.svelte diff --git a/src/routes/reset/password.json.ts b/src/routes/[lang]/reset/password.json.ts similarity index 93% rename from src/routes/reset/password.json.ts rename to src/routes/[lang]/reset/password.json.ts index 28e9d56e3..9856349b3 100644 --- a/src/routes/reset/password.json.ts +++ b/src/routes/[lang]/reset/password.json.ts @@ -8,7 +8,7 @@ export const post: RequestHandler = async (event) => { return { status: 500, body: { - error: 'Invalid secret key.' + error: 'reset_password.invalid_secret_key' } }; } diff --git a/src/routes/services/[id]/_Services/_Ghost.svelte b/src/routes/[lang]/services/[id]/_Services/_Ghost.svelte similarity index 100% rename from src/routes/services/[id]/_Services/_Ghost.svelte rename to src/routes/[lang]/services/[id]/_Services/_Ghost.svelte diff --git a/src/routes/services/[id]/_Services/_MinIO.svelte b/src/routes/[lang]/services/[id]/_Services/_MinIO.svelte similarity index 100% rename from src/routes/services/[id]/_Services/_MinIO.svelte rename to src/routes/[lang]/services/[id]/_Services/_MinIO.svelte diff --git a/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte b/src/routes/[lang]/services/[id]/_Services/_PlausibleAnalytics.svelte similarity index 100% rename from src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte rename to src/routes/[lang]/services/[id]/_Services/_PlausibleAnalytics.svelte diff --git a/src/routes/services/[id]/_Services/_Services.svelte b/src/routes/[lang]/services/[id]/_Services/_Services.svelte similarity index 100% rename from src/routes/services/[id]/_Services/_Services.svelte rename to src/routes/[lang]/services/[id]/_Services/_Services.svelte diff --git a/src/routes/services/[id]/_Services/_VSCodeServer.svelte b/src/routes/[lang]/services/[id]/_Services/_VSCodeServer.svelte similarity index 100% rename from src/routes/services/[id]/_Services/_VSCodeServer.svelte rename to src/routes/[lang]/services/[id]/_Services/_VSCodeServer.svelte diff --git a/src/routes/services/[id]/_Services/_Wordpress.svelte b/src/routes/[lang]/services/[id]/_Services/_Wordpress.svelte similarity index 100% rename from src/routes/services/[id]/_Services/_Wordpress.svelte rename to src/routes/[lang]/services/[id]/_Services/_Wordpress.svelte diff --git a/src/routes/services/[id]/__layout.svelte b/src/routes/[lang]/services/[id]/__layout.svelte similarity index 100% rename from src/routes/services/[id]/__layout.svelte rename to src/routes/[lang]/services/[id]/__layout.svelte diff --git a/src/routes/services/[id]/check.json.ts b/src/routes/[lang]/services/[id]/check.json.ts similarity index 100% rename from src/routes/services/[id]/check.json.ts rename to src/routes/[lang]/services/[id]/check.json.ts diff --git a/src/routes/services/[id]/configuration/destination.json.ts b/src/routes/[lang]/services/[id]/configuration/destination.json.ts similarity index 100% rename from src/routes/services/[id]/configuration/destination.json.ts rename to src/routes/[lang]/services/[id]/configuration/destination.json.ts diff --git a/src/routes/services/[id]/configuration/destination.svelte b/src/routes/[lang]/services/[id]/configuration/destination.svelte similarity index 100% rename from src/routes/services/[id]/configuration/destination.svelte rename to src/routes/[lang]/services/[id]/configuration/destination.svelte diff --git a/src/routes/services/[id]/configuration/type.json.ts b/src/routes/[lang]/services/[id]/configuration/type.json.ts similarity index 100% rename from src/routes/services/[id]/configuration/type.json.ts rename to src/routes/[lang]/services/[id]/configuration/type.json.ts diff --git a/src/routes/services/[id]/configuration/type.svelte b/src/routes/[lang]/services/[id]/configuration/type.svelte similarity index 100% rename from src/routes/services/[id]/configuration/type.svelte rename to src/routes/[lang]/services/[id]/configuration/type.svelte diff --git a/src/routes/services/[id]/configuration/version.json.ts b/src/routes/[lang]/services/[id]/configuration/version.json.ts similarity index 100% rename from src/routes/services/[id]/configuration/version.json.ts rename to src/routes/[lang]/services/[id]/configuration/version.json.ts diff --git a/src/routes/services/[id]/configuration/version.svelte b/src/routes/[lang]/services/[id]/configuration/version.svelte similarity index 100% rename from src/routes/services/[id]/configuration/version.svelte rename to src/routes/[lang]/services/[id]/configuration/version.svelte diff --git a/src/routes/services/[id]/delete.json.ts b/src/routes/[lang]/services/[id]/delete.json.ts similarity index 100% rename from src/routes/services/[id]/delete.json.ts rename to src/routes/[lang]/services/[id]/delete.json.ts diff --git a/src/routes/services/[id]/ghost/index.json.ts b/src/routes/[lang]/services/[id]/ghost/index.json.ts similarity index 100% rename from src/routes/services/[id]/ghost/index.json.ts rename to src/routes/[lang]/services/[id]/ghost/index.json.ts diff --git a/src/routes/services/[id]/ghost/start.json.ts b/src/routes/[lang]/services/[id]/ghost/start.json.ts similarity index 100% rename from src/routes/services/[id]/ghost/start.json.ts rename to src/routes/[lang]/services/[id]/ghost/start.json.ts diff --git a/src/routes/services/[id]/ghost/stop.json.ts b/src/routes/[lang]/services/[id]/ghost/stop.json.ts similarity index 100% rename from src/routes/services/[id]/ghost/stop.json.ts rename to src/routes/[lang]/services/[id]/ghost/stop.json.ts diff --git a/src/routes/services/[id]/index.json.ts b/src/routes/[lang]/services/[id]/index.json.ts similarity index 100% rename from src/routes/services/[id]/index.json.ts rename to src/routes/[lang]/services/[id]/index.json.ts diff --git a/src/routes/services/[id]/index.svelte b/src/routes/[lang]/services/[id]/index.svelte similarity index 100% rename from src/routes/services/[id]/index.svelte rename to src/routes/[lang]/services/[id]/index.svelte diff --git a/src/routes/services/[id]/languagetool/index.json.ts b/src/routes/[lang]/services/[id]/languagetool/index.json.ts similarity index 100% rename from src/routes/services/[id]/languagetool/index.json.ts rename to src/routes/[lang]/services/[id]/languagetool/index.json.ts diff --git a/src/routes/services/[id]/languagetool/start.json.ts b/src/routes/[lang]/services/[id]/languagetool/start.json.ts similarity index 100% rename from src/routes/services/[id]/languagetool/start.json.ts rename to src/routes/[lang]/services/[id]/languagetool/start.json.ts diff --git a/src/routes/services/[id]/languagetool/stop.json.ts b/src/routes/[lang]/services/[id]/languagetool/stop.json.ts similarity index 100% rename from src/routes/services/[id]/languagetool/stop.json.ts rename to src/routes/[lang]/services/[id]/languagetool/stop.json.ts diff --git a/src/routes/services/[id]/minio/index.json.ts b/src/routes/[lang]/services/[id]/minio/index.json.ts similarity index 100% rename from src/routes/services/[id]/minio/index.json.ts rename to src/routes/[lang]/services/[id]/minio/index.json.ts diff --git a/src/routes/services/[id]/minio/start.json.ts b/src/routes/[lang]/services/[id]/minio/start.json.ts similarity index 100% rename from src/routes/services/[id]/minio/start.json.ts rename to src/routes/[lang]/services/[id]/minio/start.json.ts diff --git a/src/routes/services/[id]/minio/stop.json.ts b/src/routes/[lang]/services/[id]/minio/stop.json.ts similarity index 100% rename from src/routes/services/[id]/minio/stop.json.ts rename to src/routes/[lang]/services/[id]/minio/stop.json.ts diff --git a/src/routes/services/[id]/n8n/index.json.ts b/src/routes/[lang]/services/[id]/n8n/index.json.ts similarity index 100% rename from src/routes/services/[id]/n8n/index.json.ts rename to src/routes/[lang]/services/[id]/n8n/index.json.ts diff --git a/src/routes/services/[id]/n8n/start.json.ts b/src/routes/[lang]/services/[id]/n8n/start.json.ts similarity index 100% rename from src/routes/services/[id]/n8n/start.json.ts rename to src/routes/[lang]/services/[id]/n8n/start.json.ts diff --git a/src/routes/services/[id]/n8n/stop.json.ts b/src/routes/[lang]/services/[id]/n8n/stop.json.ts similarity index 100% rename from src/routes/services/[id]/n8n/stop.json.ts rename to src/routes/[lang]/services/[id]/n8n/stop.json.ts diff --git a/src/routes/services/[id]/nocodb/index.json.ts b/src/routes/[lang]/services/[id]/nocodb/index.json.ts similarity index 100% rename from src/routes/services/[id]/nocodb/index.json.ts rename to src/routes/[lang]/services/[id]/nocodb/index.json.ts diff --git a/src/routes/services/[id]/nocodb/start.json.ts b/src/routes/[lang]/services/[id]/nocodb/start.json.ts similarity index 100% rename from src/routes/services/[id]/nocodb/start.json.ts rename to src/routes/[lang]/services/[id]/nocodb/start.json.ts diff --git a/src/routes/services/[id]/nocodb/stop.json.ts b/src/routes/[lang]/services/[id]/nocodb/stop.json.ts similarity index 100% rename from src/routes/services/[id]/nocodb/stop.json.ts rename to src/routes/[lang]/services/[id]/nocodb/stop.json.ts diff --git a/src/routes/services/[id]/plausibleanalytics/activate.json.ts b/src/routes/[lang]/services/[id]/plausibleanalytics/activate.json.ts similarity index 100% rename from src/routes/services/[id]/plausibleanalytics/activate.json.ts rename to src/routes/[lang]/services/[id]/plausibleanalytics/activate.json.ts diff --git a/src/routes/services/[id]/plausibleanalytics/index.json.ts b/src/routes/[lang]/services/[id]/plausibleanalytics/index.json.ts similarity index 100% rename from src/routes/services/[id]/plausibleanalytics/index.json.ts rename to src/routes/[lang]/services/[id]/plausibleanalytics/index.json.ts diff --git a/src/routes/services/[id]/plausibleanalytics/start.json.ts b/src/routes/[lang]/services/[id]/plausibleanalytics/start.json.ts similarity index 100% rename from src/routes/services/[id]/plausibleanalytics/start.json.ts rename to src/routes/[lang]/services/[id]/plausibleanalytics/start.json.ts diff --git a/src/routes/services/[id]/plausibleanalytics/stop.json.ts b/src/routes/[lang]/services/[id]/plausibleanalytics/stop.json.ts similarity index 100% rename from src/routes/services/[id]/plausibleanalytics/stop.json.ts rename to src/routes/[lang]/services/[id]/plausibleanalytics/stop.json.ts diff --git a/src/routes/services/[id]/secrets/_Secret.svelte b/src/routes/[lang]/services/[id]/secrets/_Secret.svelte similarity index 100% rename from src/routes/services/[id]/secrets/_Secret.svelte rename to src/routes/[lang]/services/[id]/secrets/_Secret.svelte diff --git a/src/routes/services/[id]/secrets/index.json.ts b/src/routes/[lang]/services/[id]/secrets/index.json.ts similarity index 100% rename from src/routes/services/[id]/secrets/index.json.ts rename to src/routes/[lang]/services/[id]/secrets/index.json.ts diff --git a/src/routes/services/[id]/secrets/index.svelte b/src/routes/[lang]/services/[id]/secrets/index.svelte similarity index 100% rename from src/routes/services/[id]/secrets/index.svelte rename to src/routes/[lang]/services/[id]/secrets/index.svelte diff --git a/src/routes/services/[id]/settings.json.ts b/src/routes/[lang]/services/[id]/settings.json.ts similarity index 100% rename from src/routes/services/[id]/settings.json.ts rename to src/routes/[lang]/services/[id]/settings.json.ts diff --git a/src/routes/services/[id]/uptimekuma/index.json.ts b/src/routes/[lang]/services/[id]/uptimekuma/index.json.ts similarity index 100% rename from src/routes/services/[id]/uptimekuma/index.json.ts rename to src/routes/[lang]/services/[id]/uptimekuma/index.json.ts diff --git a/src/routes/services/[id]/uptimekuma/start.json.ts b/src/routes/[lang]/services/[id]/uptimekuma/start.json.ts similarity index 100% rename from src/routes/services/[id]/uptimekuma/start.json.ts rename to src/routes/[lang]/services/[id]/uptimekuma/start.json.ts diff --git a/src/routes/services/[id]/uptimekuma/stop.json.ts b/src/routes/[lang]/services/[id]/uptimekuma/stop.json.ts similarity index 100% rename from src/routes/services/[id]/uptimekuma/stop.json.ts rename to src/routes/[lang]/services/[id]/uptimekuma/stop.json.ts diff --git a/src/routes/services/[id]/vaultwarden/index.json.ts b/src/routes/[lang]/services/[id]/vaultwarden/index.json.ts similarity index 100% rename from src/routes/services/[id]/vaultwarden/index.json.ts rename to src/routes/[lang]/services/[id]/vaultwarden/index.json.ts diff --git a/src/routes/services/[id]/vaultwarden/start.json.ts b/src/routes/[lang]/services/[id]/vaultwarden/start.json.ts similarity index 100% rename from src/routes/services/[id]/vaultwarden/start.json.ts rename to src/routes/[lang]/services/[id]/vaultwarden/start.json.ts diff --git a/src/routes/services/[id]/vaultwarden/stop.json.ts b/src/routes/[lang]/services/[id]/vaultwarden/stop.json.ts similarity index 100% rename from src/routes/services/[id]/vaultwarden/stop.json.ts rename to src/routes/[lang]/services/[id]/vaultwarden/stop.json.ts diff --git a/src/routes/services/[id]/vscodeserver/index.json.ts b/src/routes/[lang]/services/[id]/vscodeserver/index.json.ts similarity index 100% rename from src/routes/services/[id]/vscodeserver/index.json.ts rename to src/routes/[lang]/services/[id]/vscodeserver/index.json.ts diff --git a/src/routes/services/[id]/vscodeserver/start.json.ts b/src/routes/[lang]/services/[id]/vscodeserver/start.json.ts similarity index 100% rename from src/routes/services/[id]/vscodeserver/start.json.ts rename to src/routes/[lang]/services/[id]/vscodeserver/start.json.ts diff --git a/src/routes/services/[id]/vscodeserver/stop.json.ts b/src/routes/[lang]/services/[id]/vscodeserver/stop.json.ts similarity index 100% rename from src/routes/services/[id]/vscodeserver/stop.json.ts rename to src/routes/[lang]/services/[id]/vscodeserver/stop.json.ts diff --git a/src/routes/services/[id]/wordpress/index.json.ts b/src/routes/[lang]/services/[id]/wordpress/index.json.ts similarity index 100% rename from src/routes/services/[id]/wordpress/index.json.ts rename to src/routes/[lang]/services/[id]/wordpress/index.json.ts diff --git a/src/routes/services/[id]/wordpress/start.json.ts b/src/routes/[lang]/services/[id]/wordpress/start.json.ts similarity index 100% rename from src/routes/services/[id]/wordpress/start.json.ts rename to src/routes/[lang]/services/[id]/wordpress/start.json.ts diff --git a/src/routes/services/[id]/wordpress/stop.json.ts b/src/routes/[lang]/services/[id]/wordpress/stop.json.ts similarity index 100% rename from src/routes/services/[id]/wordpress/stop.json.ts rename to src/routes/[lang]/services/[id]/wordpress/stop.json.ts diff --git a/src/routes/services/index.svelte b/src/routes/[lang]/services/index.svelte similarity index 100% rename from src/routes/services/index.svelte rename to src/routes/[lang]/services/index.svelte diff --git a/src/routes/services/index.ts b/src/routes/[lang]/services/index.ts similarity index 100% rename from src/routes/services/index.ts rename to src/routes/[lang]/services/index.ts diff --git a/src/routes/services/new.ts b/src/routes/[lang]/services/new.ts similarity index 100% rename from src/routes/services/new.ts rename to src/routes/[lang]/services/new.ts diff --git a/src/routes/settings/check.json.ts b/src/routes/[lang]/settings/check.json.ts similarity index 100% rename from src/routes/settings/check.json.ts rename to src/routes/[lang]/settings/check.json.ts diff --git a/src/routes/settings/index.json.ts b/src/routes/[lang]/settings/index.json.ts similarity index 100% rename from src/routes/settings/index.json.ts rename to src/routes/[lang]/settings/index.json.ts diff --git a/src/routes/settings/index.svelte b/src/routes/[lang]/settings/index.svelte similarity index 100% rename from src/routes/settings/index.svelte rename to src/routes/[lang]/settings/index.svelte diff --git a/src/routes/sources/[id]/_Github.svelte b/src/routes/[lang]/sources/[id]/_Github.svelte similarity index 81% rename from src/routes/sources/[id]/_Github.svelte rename to src/routes/[lang]/sources/[id]/_Github.svelte index 102971353..e3243fc76 100644 --- a/src/routes/sources/[id]/_Github.svelte +++ b/src/routes/[lang]/sources/[id]/_Github.svelte @@ -3,6 +3,7 @@ import { page, session } from '$app/stores'; import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; const { id } = $page.params; let loading = false; @@ -43,7 +44,7 @@ const top = screen.height / 2 - 618 / 2; const newWindow = open( `/sources/${id}/newGithubApp`, - 'New Github App', + $t('sources.source.new_github_app'), 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' + top + ', left=' + @@ -60,30 +61,32 @@ {#if !source.githubAppId} - + {:else if source.githubApp?.installationId}
-
General
+
{$t('general')}
{#if $session.isAdmin} {loading ? $t('saving') : $t('save')} {$t('sources.source.change_app_settings', { values: { name: 'Github' } })} {/if}
- +
{:else} - + {/if} diff --git a/src/routes/sources/[id]/_Gitlab.svelte b/src/routes/[lang]/sources/[id]/_Gitlab.svelte similarity index 100% rename from src/routes/sources/[id]/_Gitlab.svelte rename to src/routes/[lang]/sources/[id]/_Gitlab.svelte diff --git a/src/routes/sources/[id]/__layout.svelte b/src/routes/[lang]/sources/[id]/__layout.svelte similarity index 82% rename from src/routes/sources/[id]/__layout.svelte rename to src/routes/[lang]/sources/[id]/__layout.svelte index 0f5139558..accaa7c06 100644 --- a/src/routes/sources/[id]/__layout.svelte +++ b/src/routes/[lang]/sources/[id]/__layout.svelte @@ -34,10 +34,11 @@ import { page, session } from '$app/stores'; import { errorNotification } from '$lib/form'; import DeleteIcon from '$lib/components/DeleteIcon.svelte'; + import { t } from '$lib/translations'; const { id } = $page.params; async function deleteSource(name) { - const sure = confirm(`Are you sure you would like to delete '${name}'?`); + const sure = confirm(`${$t('sources.source.sure_to_delete')} '${name}'?`); if (sure) { const response = await fetch(`/sources/${id}.json`, { method: 'delete' @@ -55,14 +56,14 @@ diff --git a/src/routes/sources/[id]/check.json.ts b/src/routes/[lang]/sources/[id]/check.json.ts similarity index 100% rename from src/routes/sources/[id]/check.json.ts rename to src/routes/[lang]/sources/[id]/check.json.ts diff --git a/src/routes/sources/[id]/gitlab.json.ts b/src/routes/[lang]/sources/[id]/gitlab.json.ts similarity index 100% rename from src/routes/sources/[id]/gitlab.json.ts rename to src/routes/[lang]/sources/[id]/gitlab.json.ts diff --git a/src/routes/sources/[id]/index.json.ts b/src/routes/[lang]/sources/[id]/index.json.ts similarity index 100% rename from src/routes/sources/[id]/index.json.ts rename to src/routes/[lang]/sources/[id]/index.json.ts diff --git a/src/routes/sources/[id]/index.svelte b/src/routes/[lang]/sources/[id]/index.svelte similarity index 100% rename from src/routes/sources/[id]/index.svelte rename to src/routes/[lang]/sources/[id]/index.svelte diff --git a/src/routes/sources/[id]/newGithubApp.svelte b/src/routes/[lang]/sources/[id]/newGithubApp.svelte similarity index 100% rename from src/routes/sources/[id]/newGithubApp.svelte rename to src/routes/[lang]/sources/[id]/newGithubApp.svelte diff --git a/src/routes/sources/index.json.ts b/src/routes/[lang]/sources/index.json.ts similarity index 100% rename from src/routes/sources/index.json.ts rename to src/routes/[lang]/sources/index.json.ts diff --git a/src/routes/sources/index.svelte b/src/routes/[lang]/sources/index.svelte similarity index 88% rename from src/routes/sources/index.svelte rename to src/routes/[lang]/sources/index.svelte index bd9039514..4823c1e64 100644 --- a/src/routes/sources/index.svelte +++ b/src/routes/[lang]/sources/index.svelte @@ -22,10 +22,11 @@
-
Git Sources
+
{$t('index.git_sources')}
{#if $session.isAdmin} {#if !sources || sources.length === 0}
-
No git sources found
+
{$t('sources.no_git_sources_found')}
{:else}
@@ -62,7 +63,7 @@
{source.name}
{#if (source.type === 'gitlab' && !source.gitlabAppId) || (source.type === 'github' && !source.githubAppId && !source.githubApp?.installationId)}
- Configuration missing + {$t('application.configuration_missing')}
{:else}
{source.htmlUrl}
diff --git a/src/routes/teams/[id]/__layout.svelte b/src/routes/[lang]/teams/[id]/__layout.svelte similarity index 100% rename from src/routes/teams/[id]/__layout.svelte rename to src/routes/[lang]/teams/[id]/__layout.svelte diff --git a/src/routes/teams/[id]/index.json.ts b/src/routes/[lang]/teams/[id]/index.json.ts similarity index 100% rename from src/routes/teams/[id]/index.json.ts rename to src/routes/[lang]/teams/[id]/index.json.ts diff --git a/src/routes/teams/[id]/index.svelte b/src/routes/[lang]/teams/[id]/index.svelte similarity index 100% rename from src/routes/teams/[id]/index.svelte rename to src/routes/[lang]/teams/[id]/index.svelte diff --git a/src/routes/teams/[id]/invitation/accept.json.ts b/src/routes/[lang]/teams/[id]/invitation/accept.json.ts similarity index 100% rename from src/routes/teams/[id]/invitation/accept.json.ts rename to src/routes/[lang]/teams/[id]/invitation/accept.json.ts diff --git a/src/routes/teams/[id]/invitation/invite.json.ts b/src/routes/[lang]/teams/[id]/invitation/invite.json.ts similarity index 100% rename from src/routes/teams/[id]/invitation/invite.json.ts rename to src/routes/[lang]/teams/[id]/invitation/invite.json.ts diff --git a/src/routes/teams/[id]/invitation/revoke.json.ts b/src/routes/[lang]/teams/[id]/invitation/revoke.json.ts similarity index 100% rename from src/routes/teams/[id]/invitation/revoke.json.ts rename to src/routes/[lang]/teams/[id]/invitation/revoke.json.ts diff --git a/src/routes/teams/[id]/permission/change.json.ts b/src/routes/[lang]/teams/[id]/permission/change.json.ts similarity index 100% rename from src/routes/teams/[id]/permission/change.json.ts rename to src/routes/[lang]/teams/[id]/permission/change.json.ts diff --git a/src/routes/teams/[id]/remove/user.json.ts b/src/routes/[lang]/teams/[id]/remove/user.json.ts similarity index 100% rename from src/routes/teams/[id]/remove/user.json.ts rename to src/routes/[lang]/teams/[id]/remove/user.json.ts diff --git a/src/routes/teams/index.json.ts b/src/routes/[lang]/teams/index.json.ts similarity index 100% rename from src/routes/teams/index.json.ts rename to src/routes/[lang]/teams/index.json.ts diff --git a/src/routes/teams/index.svelte b/src/routes/[lang]/teams/index.svelte similarity index 100% rename from src/routes/teams/index.svelte rename to src/routes/[lang]/teams/index.svelte diff --git a/src/routes/__error.svelte b/src/routes/__error.svelte index 67693e70a..97ee15b01 100644 --- a/src/routes/__error.svelte +++ b/src/routes/__error.svelte @@ -12,17 +12,17 @@
{status}
-
Ooops you are lost! But don't be afraid!
+
{$t('error.oops_your_lost')}
 	import type { Load } from '@sveltejs/kit';
-	import { publicPaths } from '$lib/settings';
+	import { isPublicPath } from '$lib/settings';
+	import { locale, loadTranslations } from '$lib/translations';
 
 	export const load: Load = async ({ fetch, url, session }) => {
-		if (!session.userId && !publicPaths.includes(url.pathname)) {
+		const { pathname } = url;
+		const lang = `${pathname.match(/[^/]+?(?=\/|$)/) || ''}`;
+		const route = pathname.replace(new RegExp(`^/${lang}`), '');
+		await loadTranslations(lang, route);
+
+		if (!session.userId && !isPublicPath(route)) {
 			return {
 				status: 302,
 				redirect: '/login'
@@ -38,18 +44,7 @@
 	import { errorNotification } from '$lib/form';
 	import { asyncSleep } from '$lib/components/common';
 	import { del, get, post } from '$lib/api';
-	import { register, init, _, getLocaleFromNavigator } from 'svelte-i18n';
-
-	async function setup() {
-		register('en', () => import('../../static/locales/en.json'));
-
-		return await Promise.allSettled([
-			// TODO: add some more stuff you want to init ...
-			init({ initialLocale: getLocaleFromNavigator(), fallbackLocale: 'en' })
-		]);
-	}
-
-	const setupResult = setup();
+	import { t } from '$lib/translations';
 
 	let isUpdateAvailable = false;
 
@@ -59,6 +54,7 @@
 		success: null
 	};
 	let latestVersion = 'latest';
+
 	onMount(async () => {
 		if ($session.userId) {
 			const overrideVersion = browser && window.localStorage.getItem('latestVersion');
@@ -115,7 +111,7 @@
 				return window.location.reload();
 			} else {
 				await post(`/update.json`, { type: 'update', latestVersion });
-				toast.push(`${$_('layout.update_done')}

${$_('layout.wait_new_version_startup')}`); + toast.push(`${$t('layout.update_done')}

${$t('layout.wait_new_version_startup')}`); let reachable = false; let tries = 0; do { @@ -129,7 +125,7 @@ if (reachable) break; tries++; } while (!reachable || tries < 120); - toast.push($_('layout.new_version')); + toast.push($t('layout.new_version')); updateStatus.loading = false; updateStatus.success = true; await asyncSleep(3000); @@ -147,309 +143,332 @@ Coolify -{#await setupResult} - Please wait... -{:then} - - {#if $session.userId} - + +{/if} +
+ +
diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 1a5f61b4b..e67e7d64d 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,5 +1,6 @@
-
Dashboard
+
{$t('dashboard')}
@@ -44,7 +45,7 @@ class="flex cursor-pointer flex-col rounded p-6 text-center text-green-500 no-underline transition duration-150 hover:bg-green-500 hover:text-white" >
- Applications + {$t('index.applications')}
{applicationsCount} @@ -56,7 +57,7 @@ class="flex cursor-pointer flex-col rounded p-6 text-center text-sky-500 no-underline transition duration-150 hover:bg-sky-500 hover:text-white" >
- Destinations + {$t('index.destinations')}
{destinationsCount} @@ -68,7 +69,7 @@ class="flex cursor-pointer flex-col rounded p-6 text-center text-orange-500 no-underline transition duration-150 hover:bg-orange-500 hover:text-white" >
- Git Sources + {$t('index.git_sources')}
{sourcesCount} @@ -79,7 +80,9 @@ sveltekit:prefetch class="flex cursor-pointer flex-col rounded p-6 text-center text-purple-500 no-underline transition duration-150 hover:bg-purple-500 hover:text-white" > -
Databases
+
+ {$t('index.databases')} +
{databasesCount}
-
Services
+
+ {$t('index.services')} +
{servicesCount}
@@ -96,7 +101,9 @@ sveltekit:prefetch class="flex cursor-pointer flex-col rounded p-6 text-center text-cyan-500 no-underline transition duration-150 hover:bg-cyan-500 hover:text-white" > -
Teams
+
+ {$t('index.teams')} +
{teamsCount}
diff --git a/static/locales/en.json b/static/locales/en.json index aa64ad4e5..897d6158c 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -8,6 +8,59 @@ }, "error": { "you_can_find_your_way_back": "You can find your way back", - "here": "here" + "here": "here", + "oops_your_lost": "Ooops you are lost! But don't be afraid!", + "generic_message": "Ooops, something is not okay, are you okay?" + }, + "index": { + "applications": "Applications", + "destinations": "Destinations", + "git_sources": "Git Sources", + "databases": "Databases", + "services": "Services", + "teams": "Teams" + }, + "dashboard": "Dashboard", + "application": { + "configuration_missing": "Configuration missing", + "no_applications_found": "No applications found", + "app": { + "error_double_app_for_one_branch": "Cannot activate automatic deployments until only one application is defined for this repository / branch." + } + }, + "sources": { + "no_git_sources_found": "No git sources found", + "source": { + "delete_git_source": "Delete Git Source", + "permission_denied_delete_git_source": "You do not have permission to delete a Git Source", + "sure_to_delete": "Are you sure you would like to delete", + "create_new_github_app": "Create new GitHub App", + "install_repositories": "Install Repositories", + "change_app_settings": "Change {name} App Settings", + "new_github_app": "New Github App" + } + }, + "general": "General", + "saving": "Saving...", + "save": "Save", + "forms": { + "name": "Name", + "email": "Email", + "password": "Password", + "password_again": "Password again" + }, + "login": { + "already_logged_in": "Already logged in...", + "authenticating": "Authenticating...", + "login": "Login" + }, + "register": { + "register": "Register", + "passwords_do_not_match": "Passwords do not match.", + "register_first_user": "You are registering the first user. It will be the administrator of your Coolify instance." + }, + "reset_password": { + "reset_password": "Reset password", + "invalid_secret_key": "Invalid secret key." } } diff --git a/static/locales/fr.json b/static/locales/fr.json new file mode 100644 index 000000000..2cce1d2fb --- /dev/null +++ b/static/locales/fr.json @@ -0,0 +1,66 @@ +{ + "layout": { + "update_done": "Mise à jour réalisée.", + "wait_new_version_startup": "En attente du démarrage de la nouvelle version...", + "new_version": "Nouvel version accessible. Rafraichissement de la page...", + "switch_to_a_different_team": "Changer d'équipe...", + "update_available": "Mise à jour disponible" + }, + "error": { + "you_can_find_your_way_back": "Vous ne trouvez pas votre chemin ?", + "here": "Ici", + "oops_your_lost": "Oups vous êtes perdu ! \nMais n'ayez pas peur !", + "generic_message": "Oups, quelque chose ne va pas, ça va ?" + }, + "dashboard": "Tableau de bord", + "index": { + "applications": "Applications", + "databases": "Bases de données", + "destinations": "Destinations", + "git_sources": "Sources Git", + "services": "Services", + "teams": "Équipes" + }, + "application": { + "no_applications_found": "Aucune application trouvée", + "app": { + "error_double_app_for_one_branch": "Impossible d'activer les déploiements automatiques tant qu'une seule application n'est pas définie pour ce référentiel/branche." + }, + "configuration_missing": "Configuration manquante" + }, + "forms": { + "email": "E-mail", + "name": "Nom", + "password": "Mot de passe", + "password_again": "Retaper le mot de passe" + }, + "general": "Général", + "login": { + "already_logged_in": "Déjà connecté...", + "authenticating": "Authentification...", + "login": "Connexion" + }, + "register": { + "passwords_do_not_match": "Les mots de passe ne correspondent pas.", + "register": "S'inscrire", + "register_first_user": "Vous enregistrez le premier utilisateur. \nCe sera l'administrateur de votre instance Coolify." + }, + "reset_password": { + "invalid_secret_key": "Clé secrète invalide.", + "reset_password": "Réinitialiser le mot de passe" + }, + "save": "Enregistrer", + "saving": "Enregistrement...", + "sources": { + "no_git_sources_found": "Aucune source git trouvée", + "source": { + "change_app_settings": "Modifier les paramètres de l'application {name}", + "create_new_github_app": "Créer une nouvelle application GitHub", + "delete_git_source": "Supprimer la source Git", + "install_repositories": "Installer les référentiels", + "new_github_app": "Nouvelle application Github", + "permission_denied_delete_git_source": "Vous n'êtes pas autorisé à supprimer une source Git", + "sure_to_delete": "Êtes-vous sûr de vouloir supprimer" + } + } +} From 614eb923d84a5c3bee4008bec2291b5d4e9ff5c1 Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 17:33:50 +0200 Subject: [PATCH 03/23] Patch bugs on locale redirections --- src/hooks.ts | 66 ++-- src/lib/lang.json | 4 +- src/lib/translations.ts | 10 +- src/routes/__layout.svelte | 745 +++++++++++++++++++------------------ 4 files changed, 414 insertions(+), 411 deletions(-) diff --git a/src/hooks.ts b/src/hooks.ts index 4a0fa2e87..53b6d07f2 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -18,6 +18,36 @@ export const handle = handleSession( }, async function ({ event, resolve }) { let response; + let locale; + + const { url, request } = event; + const { pathname } = url; + + // If this request is a route request + if (routeRegex.test(pathname)) { + // Get defined locales + const supportedLocales = locales.get(); + + // Try to get locale from `pathname`. + locale = supportedLocales.find( + (l) => `${l}`.toLowerCase() === `${pathname.match(/[^/]+?(?=\/|$)/)}`.toLowerCase() + ); + + if (!locale) { + // Get user preferred locale + locale = `${`${request.headers.get('accept-language')}`.match(/[a-zA-Z-]+?(?=_|,|;)/)}`; + + // Set default locale if user preferred locale does not match + if (!supportedLocales.includes(locale)) locale = 'en-US'; + + // 302 redirect + return new Response(undefined, { + headers: { location: `/${locale}${pathname}` }, + status: 302 + }); + } + } + try { if (event.locals.cookies) { if (event.locals.cookies['kit.session']) { @@ -40,7 +70,6 @@ export const handle = handleSession( ssr: !event.url.pathname.startsWith('/webhooks/success') }); } catch (error) { - console.log(error); response = await resolve(event, { ssr: !event.url.pathname.startsWith('/webhooks/success') }); @@ -67,40 +96,9 @@ export const handle = handleSession( ); } - const { url, request } = event; - const { pathname } = url; - - // If this request is a route request - if (routeRegex.test(pathname)) { - // Get defined locales - const supportedLocales = locales.get(); - - // Try to get locale from `pathname`. - let locale = supportedLocales.find( - (l) => `${l}`.toLowerCase() === `${pathname.match(/[^/]+?(?=\/|$)/)}`.toLowerCase() - ); - - // If route locale is not supported - if (!locale) { - // Get user preferred locale - locale = `${`${request.headers['accept-language']}`.match( - /[a-zA-Z]+?(?=-|_|,|;)/ - )}`.toLowerCase(); - - // Set default locale if user preferred locale does not match - if (!supportedLocales.includes(locale)) locale = 'en'; - - // 301 redirect - return new Response(undefined, { - headers: { location: `/${locale}${pathname}` }, - status: 301 - }); - } - - // Add html `lang` attribute + if (locale && response.headers.get('content-type') === 'text/html') { const body = await response.text(); - - return new Response(`${body}`.replace(//, ``), response); + return new Response(body.replace(//, ``), response); } return response; diff --git a/src/lib/lang.json b/src/lib/lang.json index b01c522bb..082405899 100644 --- a/src/lib/lang.json +++ b/src/lib/lang.json @@ -1,4 +1,4 @@ { - "en": "English", - "fr": "Français" + "en-US": "English", + "fr-FR": "Français" } diff --git a/src/lib/translations.ts b/src/lib/translations.ts index 299c8a75b..cfa5398ab 100644 --- a/src/lib/translations.ts +++ b/src/lib/translations.ts @@ -3,19 +3,19 @@ import lang from './lang.json'; /** @type {import('sveltekit-i18n').Config} */ export const config = { - fallbackLocale: 'en', + fallbackLocale: 'en-US', translations: { - en: { lang }, - fr: { lang } + 'en-US': { lang }, + 'fr-FR': { lang } }, loaders: [ { - locale: 'en', + locale: 'en-US', key: '', loader: async () => (await import('../../static/locales/en.json')).default }, { - locale: 'fr', + locale: 'fr-FR', key: '', loader: async () => (await import('../../static/locales/fr.json')).default } diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 1cc8f8198..abb230389 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -1,7 +1,7 @@
{status}
-
{$t('error.oops_your_lost')}
+
Ooops you are lost! But don't be afraid!
- {$t('error.you_can_find_your_way_back')} - {$t('error.here')} + {$_('error.you_can_find_your_way_back')} + {$_('error.here')}
 	import type { Load } from '@sveltejs/kit';
-	import { isPublicPath } from '$lib/settings';
-	import { locale, loadTranslations } from '$lib/translations';
+	import { publicPaths } from '$lib/settings';
 
 	export const load: Load = async ({ fetch, url, session }) => {
-		const { pathname } = url;
-		const lang = `${pathname.match(/[^/]+?(?=\/|$)/) || ''}`;
-		const route = pathname.replace(new RegExp(`^/${lang}`), '');
-		await loadTranslations(lang, route);
-
-		if (!session.userId && !isPublicPath(route)) {
+		if (!session.userId && !publicPaths.includes(url.pathname)) {
 			return {
 				status: 302,
 				redirect: '/login'
@@ -44,7 +38,18 @@
 	import { errorNotification } from '$lib/form';
 	import { asyncSleep } from '$lib/components/common';
 	import { del, get, post } from '$lib/api';
-	import { t } from '$lib/translations';
+	import { register, init, _, getLocaleFromNavigator } from 'svelte-i18n';
+
+	async function setup() {
+		register('en', () => import('../../static/locales/en.json'));
+
+		return await Promise.allSettled([
+			// TODO: add some more stuff you want to init ...
+			init({ initialLocale: getLocaleFromNavigator(), fallbackLocale: 'en' })
+		]);
+	}
+
+	const setupResult = setup();
 
 	let isUpdateAvailable = false;
 
@@ -54,7 +59,6 @@
 		success: null
 	};
 	let latestVersion = 'latest';
-
 	onMount(async () => {
 		if ($session.userId) {
 			const overrideVersion = browser && window.localStorage.getItem('latestVersion');
@@ -111,7 +115,7 @@
 				return window.location.reload();
 			} else {
 				await post(`/update.json`, { type: 'update', latestVersion });
-				toast.push(`${$t('layout.update_done')}

${$t('layout.wait_new_version_startup')}`); + toast.push(`${$_('layout.update_done')}

${$_('layout.wait_new_version_startup')}`); let reachable = false; let tries = 0; do { @@ -125,7 +129,7 @@ if (reachable) break; tries++; } while (!reachable || tries < 120); - toast.push($t('layout.new_version')); + toast.push($_('layout.new_version')); updateStatus.loading = false; updateStatus.success = true; await asyncSleep(3000); @@ -143,332 +147,22 @@ Coolify - -{#if $session.userId} - + + {/if} +
+ +
+{:catch error} +

{error.message}

+{/await} diff --git a/src/routes/[lang]/applications/[id]/__layout.svelte b/src/routes/applications/[id]/__layout.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/__layout.svelte rename to src/routes/applications/[id]/__layout.svelte diff --git a/src/routes/[lang]/applications/[id]/check.json.ts b/src/routes/applications/[id]/check.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/check.json.ts rename to src/routes/applications/[id]/check.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/_BuildPack.svelte b/src/routes/applications/[id]/configuration/_BuildPack.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/_BuildPack.svelte rename to src/routes/applications/[id]/configuration/_BuildPack.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/_GithubRepositories.svelte b/src/routes/applications/[id]/configuration/_GithubRepositories.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/_GithubRepositories.svelte rename to src/routes/applications/[id]/configuration/_GithubRepositories.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/_GitlabRepositories.svelte b/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/_GitlabRepositories.svelte rename to src/routes/applications/[id]/configuration/_GitlabRepositories.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/buildpack.json.ts b/src/routes/applications/[id]/configuration/buildpack.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/buildpack.json.ts rename to src/routes/applications/[id]/configuration/buildpack.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/buildpack.svelte b/src/routes/applications/[id]/configuration/buildpack.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/buildpack.svelte rename to src/routes/applications/[id]/configuration/buildpack.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/deploykey.json.ts b/src/routes/applications/[id]/configuration/deploykey.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/deploykey.json.ts rename to src/routes/applications/[id]/configuration/deploykey.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/destination.json.ts b/src/routes/applications/[id]/configuration/destination.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/destination.json.ts rename to src/routes/applications/[id]/configuration/destination.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/destination.svelte b/src/routes/applications/[id]/configuration/destination.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/destination.svelte rename to src/routes/applications/[id]/configuration/destination.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/githubToken.json.ts b/src/routes/applications/[id]/configuration/githubToken.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/githubToken.json.ts rename to src/routes/applications/[id]/configuration/githubToken.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/repository.json.ts b/src/routes/applications/[id]/configuration/repository.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/repository.json.ts rename to src/routes/applications/[id]/configuration/repository.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/repository.svelte b/src/routes/applications/[id]/configuration/repository.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/repository.svelte rename to src/routes/applications/[id]/configuration/repository.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/source.json.ts b/src/routes/applications/[id]/configuration/source.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/source.json.ts rename to src/routes/applications/[id]/configuration/source.json.ts diff --git a/src/routes/[lang]/applications/[id]/configuration/source.svelte b/src/routes/applications/[id]/configuration/source.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/source.svelte rename to src/routes/applications/[id]/configuration/source.svelte diff --git a/src/routes/[lang]/applications/[id]/configuration/sshkey.json.ts b/src/routes/applications/[id]/configuration/sshkey.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/configuration/sshkey.json.ts rename to src/routes/applications/[id]/configuration/sshkey.json.ts diff --git a/src/routes/[lang]/applications/[id]/delete.json.ts b/src/routes/applications/[id]/delete.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/delete.json.ts rename to src/routes/applications/[id]/delete.json.ts diff --git a/src/routes/[lang]/applications/[id]/deploy.json.ts b/src/routes/applications/[id]/deploy.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/deploy.json.ts rename to src/routes/applications/[id]/deploy.json.ts diff --git a/src/routes/[lang]/applications/[id]/index.json.ts b/src/routes/applications/[id]/index.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/index.json.ts rename to src/routes/applications/[id]/index.json.ts diff --git a/src/routes/[lang]/applications/[id]/index.svelte b/src/routes/applications/[id]/index.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/index.svelte rename to src/routes/applications/[id]/index.svelte diff --git a/src/routes/[lang]/applications/[id]/logs/_Loading.svelte b/src/routes/applications/[id]/logs/_Loading.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/_Loading.svelte rename to src/routes/applications/[id]/logs/_Loading.svelte diff --git a/src/routes/[lang]/applications/[id]/logs/build/_BuildLog.svelte b/src/routes/applications/[id]/logs/build/_BuildLog.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/build/_BuildLog.svelte rename to src/routes/applications/[id]/logs/build/_BuildLog.svelte diff --git a/src/routes/[lang]/applications/[id]/logs/build/build.json.ts b/src/routes/applications/[id]/logs/build/build.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/build/build.json.ts rename to src/routes/applications/[id]/logs/build/build.json.ts diff --git a/src/routes/[lang]/applications/[id]/logs/build/index.json.ts b/src/routes/applications/[id]/logs/build/index.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/build/index.json.ts rename to src/routes/applications/[id]/logs/build/index.json.ts diff --git a/src/routes/[lang]/applications/[id]/logs/build/index.svelte b/src/routes/applications/[id]/logs/build/index.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/build/index.svelte rename to src/routes/applications/[id]/logs/build/index.svelte diff --git a/src/routes/[lang]/applications/[id]/logs/index.json.ts b/src/routes/applications/[id]/logs/index.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/index.json.ts rename to src/routes/applications/[id]/logs/index.json.ts diff --git a/src/routes/[lang]/applications/[id]/logs/index.svelte b/src/routes/applications/[id]/logs/index.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/logs/index.svelte rename to src/routes/applications/[id]/logs/index.svelte diff --git a/src/routes/[lang]/applications/[id]/previews/index.json.ts b/src/routes/applications/[id]/previews/index.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/previews/index.json.ts rename to src/routes/applications/[id]/previews/index.json.ts diff --git a/src/routes/[lang]/applications/[id]/previews/index.svelte b/src/routes/applications/[id]/previews/index.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/previews/index.svelte rename to src/routes/applications/[id]/previews/index.svelte diff --git a/src/routes/[lang]/applications/[id]/secrets/_Secret.svelte b/src/routes/applications/[id]/secrets/_Secret.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/secrets/_Secret.svelte rename to src/routes/applications/[id]/secrets/_Secret.svelte diff --git a/src/routes/[lang]/applications/[id]/secrets/index.json.ts b/src/routes/applications/[id]/secrets/index.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/secrets/index.json.ts rename to src/routes/applications/[id]/secrets/index.json.ts diff --git a/src/routes/[lang]/applications/[id]/secrets/index.svelte b/src/routes/applications/[id]/secrets/index.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/secrets/index.svelte rename to src/routes/applications/[id]/secrets/index.svelte diff --git a/src/routes/[lang]/applications/[id]/settings.json.ts b/src/routes/applications/[id]/settings.json.ts similarity index 85% rename from src/routes/[lang]/applications/[id]/settings.json.ts rename to src/routes/applications/[id]/settings.json.ts index 222eff807..aea78ff96 100644 --- a/src/routes/[lang]/applications/[id]/settings.json.ts +++ b/src/routes/applications/[id]/settings.json.ts @@ -2,7 +2,6 @@ import { getUserDetails } from '$lib/common'; import * as db from '$lib/database'; import { ErrorHandler } from '$lib/database'; import type { RequestHandler } from '@sveltejs/kit'; -import { _ } from 'svelte-i18n'; export const post: RequestHandler = async (event) => { const { teamId, status, body } = await getUserDetails(event); @@ -15,7 +14,8 @@ export const post: RequestHandler = async (event) => { const isDouble = await db.checkDoubleBranch(branch, projectId); if (isDouble && autodeploy) { throw { - message: $_('application.app.error_double_app_for_one_branch') + message: + 'Cannot activate automatic deployments until only one application is defined for this repository / branch.' }; } await db.setApplicationSettings({ id, debug, previews, dualCerts, autodeploy }); diff --git a/src/routes/[lang]/applications/[id]/stop.json.ts b/src/routes/applications/[id]/stop.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/stop.json.ts rename to src/routes/applications/[id]/stop.json.ts diff --git a/src/routes/[lang]/applications/[id]/storage/_Storage.svelte b/src/routes/applications/[id]/storage/_Storage.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/storage/_Storage.svelte rename to src/routes/applications/[id]/storage/_Storage.svelte diff --git a/src/routes/[lang]/applications/[id]/storage/index.json.ts b/src/routes/applications/[id]/storage/index.json.ts similarity index 100% rename from src/routes/[lang]/applications/[id]/storage/index.json.ts rename to src/routes/applications/[id]/storage/index.json.ts diff --git a/src/routes/[lang]/applications/[id]/storage/index.svelte b/src/routes/applications/[id]/storage/index.svelte similarity index 100% rename from src/routes/[lang]/applications/[id]/storage/index.svelte rename to src/routes/applications/[id]/storage/index.svelte diff --git a/src/routes/[lang]/applications/_Application.svelte b/src/routes/applications/_Application.svelte similarity index 96% rename from src/routes/[lang]/applications/_Application.svelte rename to src/routes/applications/_Application.svelte index 910c8e0c4..16d19a42f 100644 --- a/src/routes/[lang]/applications/_Application.svelte +++ b/src/routes/applications/_Application.svelte @@ -15,7 +15,6 @@ import Docker from '$lib/components/svg/applications/Docker.svelte'; import Astro from '$lib/components/svg/applications/Astro.svelte'; import Eleventy from '$lib/components/svg/applications/Eleventy.svelte'; - import { t } from '$lib/translations'; const buildPack = application?.buildPack?.toLowerCase(); @@ -60,7 +59,7 @@ {/if} {#if !application.gitSourceId || !application.destinationDockerId}
- {$t('application.configuration_missing')} + Configuration missing
{/if}
diff --git a/src/routes/[lang]/applications/index.svelte b/src/routes/applications/index.svelte similarity index 84% rename from src/routes/[lang]/applications/index.svelte rename to src/routes/applications/index.svelte index d559fd7b9..5f6056ac5 100644 --- a/src/routes/[lang]/applications/index.svelte +++ b/src/routes/applications/index.svelte @@ -4,7 +4,6 @@ import Application from './_Application.svelte'; import { post } from '$lib/api'; import { goto } from '$app/navigation'; - import { t } from '$lib/translations'; async function newApplication() { const { id } = await post('/applications/new', {}); return await goto(`/applications/${id}`, { replaceState: true }); @@ -12,7 +11,7 @@
-
{$t('index.applications')}
+
Applications
{#if $session.isAdmin}
{#if !applications || applications.length === 0}
-
{$t('application.no_applications_found')}
+
No applications found
{:else} {#each applications as application} diff --git a/src/routes/[lang]/applications/index.ts b/src/routes/applications/index.ts similarity index 100% rename from src/routes/[lang]/applications/index.ts rename to src/routes/applications/index.ts diff --git a/src/routes/[lang]/applications/new.ts b/src/routes/applications/new.ts similarity index 100% rename from src/routes/[lang]/applications/new.ts rename to src/routes/applications/new.ts diff --git a/src/routes/[lang]/common/getUniqueName.json.ts b/src/routes/common/getUniqueName.json.ts similarity index 100% rename from src/routes/[lang]/common/getUniqueName.json.ts rename to src/routes/common/getUniqueName.json.ts diff --git a/src/routes/[lang]/databases/[id]/_Databases/_CouchDb.svelte b/src/routes/databases/[id]/_Databases/_CouchDb.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/_Databases/_CouchDb.svelte rename to src/routes/databases/[id]/_Databases/_CouchDb.svelte diff --git a/src/routes/[lang]/databases/[id]/_Databases/_Databases.svelte b/src/routes/databases/[id]/_Databases/_Databases.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/_Databases/_Databases.svelte rename to src/routes/databases/[id]/_Databases/_Databases.svelte diff --git a/src/routes/[lang]/databases/[id]/_Databases/_MongoDB.svelte b/src/routes/databases/[id]/_Databases/_MongoDB.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/_Databases/_MongoDB.svelte rename to src/routes/databases/[id]/_Databases/_MongoDB.svelte diff --git a/src/routes/[lang]/databases/[id]/_Databases/_MySQL.svelte b/src/routes/databases/[id]/_Databases/_MySQL.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/_Databases/_MySQL.svelte rename to src/routes/databases/[id]/_Databases/_MySQL.svelte diff --git a/src/routes/[lang]/databases/[id]/_Databases/_PostgreSQL.svelte b/src/routes/databases/[id]/_Databases/_PostgreSQL.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/_Databases/_PostgreSQL.svelte rename to src/routes/databases/[id]/_Databases/_PostgreSQL.svelte diff --git a/src/routes/[lang]/databases/[id]/_Databases/_Redis.svelte b/src/routes/databases/[id]/_Databases/_Redis.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/_Databases/_Redis.svelte rename to src/routes/databases/[id]/_Databases/_Redis.svelte diff --git a/src/routes/[lang]/databases/[id]/__layout.svelte b/src/routes/databases/[id]/__layout.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/__layout.svelte rename to src/routes/databases/[id]/__layout.svelte diff --git a/src/routes/[lang]/databases/[id]/configuration/destination.json.ts b/src/routes/databases/[id]/configuration/destination.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/configuration/destination.json.ts rename to src/routes/databases/[id]/configuration/destination.json.ts diff --git a/src/routes/[lang]/databases/[id]/configuration/destination.svelte b/src/routes/databases/[id]/configuration/destination.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/configuration/destination.svelte rename to src/routes/databases/[id]/configuration/destination.svelte diff --git a/src/routes/[lang]/databases/[id]/configuration/type.json.ts b/src/routes/databases/[id]/configuration/type.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/configuration/type.json.ts rename to src/routes/databases/[id]/configuration/type.json.ts diff --git a/src/routes/[lang]/databases/[id]/configuration/type.svelte b/src/routes/databases/[id]/configuration/type.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/configuration/type.svelte rename to src/routes/databases/[id]/configuration/type.svelte diff --git a/src/routes/[lang]/databases/[id]/configuration/version.json.ts b/src/routes/databases/[id]/configuration/version.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/configuration/version.json.ts rename to src/routes/databases/[id]/configuration/version.json.ts diff --git a/src/routes/[lang]/databases/[id]/configuration/version.svelte b/src/routes/databases/[id]/configuration/version.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/configuration/version.svelte rename to src/routes/databases/[id]/configuration/version.svelte diff --git a/src/routes/[lang]/databases/[id]/delete.json.ts b/src/routes/databases/[id]/delete.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/delete.json.ts rename to src/routes/databases/[id]/delete.json.ts diff --git a/src/routes/[lang]/databases/[id]/index.json.ts b/src/routes/databases/[id]/index.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/index.json.ts rename to src/routes/databases/[id]/index.json.ts diff --git a/src/routes/[lang]/databases/[id]/index.svelte b/src/routes/databases/[id]/index.svelte similarity index 100% rename from src/routes/[lang]/databases/[id]/index.svelte rename to src/routes/databases/[id]/index.svelte diff --git a/src/routes/[lang]/databases/[id]/settings.json.ts b/src/routes/databases/[id]/settings.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/settings.json.ts rename to src/routes/databases/[id]/settings.json.ts diff --git a/src/routes/[lang]/databases/[id]/start.json.ts b/src/routes/databases/[id]/start.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/start.json.ts rename to src/routes/databases/[id]/start.json.ts diff --git a/src/routes/[lang]/databases/[id]/stop.json.ts b/src/routes/databases/[id]/stop.json.ts similarity index 100% rename from src/routes/[lang]/databases/[id]/stop.json.ts rename to src/routes/databases/[id]/stop.json.ts diff --git a/src/routes/[lang]/databases/index.svelte b/src/routes/databases/index.svelte similarity index 100% rename from src/routes/[lang]/databases/index.svelte rename to src/routes/databases/index.svelte diff --git a/src/routes/[lang]/databases/index.ts b/src/routes/databases/index.ts similarity index 100% rename from src/routes/[lang]/databases/index.ts rename to src/routes/databases/index.ts diff --git a/src/routes/[lang]/databases/new.ts b/src/routes/databases/new.ts similarity index 100% rename from src/routes/[lang]/databases/new.ts rename to src/routes/databases/new.ts diff --git a/src/routes/[lang]/destinations/[id]/_FoundApp.svelte b/src/routes/destinations/[id]/_FoundApp.svelte similarity index 100% rename from src/routes/[lang]/destinations/[id]/_FoundApp.svelte rename to src/routes/destinations/[id]/_FoundApp.svelte diff --git a/src/routes/[lang]/destinations/[id]/_LocalDocker.svelte b/src/routes/destinations/[id]/_LocalDocker.svelte similarity index 100% rename from src/routes/[lang]/destinations/[id]/_LocalDocker.svelte rename to src/routes/destinations/[id]/_LocalDocker.svelte diff --git a/src/routes/[lang]/destinations/[id]/_RemoteDocker.svelte b/src/routes/destinations/[id]/_RemoteDocker.svelte similarity index 100% rename from src/routes/[lang]/destinations/[id]/_RemoteDocker.svelte rename to src/routes/destinations/[id]/_RemoteDocker.svelte diff --git a/src/routes/[lang]/destinations/[id]/__layout.svelte b/src/routes/destinations/[id]/__layout.svelte similarity index 100% rename from src/routes/[lang]/destinations/[id]/__layout.svelte rename to src/routes/destinations/[id]/__layout.svelte diff --git a/src/routes/[lang]/destinations/[id]/index.json.ts b/src/routes/destinations/[id]/index.json.ts similarity index 100% rename from src/routes/[lang]/destinations/[id]/index.json.ts rename to src/routes/destinations/[id]/index.json.ts diff --git a/src/routes/[lang]/destinations/[id]/index.svelte b/src/routes/destinations/[id]/index.svelte similarity index 100% rename from src/routes/[lang]/destinations/[id]/index.svelte rename to src/routes/destinations/[id]/index.svelte diff --git a/src/routes/[lang]/destinations/[id]/restart.json.ts b/src/routes/destinations/[id]/restart.json.ts similarity index 100% rename from src/routes/[lang]/destinations/[id]/restart.json.ts rename to src/routes/destinations/[id]/restart.json.ts diff --git a/src/routes/[lang]/destinations/[id]/scan.json.ts b/src/routes/destinations/[id]/scan.json.ts similarity index 100% rename from src/routes/[lang]/destinations/[id]/scan.json.ts rename to src/routes/destinations/[id]/scan.json.ts diff --git a/src/routes/[lang]/destinations/[id]/settings.json.ts b/src/routes/destinations/[id]/settings.json.ts similarity index 100% rename from src/routes/[lang]/destinations/[id]/settings.json.ts rename to src/routes/destinations/[id]/settings.json.ts diff --git a/src/routes/[lang]/destinations/[id]/start.json.ts b/src/routes/destinations/[id]/start.json.ts similarity index 100% rename from src/routes/[lang]/destinations/[id]/start.json.ts rename to src/routes/destinations/[id]/start.json.ts diff --git a/src/routes/[lang]/destinations/[id]/stop.json.ts b/src/routes/destinations/[id]/stop.json.ts similarity index 100% rename from src/routes/[lang]/destinations/[id]/stop.json.ts rename to src/routes/destinations/[id]/stop.json.ts diff --git a/src/routes/[lang]/destinations/index.json.ts b/src/routes/destinations/index.json.ts similarity index 100% rename from src/routes/[lang]/destinations/index.json.ts rename to src/routes/destinations/index.json.ts diff --git a/src/routes/[lang]/destinations/index.svelte b/src/routes/destinations/index.svelte similarity index 100% rename from src/routes/[lang]/destinations/index.svelte rename to src/routes/destinations/index.svelte diff --git a/src/routes/index.svelte b/src/routes/index.svelte index e67e7d64d..1a5f61b4b 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,6 +1,5 @@
-
{$t('dashboard')}
+
Dashboard
@@ -45,7 +44,7 @@ class="flex cursor-pointer flex-col rounded p-6 text-center text-green-500 no-underline transition duration-150 hover:bg-green-500 hover:text-white" >
- {$t('index.applications')} + Applications
{applicationsCount} @@ -57,7 +56,7 @@ class="flex cursor-pointer flex-col rounded p-6 text-center text-sky-500 no-underline transition duration-150 hover:bg-sky-500 hover:text-white" >
- {$t('index.destinations')} + Destinations
{destinationsCount} @@ -69,7 +68,7 @@ class="flex cursor-pointer flex-col rounded p-6 text-center text-orange-500 no-underline transition duration-150 hover:bg-orange-500 hover:text-white" >
- {$t('index.git_sources')} + Git Sources
{sourcesCount} @@ -80,9 +79,7 @@ sveltekit:prefetch class="flex cursor-pointer flex-col rounded p-6 text-center text-purple-500 no-underline transition duration-150 hover:bg-purple-500 hover:text-white" > -
- {$t('index.databases')} -
+
Databases
{databasesCount}
-
- {$t('index.services')} -
+
Services
{servicesCount}
@@ -101,9 +96,7 @@ sveltekit:prefetch class="flex cursor-pointer flex-col rounded p-6 text-center text-cyan-500 no-underline transition duration-150 hover:bg-cyan-500 hover:text-white" > -
- {$t('index.teams')} -
+
Teams
{teamsCount}
diff --git a/src/routes/[lang]/login/index.json.ts b/src/routes/login/index.json.ts similarity index 100% rename from src/routes/[lang]/login/index.json.ts rename to src/routes/login/index.json.ts diff --git a/src/routes/[lang]/login/index.svelte b/src/routes/login/index.svelte similarity index 81% rename from src/routes/[lang]/login/index.svelte rename to src/routes/login/index.svelte index dccbc90c9..b321bc086 100644 --- a/src/routes/[lang]/login/index.svelte +++ b/src/routes/login/index.svelte @@ -5,8 +5,6 @@ import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; import { onMount } from 'svelte'; - import { t } from '$lib/translations'; - let loading = false; let emailEl; let email, password; @@ -41,7 +39,7 @@
{#if $session.userId} -
{$t('login.already_logged_in')}
+
Already logged in...
{:else}
@@ -50,7 +48,7 @@ @@ -71,19 +69,16 @@ class="hover:opacity-90 text-white" class:bg-transparent={loading} class:text-stone-600={loading} - class:bg-coollabs={!loading} - >{loading ? $t('login.authenticating') : $t('login.login')}{loading ? 'Authenticating...' : 'Login'} Register goto('/reset')}>Reset password
diff --git a/src/routes/[lang]/logout/index.json.ts b/src/routes/logout/index.json.ts similarity index 100% rename from src/routes/[lang]/logout/index.json.ts rename to src/routes/logout/index.json.ts diff --git a/src/routes/[lang]/new/destination/_LocalDocker.svelte b/src/routes/new/destination/_LocalDocker.svelte similarity index 100% rename from src/routes/[lang]/new/destination/_LocalDocker.svelte rename to src/routes/new/destination/_LocalDocker.svelte diff --git a/src/routes/[lang]/new/destination/_RemoteDocker.svelte b/src/routes/new/destination/_RemoteDocker.svelte similarity index 100% rename from src/routes/[lang]/new/destination/_RemoteDocker.svelte rename to src/routes/new/destination/_RemoteDocker.svelte diff --git a/src/routes/[lang]/new/destination/check.json.ts b/src/routes/new/destination/check.json.ts similarity index 100% rename from src/routes/[lang]/new/destination/check.json.ts rename to src/routes/new/destination/check.json.ts diff --git a/src/routes/[lang]/new/destination/docker.json.ts b/src/routes/new/destination/docker.json.ts similarity index 100% rename from src/routes/[lang]/new/destination/docker.json.ts rename to src/routes/new/destination/docker.json.ts diff --git a/src/routes/[lang]/new/destination/index.svelte b/src/routes/new/destination/index.svelte similarity index 100% rename from src/routes/[lang]/new/destination/index.svelte rename to src/routes/new/destination/index.svelte diff --git a/src/routes/[lang]/new/source/_Github.svelte b/src/routes/new/source/_Github.svelte similarity index 100% rename from src/routes/[lang]/new/source/_Github.svelte rename to src/routes/new/source/_Github.svelte diff --git a/src/routes/[lang]/new/source/_Gitlab.svelte b/src/routes/new/source/_Gitlab.svelte similarity index 100% rename from src/routes/[lang]/new/source/_Gitlab.svelte rename to src/routes/new/source/_Gitlab.svelte diff --git a/src/routes/[lang]/new/source/index.json.ts b/src/routes/new/source/index.json.ts similarity index 100% rename from src/routes/[lang]/new/source/index.json.ts rename to src/routes/new/source/index.json.ts diff --git a/src/routes/[lang]/new/source/index.svelte b/src/routes/new/source/index.svelte similarity index 100% rename from src/routes/[lang]/new/source/index.svelte rename to src/routes/new/source/index.svelte diff --git a/src/routes/[lang]/new/team/index.json.ts b/src/routes/new/team/index.json.ts similarity index 100% rename from src/routes/[lang]/new/team/index.json.ts rename to src/routes/new/team/index.json.ts diff --git a/src/routes/[lang]/new/team/index.svelte b/src/routes/new/team/index.svelte similarity index 100% rename from src/routes/[lang]/new/team/index.svelte rename to src/routes/new/team/index.svelte diff --git a/src/routes/[lang]/register/index.svelte b/src/routes/register/index.svelte similarity index 84% rename from src/routes/[lang]/register/index.svelte rename to src/routes/register/index.svelte index ee4e0a61e..35501fce2 100644 --- a/src/routes/[lang]/register/index.svelte +++ b/src/routes/register/index.svelte @@ -7,7 +7,6 @@ import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; import { onMount } from 'svelte'; - import { t } from '$lib/translations'; let loading = false; let emailEl; @@ -21,7 +20,7 @@ }); async function handleSubmit() { if (password !== passwordCheck) { - return errorNotification($t('register.passwords_do_not_match')); + return errorNotification('Passwords do not match.'); } loading = true; try { @@ -58,7 +57,7 @@
{#if $session.userId} -
{$t('login.already_logged_in')}
+
Already logged in...
{:else}
@@ -67,7 +66,7 @@
Register
{#if userCount === 0}
- {$t('register.register_first_user')} + You are registering the first user. It will be the administrator of your Coolify instance.
{/if} {/if} diff --git a/src/routes/[lang]/register/index.ts b/src/routes/register/index.ts similarity index 100% rename from src/routes/[lang]/register/index.ts rename to src/routes/register/index.ts diff --git a/src/routes/[lang]/reset/index.json.ts b/src/routes/reset/index.json.ts similarity index 91% rename from src/routes/[lang]/reset/index.json.ts rename to src/routes/reset/index.json.ts index 21e403509..a75ea4766 100644 --- a/src/routes/[lang]/reset/index.json.ts +++ b/src/routes/reset/index.json.ts @@ -16,7 +16,7 @@ export const post: RequestHandler = async (event) => { return { status: 500, body: { - error: 'reset_password.invalid_secret_key' + error: 'Invalid secret key.' } }; } diff --git a/src/routes/[lang]/reset/index.svelte b/src/routes/reset/index.svelte similarity index 100% rename from src/routes/[lang]/reset/index.svelte rename to src/routes/reset/index.svelte diff --git a/src/routes/[lang]/reset/password.json.ts b/src/routes/reset/password.json.ts similarity index 93% rename from src/routes/[lang]/reset/password.json.ts rename to src/routes/reset/password.json.ts index 9856349b3..28e9d56e3 100644 --- a/src/routes/[lang]/reset/password.json.ts +++ b/src/routes/reset/password.json.ts @@ -8,7 +8,7 @@ export const post: RequestHandler = async (event) => { return { status: 500, body: { - error: 'reset_password.invalid_secret_key' + error: 'Invalid secret key.' } }; } diff --git a/src/routes/[lang]/services/[id]/_Services/_Ghost.svelte b/src/routes/services/[id]/_Services/_Ghost.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/_Services/_Ghost.svelte rename to src/routes/services/[id]/_Services/_Ghost.svelte diff --git a/src/routes/[lang]/services/[id]/_Services/_MinIO.svelte b/src/routes/services/[id]/_Services/_MinIO.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/_Services/_MinIO.svelte rename to src/routes/services/[id]/_Services/_MinIO.svelte diff --git a/src/routes/[lang]/services/[id]/_Services/_PlausibleAnalytics.svelte b/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/_Services/_PlausibleAnalytics.svelte rename to src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte diff --git a/src/routes/[lang]/services/[id]/_Services/_Services.svelte b/src/routes/services/[id]/_Services/_Services.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/_Services/_Services.svelte rename to src/routes/services/[id]/_Services/_Services.svelte diff --git a/src/routes/[lang]/services/[id]/_Services/_VSCodeServer.svelte b/src/routes/services/[id]/_Services/_VSCodeServer.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/_Services/_VSCodeServer.svelte rename to src/routes/services/[id]/_Services/_VSCodeServer.svelte diff --git a/src/routes/[lang]/services/[id]/_Services/_Wordpress.svelte b/src/routes/services/[id]/_Services/_Wordpress.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/_Services/_Wordpress.svelte rename to src/routes/services/[id]/_Services/_Wordpress.svelte diff --git a/src/routes/[lang]/services/[id]/__layout.svelte b/src/routes/services/[id]/__layout.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/__layout.svelte rename to src/routes/services/[id]/__layout.svelte diff --git a/src/routes/[lang]/services/[id]/check.json.ts b/src/routes/services/[id]/check.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/check.json.ts rename to src/routes/services/[id]/check.json.ts diff --git a/src/routes/[lang]/services/[id]/configuration/destination.json.ts b/src/routes/services/[id]/configuration/destination.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/configuration/destination.json.ts rename to src/routes/services/[id]/configuration/destination.json.ts diff --git a/src/routes/[lang]/services/[id]/configuration/destination.svelte b/src/routes/services/[id]/configuration/destination.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/configuration/destination.svelte rename to src/routes/services/[id]/configuration/destination.svelte diff --git a/src/routes/[lang]/services/[id]/configuration/type.json.ts b/src/routes/services/[id]/configuration/type.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/configuration/type.json.ts rename to src/routes/services/[id]/configuration/type.json.ts diff --git a/src/routes/[lang]/services/[id]/configuration/type.svelte b/src/routes/services/[id]/configuration/type.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/configuration/type.svelte rename to src/routes/services/[id]/configuration/type.svelte diff --git a/src/routes/[lang]/services/[id]/configuration/version.json.ts b/src/routes/services/[id]/configuration/version.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/configuration/version.json.ts rename to src/routes/services/[id]/configuration/version.json.ts diff --git a/src/routes/[lang]/services/[id]/configuration/version.svelte b/src/routes/services/[id]/configuration/version.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/configuration/version.svelte rename to src/routes/services/[id]/configuration/version.svelte diff --git a/src/routes/[lang]/services/[id]/delete.json.ts b/src/routes/services/[id]/delete.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/delete.json.ts rename to src/routes/services/[id]/delete.json.ts diff --git a/src/routes/[lang]/services/[id]/ghost/index.json.ts b/src/routes/services/[id]/ghost/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/ghost/index.json.ts rename to src/routes/services/[id]/ghost/index.json.ts diff --git a/src/routes/[lang]/services/[id]/ghost/start.json.ts b/src/routes/services/[id]/ghost/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/ghost/start.json.ts rename to src/routes/services/[id]/ghost/start.json.ts diff --git a/src/routes/[lang]/services/[id]/ghost/stop.json.ts b/src/routes/services/[id]/ghost/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/ghost/stop.json.ts rename to src/routes/services/[id]/ghost/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/index.json.ts b/src/routes/services/[id]/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/index.json.ts rename to src/routes/services/[id]/index.json.ts diff --git a/src/routes/[lang]/services/[id]/index.svelte b/src/routes/services/[id]/index.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/index.svelte rename to src/routes/services/[id]/index.svelte diff --git a/src/routes/[lang]/services/[id]/languagetool/index.json.ts b/src/routes/services/[id]/languagetool/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/languagetool/index.json.ts rename to src/routes/services/[id]/languagetool/index.json.ts diff --git a/src/routes/[lang]/services/[id]/languagetool/start.json.ts b/src/routes/services/[id]/languagetool/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/languagetool/start.json.ts rename to src/routes/services/[id]/languagetool/start.json.ts diff --git a/src/routes/[lang]/services/[id]/languagetool/stop.json.ts b/src/routes/services/[id]/languagetool/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/languagetool/stop.json.ts rename to src/routes/services/[id]/languagetool/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/minio/index.json.ts b/src/routes/services/[id]/minio/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/minio/index.json.ts rename to src/routes/services/[id]/minio/index.json.ts diff --git a/src/routes/[lang]/services/[id]/minio/start.json.ts b/src/routes/services/[id]/minio/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/minio/start.json.ts rename to src/routes/services/[id]/minio/start.json.ts diff --git a/src/routes/[lang]/services/[id]/minio/stop.json.ts b/src/routes/services/[id]/minio/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/minio/stop.json.ts rename to src/routes/services/[id]/minio/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/n8n/index.json.ts b/src/routes/services/[id]/n8n/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/n8n/index.json.ts rename to src/routes/services/[id]/n8n/index.json.ts diff --git a/src/routes/[lang]/services/[id]/n8n/start.json.ts b/src/routes/services/[id]/n8n/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/n8n/start.json.ts rename to src/routes/services/[id]/n8n/start.json.ts diff --git a/src/routes/[lang]/services/[id]/n8n/stop.json.ts b/src/routes/services/[id]/n8n/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/n8n/stop.json.ts rename to src/routes/services/[id]/n8n/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/nocodb/index.json.ts b/src/routes/services/[id]/nocodb/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/nocodb/index.json.ts rename to src/routes/services/[id]/nocodb/index.json.ts diff --git a/src/routes/[lang]/services/[id]/nocodb/start.json.ts b/src/routes/services/[id]/nocodb/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/nocodb/start.json.ts rename to src/routes/services/[id]/nocodb/start.json.ts diff --git a/src/routes/[lang]/services/[id]/nocodb/stop.json.ts b/src/routes/services/[id]/nocodb/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/nocodb/stop.json.ts rename to src/routes/services/[id]/nocodb/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/plausibleanalytics/activate.json.ts b/src/routes/services/[id]/plausibleanalytics/activate.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/plausibleanalytics/activate.json.ts rename to src/routes/services/[id]/plausibleanalytics/activate.json.ts diff --git a/src/routes/[lang]/services/[id]/plausibleanalytics/index.json.ts b/src/routes/services/[id]/plausibleanalytics/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/plausibleanalytics/index.json.ts rename to src/routes/services/[id]/plausibleanalytics/index.json.ts diff --git a/src/routes/[lang]/services/[id]/plausibleanalytics/start.json.ts b/src/routes/services/[id]/plausibleanalytics/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/plausibleanalytics/start.json.ts rename to src/routes/services/[id]/plausibleanalytics/start.json.ts diff --git a/src/routes/[lang]/services/[id]/plausibleanalytics/stop.json.ts b/src/routes/services/[id]/plausibleanalytics/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/plausibleanalytics/stop.json.ts rename to src/routes/services/[id]/plausibleanalytics/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/secrets/_Secret.svelte b/src/routes/services/[id]/secrets/_Secret.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/secrets/_Secret.svelte rename to src/routes/services/[id]/secrets/_Secret.svelte diff --git a/src/routes/[lang]/services/[id]/secrets/index.json.ts b/src/routes/services/[id]/secrets/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/secrets/index.json.ts rename to src/routes/services/[id]/secrets/index.json.ts diff --git a/src/routes/[lang]/services/[id]/secrets/index.svelte b/src/routes/services/[id]/secrets/index.svelte similarity index 100% rename from src/routes/[lang]/services/[id]/secrets/index.svelte rename to src/routes/services/[id]/secrets/index.svelte diff --git a/src/routes/[lang]/services/[id]/settings.json.ts b/src/routes/services/[id]/settings.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/settings.json.ts rename to src/routes/services/[id]/settings.json.ts diff --git a/src/routes/[lang]/services/[id]/uptimekuma/index.json.ts b/src/routes/services/[id]/uptimekuma/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/uptimekuma/index.json.ts rename to src/routes/services/[id]/uptimekuma/index.json.ts diff --git a/src/routes/[lang]/services/[id]/uptimekuma/start.json.ts b/src/routes/services/[id]/uptimekuma/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/uptimekuma/start.json.ts rename to src/routes/services/[id]/uptimekuma/start.json.ts diff --git a/src/routes/[lang]/services/[id]/uptimekuma/stop.json.ts b/src/routes/services/[id]/uptimekuma/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/uptimekuma/stop.json.ts rename to src/routes/services/[id]/uptimekuma/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/vaultwarden/index.json.ts b/src/routes/services/[id]/vaultwarden/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/vaultwarden/index.json.ts rename to src/routes/services/[id]/vaultwarden/index.json.ts diff --git a/src/routes/[lang]/services/[id]/vaultwarden/start.json.ts b/src/routes/services/[id]/vaultwarden/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/vaultwarden/start.json.ts rename to src/routes/services/[id]/vaultwarden/start.json.ts diff --git a/src/routes/[lang]/services/[id]/vaultwarden/stop.json.ts b/src/routes/services/[id]/vaultwarden/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/vaultwarden/stop.json.ts rename to src/routes/services/[id]/vaultwarden/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/vscodeserver/index.json.ts b/src/routes/services/[id]/vscodeserver/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/vscodeserver/index.json.ts rename to src/routes/services/[id]/vscodeserver/index.json.ts diff --git a/src/routes/[lang]/services/[id]/vscodeserver/start.json.ts b/src/routes/services/[id]/vscodeserver/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/vscodeserver/start.json.ts rename to src/routes/services/[id]/vscodeserver/start.json.ts diff --git a/src/routes/[lang]/services/[id]/vscodeserver/stop.json.ts b/src/routes/services/[id]/vscodeserver/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/vscodeserver/stop.json.ts rename to src/routes/services/[id]/vscodeserver/stop.json.ts diff --git a/src/routes/[lang]/services/[id]/wordpress/index.json.ts b/src/routes/services/[id]/wordpress/index.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/wordpress/index.json.ts rename to src/routes/services/[id]/wordpress/index.json.ts diff --git a/src/routes/[lang]/services/[id]/wordpress/start.json.ts b/src/routes/services/[id]/wordpress/start.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/wordpress/start.json.ts rename to src/routes/services/[id]/wordpress/start.json.ts diff --git a/src/routes/[lang]/services/[id]/wordpress/stop.json.ts b/src/routes/services/[id]/wordpress/stop.json.ts similarity index 100% rename from src/routes/[lang]/services/[id]/wordpress/stop.json.ts rename to src/routes/services/[id]/wordpress/stop.json.ts diff --git a/src/routes/[lang]/services/index.svelte b/src/routes/services/index.svelte similarity index 100% rename from src/routes/[lang]/services/index.svelte rename to src/routes/services/index.svelte diff --git a/src/routes/[lang]/services/index.ts b/src/routes/services/index.ts similarity index 100% rename from src/routes/[lang]/services/index.ts rename to src/routes/services/index.ts diff --git a/src/routes/[lang]/services/new.ts b/src/routes/services/new.ts similarity index 100% rename from src/routes/[lang]/services/new.ts rename to src/routes/services/new.ts diff --git a/src/routes/[lang]/settings/check.json.ts b/src/routes/settings/check.json.ts similarity index 100% rename from src/routes/[lang]/settings/check.json.ts rename to src/routes/settings/check.json.ts diff --git a/src/routes/[lang]/settings/index.json.ts b/src/routes/settings/index.json.ts similarity index 100% rename from src/routes/[lang]/settings/index.json.ts rename to src/routes/settings/index.json.ts diff --git a/src/routes/[lang]/settings/index.svelte b/src/routes/settings/index.svelte similarity index 100% rename from src/routes/[lang]/settings/index.svelte rename to src/routes/settings/index.svelte diff --git a/src/routes/[lang]/sources/[id]/_Github.svelte b/src/routes/sources/[id]/_Github.svelte similarity index 81% rename from src/routes/[lang]/sources/[id]/_Github.svelte rename to src/routes/sources/[id]/_Github.svelte index e3243fc76..102971353 100644 --- a/src/routes/[lang]/sources/[id]/_Github.svelte +++ b/src/routes/sources/[id]/_Github.svelte @@ -3,7 +3,6 @@ import { page, session } from '$app/stores'; import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; - import { t } from '$lib/translations'; const { id } = $page.params; let loading = false; @@ -44,7 +43,7 @@ const top = screen.height / 2 - 618 / 2; const newWindow = open( `/sources/${id}/newGithubApp`, - $t('sources.source.new_github_app'), + 'New Github App', 'resizable=1, scrollbars=1, fullscreen=0, height=618, width=1020,top=' + top + ', left=' + @@ -61,32 +60,30 @@ {#if !source.githubAppId} - + {:else if source.githubApp?.installationId}
-
{$t('general')}
+
General
{#if $session.isAdmin} {loading ? 'Saving...' : 'Save'} Change GitHub App Settings {/if}
- +
{:else} - + {/if} diff --git a/src/routes/[lang]/sources/[id]/_Gitlab.svelte b/src/routes/sources/[id]/_Gitlab.svelte similarity index 100% rename from src/routes/[lang]/sources/[id]/_Gitlab.svelte rename to src/routes/sources/[id]/_Gitlab.svelte diff --git a/src/routes/[lang]/sources/[id]/__layout.svelte b/src/routes/sources/[id]/__layout.svelte similarity index 82% rename from src/routes/[lang]/sources/[id]/__layout.svelte rename to src/routes/sources/[id]/__layout.svelte index accaa7c06..0f5139558 100644 --- a/src/routes/[lang]/sources/[id]/__layout.svelte +++ b/src/routes/sources/[id]/__layout.svelte @@ -34,11 +34,10 @@ import { page, session } from '$app/stores'; import { errorNotification } from '$lib/form'; import DeleteIcon from '$lib/components/DeleteIcon.svelte'; - import { t } from '$lib/translations'; const { id } = $page.params; async function deleteSource(name) { - const sure = confirm(`${$t('sources.source.sure_to_delete')} '${name}'?`); + const sure = confirm(`Are you sure you would like to delete '${name}'?`); if (sure) { const response = await fetch(`/sources/${id}.json`, { method: 'delete' @@ -56,14 +55,14 @@ diff --git a/src/routes/[lang]/sources/[id]/check.json.ts b/src/routes/sources/[id]/check.json.ts similarity index 100% rename from src/routes/[lang]/sources/[id]/check.json.ts rename to src/routes/sources/[id]/check.json.ts diff --git a/src/routes/[lang]/sources/[id]/gitlab.json.ts b/src/routes/sources/[id]/gitlab.json.ts similarity index 100% rename from src/routes/[lang]/sources/[id]/gitlab.json.ts rename to src/routes/sources/[id]/gitlab.json.ts diff --git a/src/routes/[lang]/sources/[id]/index.json.ts b/src/routes/sources/[id]/index.json.ts similarity index 100% rename from src/routes/[lang]/sources/[id]/index.json.ts rename to src/routes/sources/[id]/index.json.ts diff --git a/src/routes/[lang]/sources/[id]/index.svelte b/src/routes/sources/[id]/index.svelte similarity index 100% rename from src/routes/[lang]/sources/[id]/index.svelte rename to src/routes/sources/[id]/index.svelte diff --git a/src/routes/[lang]/sources/[id]/newGithubApp.svelte b/src/routes/sources/[id]/newGithubApp.svelte similarity index 100% rename from src/routes/[lang]/sources/[id]/newGithubApp.svelte rename to src/routes/sources/[id]/newGithubApp.svelte diff --git a/src/routes/[lang]/sources/index.json.ts b/src/routes/sources/index.json.ts similarity index 100% rename from src/routes/[lang]/sources/index.json.ts rename to src/routes/sources/index.json.ts diff --git a/src/routes/[lang]/sources/index.svelte b/src/routes/sources/index.svelte similarity index 88% rename from src/routes/[lang]/sources/index.svelte rename to src/routes/sources/index.svelte index 4823c1e64..bd9039514 100644 --- a/src/routes/[lang]/sources/index.svelte +++ b/src/routes/sources/index.svelte @@ -22,11 +22,10 @@
-
{$t('index.git_sources')}
+
Git Sources
{#if $session.isAdmin} {#if !sources || sources.length === 0}
-
{$t('sources.no_git_sources_found')}
+
No git sources found
{:else}
@@ -63,7 +62,7 @@
{source.name}
{#if (source.type === 'gitlab' && !source.gitlabAppId) || (source.type === 'github' && !source.githubAppId && !source.githubApp?.installationId)}
- {$t('application.configuration_missing')} + Configuration missing
{:else}
{source.htmlUrl}
diff --git a/src/routes/[lang]/teams/[id]/__layout.svelte b/src/routes/teams/[id]/__layout.svelte similarity index 100% rename from src/routes/[lang]/teams/[id]/__layout.svelte rename to src/routes/teams/[id]/__layout.svelte diff --git a/src/routes/[lang]/teams/[id]/index.json.ts b/src/routes/teams/[id]/index.json.ts similarity index 100% rename from src/routes/[lang]/teams/[id]/index.json.ts rename to src/routes/teams/[id]/index.json.ts diff --git a/src/routes/[lang]/teams/[id]/index.svelte b/src/routes/teams/[id]/index.svelte similarity index 100% rename from src/routes/[lang]/teams/[id]/index.svelte rename to src/routes/teams/[id]/index.svelte diff --git a/src/routes/[lang]/teams/[id]/invitation/accept.json.ts b/src/routes/teams/[id]/invitation/accept.json.ts similarity index 100% rename from src/routes/[lang]/teams/[id]/invitation/accept.json.ts rename to src/routes/teams/[id]/invitation/accept.json.ts diff --git a/src/routes/[lang]/teams/[id]/invitation/invite.json.ts b/src/routes/teams/[id]/invitation/invite.json.ts similarity index 100% rename from src/routes/[lang]/teams/[id]/invitation/invite.json.ts rename to src/routes/teams/[id]/invitation/invite.json.ts diff --git a/src/routes/[lang]/teams/[id]/invitation/revoke.json.ts b/src/routes/teams/[id]/invitation/revoke.json.ts similarity index 100% rename from src/routes/[lang]/teams/[id]/invitation/revoke.json.ts rename to src/routes/teams/[id]/invitation/revoke.json.ts diff --git a/src/routes/[lang]/teams/[id]/permission/change.json.ts b/src/routes/teams/[id]/permission/change.json.ts similarity index 100% rename from src/routes/[lang]/teams/[id]/permission/change.json.ts rename to src/routes/teams/[id]/permission/change.json.ts diff --git a/src/routes/[lang]/teams/[id]/remove/user.json.ts b/src/routes/teams/[id]/remove/user.json.ts similarity index 100% rename from src/routes/[lang]/teams/[id]/remove/user.json.ts rename to src/routes/teams/[id]/remove/user.json.ts diff --git a/src/routes/[lang]/teams/index.json.ts b/src/routes/teams/index.json.ts similarity index 100% rename from src/routes/[lang]/teams/index.json.ts rename to src/routes/teams/index.json.ts diff --git a/src/routes/[lang]/teams/index.svelte b/src/routes/teams/index.svelte similarity index 100% rename from src/routes/[lang]/teams/index.svelte rename to src/routes/teams/index.svelte diff --git a/static/locales/en.json b/static/locales/en.json index 897d6158c..aa64ad4e5 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -8,59 +8,6 @@ }, "error": { "you_can_find_your_way_back": "You can find your way back", - "here": "here", - "oops_your_lost": "Ooops you are lost! But don't be afraid!", - "generic_message": "Ooops, something is not okay, are you okay?" - }, - "index": { - "applications": "Applications", - "destinations": "Destinations", - "git_sources": "Git Sources", - "databases": "Databases", - "services": "Services", - "teams": "Teams" - }, - "dashboard": "Dashboard", - "application": { - "configuration_missing": "Configuration missing", - "no_applications_found": "No applications found", - "app": { - "error_double_app_for_one_branch": "Cannot activate automatic deployments until only one application is defined for this repository / branch." - } - }, - "sources": { - "no_git_sources_found": "No git sources found", - "source": { - "delete_git_source": "Delete Git Source", - "permission_denied_delete_git_source": "You do not have permission to delete a Git Source", - "sure_to_delete": "Are you sure you would like to delete", - "create_new_github_app": "Create new GitHub App", - "install_repositories": "Install Repositories", - "change_app_settings": "Change {name} App Settings", - "new_github_app": "New Github App" - } - }, - "general": "General", - "saving": "Saving...", - "save": "Save", - "forms": { - "name": "Name", - "email": "Email", - "password": "Password", - "password_again": "Password again" - }, - "login": { - "already_logged_in": "Already logged in...", - "authenticating": "Authenticating...", - "login": "Login" - }, - "register": { - "register": "Register", - "passwords_do_not_match": "Passwords do not match.", - "register_first_user": "You are registering the first user. It will be the administrator of your Coolify instance." - }, - "reset_password": { - "reset_password": "Reset password", - "invalid_secret_key": "Invalid secret key." + "here": "here" } } diff --git a/static/locales/fr.json b/static/locales/fr.json deleted file mode 100644 index 2cce1d2fb..000000000 --- a/static/locales/fr.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "layout": { - "update_done": "Mise à jour réalisée.", - "wait_new_version_startup": "En attente du démarrage de la nouvelle version...", - "new_version": "Nouvel version accessible. Rafraichissement de la page...", - "switch_to_a_different_team": "Changer d'équipe...", - "update_available": "Mise à jour disponible" - }, - "error": { - "you_can_find_your_way_back": "Vous ne trouvez pas votre chemin ?", - "here": "Ici", - "oops_your_lost": "Oups vous êtes perdu ! \nMais n'ayez pas peur !", - "generic_message": "Oups, quelque chose ne va pas, ça va ?" - }, - "dashboard": "Tableau de bord", - "index": { - "applications": "Applications", - "databases": "Bases de données", - "destinations": "Destinations", - "git_sources": "Sources Git", - "services": "Services", - "teams": "Équipes" - }, - "application": { - "no_applications_found": "Aucune application trouvée", - "app": { - "error_double_app_for_one_branch": "Impossible d'activer les déploiements automatiques tant qu'une seule application n'est pas définie pour ce référentiel/branche." - }, - "configuration_missing": "Configuration manquante" - }, - "forms": { - "email": "E-mail", - "name": "Nom", - "password": "Mot de passe", - "password_again": "Retaper le mot de passe" - }, - "general": "Général", - "login": { - "already_logged_in": "Déjà connecté...", - "authenticating": "Authentification...", - "login": "Connexion" - }, - "register": { - "passwords_do_not_match": "Les mots de passe ne correspondent pas.", - "register": "S'inscrire", - "register_first_user": "Vous enregistrez le premier utilisateur. \nCe sera l'administrateur de votre instance Coolify." - }, - "reset_password": { - "invalid_secret_key": "Clé secrète invalide.", - "reset_password": "Réinitialiser le mot de passe" - }, - "save": "Enregistrer", - "saving": "Enregistrement...", - "sources": { - "no_git_sources_found": "Aucune source git trouvée", - "source": { - "change_app_settings": "Modifier les paramètres de l'application {name}", - "create_new_github_app": "Créer une nouvelle application GitHub", - "delete_git_source": "Supprimer la source Git", - "install_repositories": "Installer les référentiels", - "new_github_app": "Nouvelle application Github", - "permission_denied_delete_git_source": "Vous n'êtes pas autorisé à supprimer une source Git", - "sure_to_delete": "Êtes-vous sûr de vouloir supprimer" - } - } -} From a3241516cb1e15197080fcc20eb2ded0f061bcad Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 20:25:24 +0200 Subject: [PATCH 06/23] Change the way to load i18n (go throw cookie) --- .vscode/settings.json | 5 +- package.json | 2 +- pnpm-lock.yaml | 124 +++++++++++-------------------------- src/hooks.ts | 46 ++++++++++++-- src/lib/lang.json | 4 ++ src/lib/translations.ts | 28 +++++++++ src/routes/__error.svelte | 7 ++- src/routes/__layout.svelte | 32 +++++----- src/routes/index.svelte | 4 +- static/locales/en.json | 3 + static/locales/fr.json | 5 ++ 11 files changed, 142 insertions(+), 118 deletions(-) create mode 100644 src/lib/lang.json create mode 100644 src/lib/translations.ts create mode 100644 static/locales/fr.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 1cc7be6e1..ab2903b56 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,8 @@ { - "i18n-ally.localesPaths": ["locales"], + "i18n-ally.localesPaths": ["static/locales"], "i18n-ally.keystyle": "nested", "i18n-ally.extract.ignoredByFiles": { "src\\routes\\__layout.svelte": ["Coolify", "coolLabs logo"] - } + }, + "i18n-ally.sourceLanguage": "fr" } diff --git a/package.json b/package.json index 7a0a8e4bf..2ac79d547 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "prisma": "3.11.1", "svelte": "3.46.4", "svelte-check": "2.4.6", - "svelte-i18n": "^3.3.13", "svelte-preprocess": "4.10.4", "svelte-select": "^4.4.7", + "sveltekit-i18n": "^2.1.2", "tailwindcss": "3.0.23", "ts-node": "10.7.0", "tslib": "2.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7594b347..0a432406d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,10 +46,10 @@ specifiers: prisma: 3.11.1 svelte: 3.46.4 svelte-check: 2.4.6 - svelte-i18n: ^3.3.13 svelte-kit-cookie-session: 2.1.2 svelte-preprocess: 4.10.4 svelte-select: ^4.4.7 + sveltekit-i18n: ^2.1.2 tailwindcss: 3.0.23 tailwindcss-scrollbar: ^0.1.0 ts-node: 10.7.0 @@ -108,9 +108,9 @@ devDependencies: prisma: 3.11.1 svelte: 3.46.4 svelte-check: 2.4.6_postcss@8.4.12+svelte@3.46.4 - svelte-i18n: 3.3.13_svelte@3.46.4 svelte-preprocess: 4.10.4_296873641a0ad9f42fe92172d27bcedd svelte-select: 4.4.7 + sveltekit-i18n: 2.1.2_svelte@3.46.4 tailwindcss: 3.0.23_b89136460714832cdda11d1e9d57d1ff ts-node: 10.7.0_ee885bc7281b682b6adbed6ae09ee090 tslib: 2.3.1 @@ -184,55 +184,6 @@ packages: - supports-color dev: true - /@formatjs/ecma402-abstract/1.11.4: - resolution: - { - integrity: sha512-EBikYFp2JCdIfGEb5G9dyCkTGDmC57KSHhRQOC3aYxoPWVZvfWCDjZwkGYHN7Lis/fmuWl906bnNTJifDQ3sXw== - } - dependencies: - '@formatjs/intl-localematcher': 0.2.25 - tslib: 2.3.1 - dev: true - - /@formatjs/fast-memoize/1.2.1: - resolution: - { - integrity: sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg== - } - dependencies: - tslib: 2.3.1 - dev: true - - /@formatjs/icu-messageformat-parser/2.0.19: - resolution: - { - integrity: sha512-8HsLm9YLyVVIDMyBJb7wmve2wGd461cUwJ470eUog5YH5ZsF4p5lgvaJ+oGKxz1mrSMNNdDHU9v/NDsS+z+ilg== - } - dependencies: - '@formatjs/ecma402-abstract': 1.11.4 - '@formatjs/icu-skeleton-parser': 1.3.6 - tslib: 2.3.1 - dev: true - - /@formatjs/icu-skeleton-parser/1.3.6: - resolution: - { - integrity: sha512-I96mOxvml/YLrwU2Txnd4klA7V8fRhb6JG/4hm3VMNmeJo1F03IpV2L3wWt7EweqNLES59SZ4d6hVOPCSf80Bg== - } - dependencies: - '@formatjs/ecma402-abstract': 1.11.4 - tslib: 2.3.1 - dev: true - - /@formatjs/intl-localematcher/0.2.25: - resolution: - { - integrity: sha512-YmLcX70BxoSopLFdLr1Ds99NdlTI2oWoLbaUW2M406lxOIPzE1KQhRz2fPUkq34xVZQaihCoU29h0KK7An3bhA== - } - dependencies: - tslib: 2.3.1 - dev: true - /@humanwhocodes/config-array/0.5.0: resolution: { @@ -495,6 +446,26 @@ packages: - supports-color dev: true + /@sveltekit-i18n/base/1.1.1_svelte@3.46.4: + resolution: + { + integrity: sha512-J/sMU0OwS3dCLOuilHMBqu8vZHuuXiNV9vFJx8Nb4/b5BlR/KCZ4bCXI8wZR02GHeCOYKZxWus07CM1scxa/jw== + } + peerDependencies: + svelte: ^3.x + dependencies: + svelte: 3.46.4 + optionalDependencies: + '@sveltekit-i18n/parser-default': 1.0.3 + dev: true + + /@sveltekit-i18n/parser-default/1.0.3: + resolution: + { + integrity: sha512-HheveklTjp3hxpYQhoHfyA6B4bQaUeSV5MQf2usIv/58UF2jY/YqhCAWj9bDBjufbuZc5pSz4BXvdX3WVT+viA== + } + dev: true + /@szmarczak/http-timer/5.0.1: resolution: { @@ -2254,14 +2225,6 @@ packages: } dev: true - /deepmerge/4.2.2: - resolution: - { - integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - } - engines: { node: '>=0.10.0' } - dev: true - /defer-to-connect/2.0.1: resolution: { @@ -3462,18 +3425,6 @@ packages: integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== } - /intl-messageformat/9.12.0: - resolution: - { - integrity: sha512-5Q9j21JreB1G27/CqMYsA+pvJ19JjHyhiTSeUuvZK9BCDJGHtOLgpUUcGM+GLHiUuoVMKVeeX1smamiVHQrSKQ== - } - dependencies: - '@formatjs/ecma402-abstract': 1.11.4 - '@formatjs/fast-memoize': 1.2.1 - '@formatjs/icu-messageformat-parser': 2.0.19 - tslib: 2.3.1 - dev: true - /invariant/2.2.4: resolution: { @@ -5243,24 +5194,6 @@ packages: svelte: 3.46.4 dev: true - /svelte-i18n/3.3.13_svelte@3.46.4: - resolution: - { - integrity: sha512-RQM+ys4+Y9ztH//tX22H1UL2cniLNmIR+N4xmYygV6QpQ6EyQvloZiENRew8XrVzfvJ8HaE8NU6/yurLkl7z3g== - } - engines: { node: '>= 11.15.0' } - hasBin: true - peerDependencies: - svelte: ^3.25.1 - dependencies: - deepmerge: 4.2.2 - estree-walker: 2.0.2 - intl-messageformat: 9.12.0 - sade: 1.7.4 - svelte: 3.46.4 - tiny-glob: 0.2.9 - dev: true - /svelte-kit-cookie-session/2.1.2: resolution: { @@ -5338,6 +5271,19 @@ packages: engines: { node: '>= 8' } dev: true + /sveltekit-i18n/2.1.2_svelte@3.46.4: + resolution: + { + integrity: sha512-s5YxcbNd2EWNZaZR1A4Drt8s53E4fpUkN4XIWd3VRpw1pihZVWssqmBW1qkjQ6AB0kiu1Qwule+vt1HkbQOjrg== + } + peerDependencies: + svelte: ^3.x + dependencies: + '@sveltekit-i18n/base': 1.1.1_svelte@3.46.4 + '@sveltekit-i18n/parser-default': 1.0.3 + svelte: 3.46.4 + dev: true + /table/6.7.2: resolution: { diff --git a/src/hooks.ts b/src/hooks.ts index d6c6eca6d..e0e4707cb 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -6,6 +6,7 @@ import { getUserDetails, sentry } from '$lib/common'; import { version } from '$lib/common'; import cookie from 'cookie'; import { dev } from '$app/env'; +import { locales } from '$lib/translations'; export const handle = handleSession( { @@ -15,6 +16,29 @@ export const handle = handleSession( }, async function ({ event, resolve }) { let response; + + const { url, request } = event; + const { pathname } = url; + + // Get defined locales + const supportedLocales = locales.get(); + let locale; + + if (event.locals.cookies) { + locale = supportedLocales.find( + (l) => `${l}`.toLowerCase() === `${event.locals.cookies['lang']}`.toLowerCase() + ); + } + + if (!locale) { + locale = `${`${request.headers.get('accept-language')}`.match( + /[a-zA-Z]+?(?=-|_|,|;)/ + )}`.toLowerCase(); + + // Set default locale if user preferred locale does not match + if (!supportedLocales.includes(locale)) locale = 'en'; + } + try { if (event.locals.cookies) { if (event.locals.cookies['kit.session']) { @@ -24,7 +48,8 @@ export const handle = handleSession( teamId, permission, isAdmin: permission === 'admin' || permission === 'owner', - expires: event.locals.session.data.expires + expires: event.locals.session.data.expires, + lang: locale }; if (JSON.stringify(event.locals.session.data) !== JSON.stringify(newSession)) { @@ -34,12 +59,14 @@ export const handle = handleSession( } response = await resolve(event, { - ssr: !event.url.pathname.startsWith('/webhooks/success') + ssr: !event.url.pathname.startsWith('/webhooks/success'), + transformPage: ({ html }) => html.replace(//, ``) }); } catch (error) { console.log(error); response = await resolve(event, { - ssr: !event.url.pathname.startsWith('/webhooks/success') + ssr: !event.url.pathname.startsWith('/webhooks/success'), + transformPage: ({ html }) => html.replace(//, ``) }); response.headers.append( 'Set-Cookie', @@ -62,9 +89,18 @@ export const handle = handleSession( expires: new Date('Thu, 01 Jan 1970 00:00:01 GMT') }) ); - } finally { - return response; } + + response.headers.append( + 'Set-Cookie', + cookie.serialize('lang', locale, { + path: '/', + sameSite: 'strict', + maxAge: 30 * 24 * 60 * 60 + }) + ); + + return response; } ); diff --git a/src/lib/lang.json b/src/lib/lang.json new file mode 100644 index 000000000..fdfc5bf80 --- /dev/null +++ b/src/lib/lang.json @@ -0,0 +1,4 @@ +{ + "fr": "Français", + "en": "English" +} diff --git a/src/lib/translations.ts b/src/lib/translations.ts new file mode 100644 index 000000000..69282b21c --- /dev/null +++ b/src/lib/translations.ts @@ -0,0 +1,28 @@ +import i18n from 'sveltekit-i18n'; +import lang from './lang.json'; + +/** @type {import('sveltekit-i18n').Config} */ +const config = { + defaultLocale: 'en', + fallbackLocale: 'en', + translations: { + en: { lang }, + fr: { lang } + }, + loaders: [ + { + locale: 'en', + key: '', + loader: async () => (await import('../../static/locales/en.json')).default + }, + { + locale: 'fr', + key: '', + loader: async () => (await import('../../static/locales/fr.json')).default + } + ] +}; + +export const { t, locale, locales, loading, loadTranslations } = new i18n(config); + +loading.subscribe(($loading) => $loading && console.log('Loading translations...')); diff --git a/src/routes/__error.svelte b/src/routes/__error.svelte index 67693e70a..edecc0f82 100644 --- a/src/routes/__error.svelte +++ b/src/routes/__error.svelte @@ -12,7 +12,8 @@ @@ -21,8 +22,8 @@
{status}
Ooops you are lost! But don't be afraid!
 	import type { Load } from '@sveltejs/kit';
 	import { publicPaths } from '$lib/settings';
+	import { locale, loadTranslations } from '$lib/translations';
 
 	export const load: Load = async ({ fetch, url, session }) => {
 		if (!session.userId && !publicPaths.includes(url.pathname)) {
@@ -15,6 +16,12 @@
 		const endpoint = `/teams.json`;
 		const res = await fetch(endpoint);
 
+		const { pathname } = url;
+		const defaultLocale = session.lang;
+		const initLocale = locale.get() || defaultLocale;
+
+		await loadTranslations(initLocale, pathname);
+
 		if (res.ok) {
 			return {
 				props: {
@@ -23,6 +30,7 @@
 				}
 			};
 		}
+
 		return {};
 	};
 
@@ -38,18 +46,8 @@
 	import { errorNotification } from '$lib/form';
 	import { asyncSleep } from '$lib/components/common';
 	import { del, get, post } from '$lib/api';
-	import { register, init, _, getLocaleFromNavigator } from 'svelte-i18n';
-
-	async function setup() {
-		register('en', () => import('../../static/locales/en.json'));
-
-		return await Promise.allSettled([
-			// TODO: add some more stuff you want to init ...
-			init({ initialLocale: getLocaleFromNavigator(), fallbackLocale: 'en' })
-		]);
-	}
-
-	const setupResult = setup();
+	import { browser } from '$app/env';
+	import { loading, t } from '$lib/translations';
 
 	let isUpdateAvailable = false;
 
@@ -115,7 +113,7 @@
 				return window.location.reload();
 			} else {
 				await post(`/update.json`, { type: 'update', latestVersion });
-				toast.push(`${$_('layout.update_done')}

${$_('layout.wait_new_version_startup')}`); + toast.push(`${$t('layout.update_done')}

${$t('layout.wait_new_version_startup')}`); let reachable = false; let tries = 0; do { @@ -129,7 +127,7 @@ if (reachable) break; tries++; } while (!reachable || tries < 120); - toast.push($_('layout.new_version')); + toast.push($t('layout.new_version')); updateStatus.loading = false; updateStatus.success = true; await asyncSleep(3000); @@ -147,7 +145,7 @@ Coolify -{#await setupResult} +{#await loading} Please wait... {:then} @@ -336,7 +334,7 @@ {#if isUpdateAvailable} {loading ? $t('login.authenticating') : $t('login.login')} {$t('register.register')} goto('/reset')}>{$t('reset.reset_password')}
diff --git a/src/routes/register/index.svelte b/src/routes/register/index.svelte index 35501fce2..9de0626db 100644 --- a/src/routes/register/index.svelte +++ b/src/routes/register/index.svelte @@ -6,6 +6,7 @@ import { session } from '$app/stores'; import { post } from '$lib/api'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; import { onMount } from 'svelte'; let loading = false; @@ -20,7 +21,7 @@ }); async function handleSubmit() { if (password !== passwordCheck) { - return errorNotification('Passwords do not match.'); + return errorNotification($t('forms.passwords_not_match')); } loading = true; try { @@ -57,7 +58,7 @@
{#if $session.userId} -
Already logged in...
+
{$t('login.already_logged_in')}
{:else}
@@ -66,7 +67,7 @@
{$t('register.register')}
{#if userCount === 0}
- You are registering the first user. It will be the administrator of your Coolify instance. + {$t('register.first_user')}
{/if} {/if} diff --git a/static/locales/en.json b/static/locales/en.json deleted file mode 100644 index f0f095a3b..000000000 --- a/static/locales/en.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "layout": { - "update_done": "Update completed.", - "wait_new_version_startup": "Waiting for the new version to start...", - "new_version": "New version reachable. Reloading...", - "switch_to_a_different_team": "Switch to a different team...", - "update_available": "Update available" - }, - "error": { - "you_can_find_your_way_back": "You can find your way back", - "here": "here" - }, - "index": { - "dashboard": "Dashboard" - } -} diff --git a/static/locales/fr.json b/static/locales/fr.json deleted file mode 100644 index 14f19dd47..000000000 --- a/static/locales/fr.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "index": { - "dashboard": "Tableau de bord" - } -} diff --git a/svelte.config.js b/svelte.config.js index 9d711910b..4e8bc8966 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -12,12 +12,6 @@ const config = { vite: { optimizeDeps: { exclude: ['svelte-kit-cookie-session'] - }, - server: { - fs: { - // Allow serving files from one level up to the project root - allow: ['../locales'] - } } } } From 8f58b14629f986c8486f6aa409fa7aa86ee154ef Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 22:04:50 +0200 Subject: [PATCH 08/23] Add application i18n --- src/lib/locales/en.json | 34 ++++++++++++++++++- src/lib/locales/fr.json | 2 +- .../[id]/configuration/_BuildPack.svelte | 5 ++- .../configuration/_GithubRepositories.svelte | 23 +++++++------ .../configuration/_GitlabRepositories.svelte | 30 +++++++++------- .../[id]/configuration/buildpack.svelte | 12 ++++--- .../[id]/configuration/destination.svelte | 7 ++-- .../[id]/configuration/repository.svelte | 6 +++- .../[id]/configuration/source.svelte | 9 +++-- 9 files changed, 92 insertions(+), 36 deletions(-) diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index a6a99215b..2c6d457eb 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -28,7 +28,9 @@ "password": "Password", "email": "Email", "passwords_not_match": "Passwords do not match.", - "password_again": "Password again" + "password_again": "Password again", + "save": "Save", + "saving": "Saving..." }, "register": { "register": "Register", @@ -36,5 +38,35 @@ }, "reset": { "reset_password": "Reset password" + }, + "application": { + "configuration": { + "buildpack": { + "choose_this_one": "Choose this one..." + }, + "branch_already_in_use": "This branch is already used by another application. Webhooks won't work in this case for both applications. Are you sure you want to use it?", + "no_repositories_configured": "No repositories configured for your Git Application.", + "configure_it_now": "Configure it now", + "loading_repositories": "Loading repositories ...", + "select_a_repository": "Please select a repository", + "loading_branches": "Loading branches ...", + "select_a_repository_first": "Please select a repository first", + "select_a_branch": "Please select a branch", + "loading_groups": "Loading groups...", + "select_a_group": "Please select a group", + "loading_projects": "Loading projects...", + "select_a_project": "Please select a project", + "no_projects_found": "No projects found", + "no_branches_found": "No branches found", + "configure_build_pack": "Configure Build Pack", + "scanning_repository_suggest_build_pack": "Scanning repository to suggest a build pack for you...", + "found_lock_file": "Found lock file for {packageManager}. Using it for predefined commands commands.", + "configure_destination": "Configure Destination", + "no_configurable_destination": "No configurable Destination found", + "select_a_repository_project": "Select a Repository / Project", + "select_a_git_source": "Select a Git Source", + "no_configurable_git": "No configurable Git Source found", + "configuration_missing": "Configuration missing" + } } } diff --git a/src/lib/locales/fr.json b/src/lib/locales/fr.json index d52be9989..a4a2cea1d 100644 --- a/src/lib/locales/fr.json +++ b/src/lib/locales/fr.json @@ -5,7 +5,7 @@ "databases": "Bases de données", "destinations": "Destinations", "git_sources": "Sources Git", - "services": "Prestations de service", + "services": "Services", "teams": "Équipes" }, "error": { diff --git a/src/routes/applications/[id]/configuration/_BuildPack.svelte b/src/routes/applications/[id]/configuration/_BuildPack.svelte index dadbc9dde..60dbcc789 100644 --- a/src/routes/applications/[id]/configuration/_BuildPack.svelte +++ b/src/routes/applications/[id]/configuration/_BuildPack.svelte @@ -5,6 +5,7 @@ import { post } from '$lib/api'; import { findBuildPack } from '$lib/components/templates'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; const { id } = $page.params; const from = $page.url.searchParams.get('from'); @@ -42,7 +43,9 @@ buildPack.name && buildPack.color}" >{buildPack.fancyName} {#if !scanning && foundConfig?.name === buildPack.name} - Choose this one... + {$t('application.configuration.buildpack.choose_this_one')} {/if} diff --git a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte b/src/routes/applications/[id]/configuration/_GithubRepositories.svelte index 06e58be58..4523da47f 100644 --- a/src/routes/applications/[id]/configuration/_GithubRepositories.svelte +++ b/src/routes/applications/[id]/configuration/_GithubRepositories.svelte @@ -7,6 +7,7 @@ import { errorNotification } from '$lib/form'; import { onMount } from 'svelte'; import { gitTokens } from '$lib/store'; + import { t } from '$lib/translations'; const { id } = $page.params; const from = $page.url.searchParams.get('from'); @@ -84,9 +85,7 @@ `/applications/${id}/configuration/repository.json?repository=${selected.repository}&branch=${selected.branch}` ); if (data.used) { - const sure = confirm( - `This branch is already used by another application. Webhooks won't work in this case for both applications. Are you sure you want to use it?` - ); + const sure = confirm($t('application.configuration.branch_already_in_use')); if (sure) { selected.autodeploy = false; showSave = true; @@ -160,8 +159,10 @@ {#if repositories.length === 0 && loading.repositories === false}
-
No repositories configured for your Git Application.
- +
{$t('application.configuration.no_repositories_configured')}
+
{:else}
@@ -170,8 +171,8 @@
Save{$t('forms.save')}
-
General
+
{$t('general')}
{#if $session.isAdmin} {loading + ? $t('forms.saving') + : forceSave + ? $t('forms.confirm_continue') + : $t('forms.save')} {/if}
- +
- +
- +
-
Application
+
{$t('application.application')}
- + {#if browser && window.location.hostname === 'demo.coolify.io'} {/if} - +
!isRunning && changeSettings('dualCerts')} />
{#if !staticDeployments.includes(application.buildPack)}
- +
{/if} @@ -331,63 +344,63 @@ {#if !notNodeDeployments.includes(application.buildPack)}
{$t('application.install_command')}
- +
- +
{/if}
{$t('forms.base_directory')} - +
{#if !notNodeDeployments.includes(application.buildPack)}
{$t('forms.publish_directory')} - +
{/if}
-
Features
+
{$t('application.features')}
@@ -410,8 +423,8 @@ isCenter={false} bind:setting={autodeploy} on:click={() => changeSettings('autodeploy')} - title="Enable Automatic Deployment" - description="Enable automatic deployment through webhooks." + title={$t('application.enable_automatic_deployment')} + description={$t('application.enable_auto_deploy_webhooks')} />
@@ -419,8 +432,8 @@ isCenter={false} bind:setting={previews} on:click={() => changeSettings('previews')} - title="Enable MR/PR Previews" - description="Enable preview deployments from pull or merge requests." + title={$t('application.enable_mr_pr_previews')} + description={$t('application.enable_preview_deploy_mr_pr_requests')} />
@@ -428,8 +441,8 @@ isCenter={false} bind:setting={debug} on:click={() => changeSettings('debug')} - title="Debug Logs" - description="Enable debug logs during build phase.
Sensitive information could be visible and saved in logs." + title={$t('application.debug_logs')} + description={$t('application.enable_debug_log_during_build')} />
diff --git a/src/routes/applications/[id]/logs/build/_BuildLog.svelte b/src/routes/applications/[id]/logs/build/_BuildLog.svelte index 4379d2d27..9a8dea4cc 100644 --- a/src/routes/applications/[id]/logs/build/_BuildLog.svelte +++ b/src/routes/applications/[id]/logs/build/_BuildLog.svelte @@ -10,6 +10,7 @@ import LoadingLogs from '../_Loading.svelte'; import { get } from '$lib/api'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; let logs = []; let loading = true; @@ -84,7 +85,7 @@ {/if} {#if currentStatus === 'queued'} -
Queued and waiting for execution.
+
{$t('application.build.queued_waiting_exec')}
{:else}
@@ -119,19 +121,23 @@
{#if build.status === 'running'} -
Running
+
{$t('application.build.running')}
{:else if build.status === 'queued'} -
Queued
+
{$t('application.build.queued')}
{:else}
{build.since}
-
Finished in {build.took}s
+
+ {$t('application.build.finished_in')} {build.took}s +
{/if}
{/each}
- +
@@ -143,5 +149,5 @@
{#if buildCount === 0} -
No logs found
+
{$t('application.build.no_logs')}
{/if} diff --git a/src/routes/applications/[id]/logs/index.svelte b/src/routes/applications/[id]/logs/index.svelte index 036832f6c..c5eb52a2f 100644 --- a/src/routes/applications/[id]/logs/index.svelte +++ b/src/routes/applications/[id]/logs/index.svelte @@ -27,6 +27,7 @@ import { getDomain } from '$lib/components/common'; import { get } from '$lib/api'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; let loadLogsInterval = null; let logs = []; @@ -75,7 +76,7 @@
{#if logs.length === 0} -
Waiting for the logs...
+
{$t('application.build.waiting_logs')}
{:else}
diff --git a/src/routes/applications/[id]/previews/index.svelte b/src/routes/applications/[id]/previews/index.svelte index e78e46efd..5d249412d 100644 --- a/src/routes/applications/[id]/previews/index.svelte +++ b/src/routes/applications/[id]/previews/index.svelte @@ -31,6 +31,7 @@ import Explainer from '$lib/components/Explainer.svelte'; import { errorNotification } from '$lib/form'; import { toast } from '@zerodevx/svelte-toast'; + import { t } from '$lib/translations'; const { id } = $page.params; async function refreshSecrets() { @@ -61,10 +62,12 @@ - - - - + + + + @@ -90,8 +93,8 @@ Useful for creating staging environments." - : "These values overwrite application secrets in PR/MR deployments. Useful for creating staging environments."} + ? $t('application.preview.setup_secret_app_first') + : $t('application.preview.values_overwriting_app_secrets')} />
@@ -105,13 +108,15 @@
{$t('application.preview.redeploy')}
{/each} {:else}
-
No previews available
+
+ {$t('application.preview.no_previews_available')} +
{/if}
diff --git a/src/routes/applications/[id]/secrets/_Secret.svelte b/src/routes/applications/[id]/secrets/_Secret.svelte index 12b03cb7b..34b997761 100644 --- a/src/routes/applications/[id]/secrets/_Secret.svelte +++ b/src/routes/applications/[id]/secrets/_Secret.svelte @@ -12,6 +12,7 @@ import { del, post } from '$lib/api'; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; import { toast } from '@zerodevx/svelte-toast'; import { createEventDispatcher } from 'svelte'; @@ -31,8 +32,8 @@ } } async function saveSecret(isNew = false) { - if (!name) return errorNotification('Name is required.'); - if (!value) return errorNotification('Value is required.'); + if (!name) return errorNotification(`${$t('forms.name')} ${$t('forms.is_required')}`); + if (!value) return errorNotification(`${$t('forms.value')} ${$t('forms.is_required')}`); try { await post(`/applications/${id}/secrets.json`, { name, @@ -47,7 +48,7 @@ value = ''; isBuildSecret = false; } - toast.push('Secret saved.'); + toast.push($t('application.secrets.secret_saved')); } catch ({ error }) { return errorNotification(error); } @@ -93,7 +94,7 @@ class:cursor-not-allowed={!isNewSecret} class:cursor-pointer={isNewSecret} > - Use isBuildSecret + {$t('application.secrets.use_isbuildsecret')} {#if isNewSecret}
- +
{:else}
- +
{#if !isPRMRSecret}
- +
{/if}
diff --git a/src/routes/applications/[id]/secrets/index.svelte b/src/routes/applications/[id]/secrets/index.svelte index faeb22361..dd0ceab49 100644 --- a/src/routes/applications/[id]/secrets/index.svelte +++ b/src/routes/applications/[id]/secrets/index.svelte @@ -26,6 +26,7 @@ import { getDomain } from '$lib/components/common'; import { page } from '$app/stores'; import { get } from '$lib/api'; + import { t } from '$lib/translations'; const { id } = $page.params; @@ -37,17 +38,20 @@
- Secrets for {getDomain(application.fqdn)} + {$t('application.secrets.secrets_for')} + {getDomain(application.fqdn)}
NameValueNeed during buildtime?Action{$t('forms.name')}{$t('forms.value')}{$t('application.preview.need_during_buildtime')}{$t('forms.action')}
- - - - + + + + diff --git a/src/routes/applications/[id]/settings.json.ts b/src/routes/applications/[id]/settings.json.ts index aea78ff96..77c4bc886 100644 --- a/src/routes/applications/[id]/settings.json.ts +++ b/src/routes/applications/[id]/settings.json.ts @@ -1,6 +1,7 @@ import { getUserDetails } from '$lib/common'; import * as db from '$lib/database'; import { ErrorHandler } from '$lib/database'; +import { t } from '$lib/translations'; import type { RequestHandler } from '@sveltejs/kit'; export const post: RequestHandler = async (event) => { @@ -14,8 +15,7 @@ export const post: RequestHandler = async (event) => { const isDouble = await db.checkDoubleBranch(branch, projectId); if (isDouble && autodeploy) { throw { - message: - 'Cannot activate automatic deployments until only one application is defined for this repository / branch.' + message: t.get('application.cant_activate_auto_deploy_without_repo') }; } await db.setApplicationSettings({ id, debug, previews, dualCerts, autodeploy }); diff --git a/src/routes/applications/[id]/storage/_Storage.svelte b/src/routes/applications/[id]/storage/_Storage.svelte index 0b75ec717..363c93390 100644 --- a/src/routes/applications/[id]/storage/_Storage.svelte +++ b/src/routes/applications/[id]/storage/_Storage.svelte @@ -10,12 +10,13 @@ import { errorNotification } from '$lib/form'; import { toast } from '@zerodevx/svelte-toast'; + import { t } from '$lib/translations'; const { id } = $page.params; const dispatch = createEventDispatcher(); async function saveStorage(newStorage = false) { try { - if (!storage.path) return errorNotification('Path is required.'); + if (!storage.path) return errorNotification($t('application.storage.path_is_required')); storage.path = storage.path.startsWith('/') ? storage.path : `/${storage.path}`; storage.path = storage.path.endsWith('/') ? storage.path.slice(0, -1) : storage.path; storage.path.replace(/\/\//g, '/'); @@ -29,8 +30,8 @@ storage.path = null; storage.id = null; } - if (newStorage) toast.push('Storage saved.'); - else toast.push('Storage updated.'); + if (newStorage) toast.push($t('application.storage.storage_saved')); + else toast.push($t('application.storage.storage_updated')); } catch ({ error }) { return errorNotification(error); } @@ -39,7 +40,7 @@ try { await del(`/applications/${id}/storage.json`, { path: storage.path }); dispatch('refresh'); - toast.push('Storage deleted.'); + toast.push($t('application.storage.storage_deleted')); } catch ({ error }) { return errorNotification(error); } @@ -57,16 +58,19 @@
NameValueNeed during buildtime?Action{$t('forms.name')}{$t('forms.value')}{$t('application.preview.need_during_buildtime')}{$t('forms.action')}
{#if isNew}
- saveStorage(true)} + >{$t('forms.add')}
{:else}
- +
- +
{/if} diff --git a/src/routes/applications/[id]/storage/index.svelte b/src/routes/applications/[id]/storage/index.svelte index 75b129d68..473d35f2a 100644 --- a/src/routes/applications/[id]/storage/index.svelte +++ b/src/routes/applications/[id]/storage/index.svelte @@ -28,6 +28,7 @@ import Storage from './_Storage.svelte'; import { get } from '$lib/api'; import Explainer from '$lib/components/Explainer.svelte'; + import { t } from '$lib/translations'; const { id } = $page.params; async function refreshStorage() { @@ -46,15 +47,12 @@
- This is useful for storing data such as a database (SQLite) or a cache.'} - /> +
- + diff --git a/src/routes/applications/_Application.svelte b/src/routes/applications/_Application.svelte index 16d19a42f..d3b9b9d51 100644 --- a/src/routes/applications/_Application.svelte +++ b/src/routes/applications/_Application.svelte @@ -15,6 +15,7 @@ import Docker from '$lib/components/svg/applications/Docker.svelte'; import Astro from '$lib/components/svg/applications/Astro.svelte'; import Eleventy from '$lib/components/svg/applications/Eleventy.svelte'; + import { t } from '$lib/translations'; const buildPack = application?.buildPack?.toLowerCase(); @@ -59,7 +60,7 @@ {/if} {#if !application.gitSourceId || !application.destinationDockerId}
- Configuration missing + {$t('application.configuration.configuration_missing')}
{/if} diff --git a/src/routes/applications/index.svelte b/src/routes/applications/index.svelte index 5f6056ac5..d559fd7b9 100644 --- a/src/routes/applications/index.svelte +++ b/src/routes/applications/index.svelte @@ -4,6 +4,7 @@ import Application from './_Application.svelte'; import { post } from '$lib/api'; import { goto } from '$app/navigation'; + import { t } from '$lib/translations'; async function newApplication() { const { id } = await post('/applications/new', {}); return await goto(`/applications/${id}`, { replaceState: true }); @@ -11,7 +12,7 @@
-
Applications
+
{$t('index.applications')}
{#if $session.isAdmin}
{#if !applications || applications.length === 0}
-
No applications found
+
{$t('application.no_applications_found')}
{:else} {#each applications as application} From 7a0d15146749f8cde90699ee9db0b2148b7102c6 Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 23:17:59 +0200 Subject: [PATCH 10/23] Add database translation --- src/lib/locales/en.json | 31 +++++++++++++- .../databases/[id]/_Databases/_CouchDb.svelte | 27 +++++++----- .../[id]/_Databases/_Databases.svelte | 41 +++++++++++-------- .../databases/[id]/_Databases/_MongoDB.svelte | 11 +++-- .../databases/[id]/_Databases/_MySQL.svelte | 27 +++++++----- .../[id]/_Databases/_PostgreSQL.svelte | 17 +++++--- .../databases/[id]/_Databases/_Redis.svelte | 15 ++++--- src/routes/databases/[id]/__layout.svelte | 21 +++++----- .../[id]/configuration/destination.svelte | 7 +++- .../databases/[id]/configuration/type.svelte | 2 +- .../[id]/configuration/version.svelte | 3 +- src/routes/databases/index.svelte | 7 ++-- .../services/[id]/_Services/_MinIO.svelte | 6 +-- .../[id]/_Services/_PlausibleAnalytics.svelte | 2 +- .../services/[id]/_Services/_Wordpress.svelte | 4 +- 15 files changed, 143 insertions(+), 78 deletions(-) diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index 6c52891c6..3b0ff03fd 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -44,7 +44,15 @@ "port": "Port", "default": "default", "base_directory": "Base Directory", - "publish_directory": "Publish Directory" + "publish_directory": "Publish Directory", + "generated_automatically_after_start": "Generated automatically after start", + "roots_password": "Root's Password", + "root_user": "Root User", + "eg": "eg", + "user": "User", + "loading": "Loading...", + "version": "Version", + "host": "Host" }, "register": { "register": "Register", @@ -155,5 +163,24 @@ "cant_activate_auto_deploy_without_repo": "Cannot activate automatic deployments until only one application is defined for this repository / branch.", "no_applications_found": "No applications found" }, - "general": "General" + "general": "General", + "database": { + "default_database": "Default Database", + "generated_automatically_after_set_to_public": "Generated automatically after set to public", + "connection_string": "Connection String", + "set_public": "Set it public", + "warning_database_public": "Your database will be reachable over the internet.
Take security seriously in this case!", + "change_append_only_mode": "Change append only mode", + "warning_append_only": "Useful if you would like to restore redis data from a backup.
Database restart is required.", + "select_database_type": "Select a Database type", + "select_database_version": "Select a Database version", + "confirm_stop": "Are you sure you would like to stop {name}?", + "stop_database": "Stop database", + "permission_denied_stop_database": "You do not have permission to stop the database.", + "start_database": "Start database", + "permission_denied_start_database": "You do not have permission to start the database.", + "delete_database": "Delete Database", + "permission_denied_delete_database": "You do not have permission to delete a Database", + "no_databases_found": "No databases found" + } } diff --git a/src/routes/databases/[id]/_Databases/_CouchDb.svelte b/src/routes/databases/[id]/_Databases/_CouchDb.svelte index 861e21cb5..f8f9ebc10 100644 --- a/src/routes/databases/[id]/_Databases/_CouchDb.svelte +++ b/src/routes/databases/[id]/_Databases/_CouchDb.svelte @@ -1,6 +1,7 @@
@@ -8,34 +9,38 @@
- +
- +
- +
- +
- +
-
General
+
{$t('general')}
{#if $session.isAdmin} {loading ? $t('forms.saving') : $t('forms.save')} {/if}
- +
- + {#if database.destinationDockerId}
- +
- +
- + {/if}
- +
-
Features
+
{$t('application.features')}
changeSettings('isPublic')} - title="Set it public" - description="Your database will be reachable over the internet.
Take security seriously in this case!" + title={$t('database.set_public')} + description={$t('database.warning_database_public')} />
{#if database.type === 'redis'} @@ -190,8 +197,8 @@ changeSettings('appendOnly')} - title="Change append only mode" - description="Useful if you would like to restore redis data from a backup.
Database restart is required." + title={$t('database.change_append_only_mode')} + description={$t('database.warning_append_only')} />
{/if} diff --git a/src/routes/databases/[id]/_Databases/_MongoDB.svelte b/src/routes/databases/[id]/_Databases/_MongoDB.svelte index 7ec21edcd..1a6a526ce 100644 --- a/src/routes/databases/[id]/_Databases/_MongoDB.svelte +++ b/src/routes/databases/[id]/_Databases/_MongoDB.svelte @@ -1,6 +1,7 @@
@@ -8,9 +9,9 @@
- +
- + export let database; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; + import { t } from '$lib/translations';
@@ -8,34 +9,38 @@
- +
- +
- +
- +
- + export let database; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; + import { t } from '$lib/translations';
@@ -8,34 +9,38 @@
- +
- +
- + export let database; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; + import { t } from '$lib/translations';
@@ -8,11 +9,13 @@
- +
- +
- +
@@ -174,13 +175,13 @@
-->
- +
@@ -189,7 +190,7 @@ disabled={cannotDisable} bind:setting={destination.isCoolifyProxyUsed} on:click={changeProxySetting} - title="Use Coolify Proxy?" + title={$t('destination.use_coolify_proxy')} description={`This will install a proxy on the destination to allow you to access your applications and services without any manual configuration. Databases will have their own proxy.

${ cannotDisable ? 'You cannot disable this proxy as FQDN is configured for Coolify.' diff --git a/src/routes/destinations/[id]/_RemoteDocker.svelte b/src/routes/destinations/[id]/_RemoteDocker.svelte index 4de1b82ce..c17d0239b 100644 --- a/src/routes/destinations/[id]/_RemoteDocker.svelte +++ b/src/routes/destinations/[id]/_RemoteDocker.svelte @@ -11,6 +11,7 @@ import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; import { onMount } from 'svelte'; import { generateRemoteEngine } from '$lib/components/common'; + import { t } from '$lib/translations'; const { id } = $page.params; let cannotDisable = settings.fqdn && destination.engine === '/var/run/docker.sock'; // let scannedApps = []; @@ -90,7 +91,7 @@ try { const engine = generateRemoteEngine(destination); await post(`/destinations/${id}/stop.json`, { engine }); - return toast.push('Coolify Proxy stopped!'); + return toast.push($t('destination.coolify_proxy_stopped')); } catch ({ error }) { return errorNotification(error); } @@ -99,19 +100,17 @@ try { const engine = generateRemoteEngine(destination); await post(`/destinations/${id}/start.json`, { engine }); - return toast.push('Coolify Proxy started!'); + return toast.push($t('destination.coolify_proxy_started')); } catch ({ error }) { return errorNotification(error); } } async function forceRestartProxy() { - const sure = confirm( - 'Are you sure you want to restart the proxy? Everything will be reconfigured in ~10 secs.' - ); + const sure = confirm($t('destination.confirm_restart_proxy')); if (sure) { try { restarting = true; - toast.push('Coolify Proxy restarting...'); + toast.push($t('destination.coolify_proxy_restarting')); await post(`/destinations/${id}/restart.json`, { engine: destination.engine, fqdn: settings.fqdn @@ -127,7 +126,7 @@
-
Configuration
+
{$t('forms.configuration')}
{#if $session.isAdmin} {restarting + ? $t('destination.restarting_please_wait') + : $t('destination.force_restart_proxy')} {/if}
- +
- +
@@ -175,13 +176,13 @@
-->
- +
@@ -190,7 +191,7 @@ disabled={cannotDisable} bind:setting={destination.isCoolifyProxyUsed} on:click={changeProxySetting} - title="Use Coolify Proxy?" + title={$t('destination.use_coolify_proxy')} description={`This will install a proxy on the destination to allow you to access your applications and services without any manual configuration. Databases will have their own proxy.

${ cannotDisable ? 'You cannot disable this proxy as FQDN is configured for Coolify.' diff --git a/src/routes/destinations/[id]/__layout.svelte b/src/routes/destinations/[id]/__layout.svelte index 892e8e99b..6d49fbb63 100644 --- a/src/routes/destinations/[id]/__layout.svelte +++ b/src/routes/destinations/[id]/__layout.svelte @@ -37,10 +37,11 @@ import DeleteIcon from '$lib/components/DeleteIcon.svelte'; import { del } from '$lib/api'; import { goto } from '$app/navigation'; + import { t } from '$lib/translations'; export let destination; async function deleteDestination(destination) { - const sure = confirm(`Are you sure you would like to delete '${destination.name}'?`); + const sure = confirm($t('application.confirm_to_delete', { name: destination.name })); if (sure) { try { await del(`/destinations/${destination.id}.json`, { id: destination.id }); @@ -55,14 +56,14 @@ diff --git a/src/routes/destinations/[id]/index.svelte b/src/routes/destinations/[id]/index.svelte index 68f529b54..1effefdd7 100644 --- a/src/routes/destinations/[id]/index.svelte +++ b/src/routes/destinations/[id]/index.svelte @@ -36,10 +36,11 @@ import type Prisma from '@prisma/client'; import LocalDocker from './_LocalDocker.svelte'; import RemoteDocker from './_RemoteDocker.svelte'; + import { t } from '$lib/translations';
-
Destination
+
{$t('application.destination')}
> {destination.name}
diff --git a/src/routes/destinations/index.svelte b/src/routes/destinations/index.svelte index 01f860b21..e610777c0 100644 --- a/src/routes/destinations/index.svelte +++ b/src/routes/destinations/index.svelte @@ -23,11 +23,13 @@ import type Prisma from '@prisma/client'; import { session } from '$app/stores'; + import { t } from '$lib/translations'; + export let destinations: Prisma.DestinationDocker[];
-
Destinations
+
{$t('index.destinations')}
{#if $session.isAdmin} {#if !destinations || destinations.length === 0}
-
No destination found
+
{$t('destination.no_destination_found')}
{:else}
From c1c25d59c8333a725faf82f0f8dd722588216151 Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 23:53:10 +0200 Subject: [PATCH 12/23] Add "new" i18n --- src/lib/locales/en.json | 35 ++++++++++++-- .../new/destination/_LocalDocker.svelte | 30 +++++++----- .../new/destination/_RemoteDocker.svelte | 46 +++++++++++-------- src/routes/new/destination/check.json.ts | 4 +- src/routes/new/destination/index.svelte | 15 +++--- src/routes/new/source/_Github.svelte | 27 +++++------ src/routes/new/source/_Gitlab.svelte | 17 +++---- src/routes/new/source/index.svelte | 8 ++-- 8 files changed, 117 insertions(+), 65 deletions(-) diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index 0d65578b4..ef2a5f2e8 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -17,7 +17,8 @@ "git_sources": "Git Sources", "databases": "Databases", "services": "Services", - "teams": "Teams" + "teams": "Teams", + "not_implemented_yet": "Not implemented yet" }, "login": { "already_logged_in": "Already logged in...", @@ -31,7 +32,7 @@ "password_again": "Password again", "save": "Save", "saving": "Saving...", - "name": "name", + "name": "Name", "value": "Value", "action": "Action", "is_required": "is required.", @@ -56,7 +57,13 @@ "already_used_for": "{type} already used for", "configuration": "Configuration", "engine": "Engine", - "network": "Network" + "network": "Network", + "ip_address": "IP Address", + "ssh_private_key": "SSH Private Key", + "type": "Type", + "html_url": "HTML URL", + "api_url": "API URL", + "organization": "Organization" }, "register": { "register": "Register", @@ -198,6 +205,26 @@ "restarting_please_wait": "Restarting... please wait...", "force_restart_proxy": "Force restart proxy", "use_coolify_proxy": "Use Coolify Proxy?", - "no_destination_found": "No destination found" + "no_destination_found": "No destination found", + "new_error_network_already_exists": "Network {network} already configured for another team!", + "new": { + "saving_and_configuring_proxy": "Saving and configuring proxy...", + "install_proxy": "This will install a proxy on the destination to allow you to access your applications and services without any manual configuration (recommended for Docker).

Databases will have their own proxy.", + "add_new_destination": "Add New Destination", + "predefined_destinations": "Predefined destinations" + } + }, + "sources": { + "local_docker": "Local Docker", + "remote_docker": "Remote Docker", + "organization_explainer": "Fill it if you would like to use an organization's as your Git Source. Otherwise your user will be used." + }, + "eg_https_api_github_com": "eg: https://api.github.com", + "eg_https_github_com": "eg: https://github.com", + "source": { + "new": { + "git_source": "Add New Git Source", + "official_providers": "Official providers" + } } } diff --git a/src/routes/new/destination/_LocalDocker.svelte b/src/routes/new/destination/_LocalDocker.svelte index 79a2c81b0..2cc8e65ff 100644 --- a/src/routes/new/destination/_LocalDocker.svelte +++ b/src/routes/new/destination/_LocalDocker.svelte @@ -6,6 +6,7 @@ import { post } from '$lib/api'; import Setting from '$lib/components/Setting.svelte'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; let loading = false; @@ -25,7 +26,7 @@
-
Configuration
+
{$t('forms.configuration')}
- - + +
- +
- - + +
(payload.isCoolifyProxyUsed = !payload.isCoolifyProxyUsed)} - title="Use Coolify Proxy?" - description="This will install a proxy on the destination to allow you to access your applications and services without any manual configuration (recommended for Docker).

Databases will have their own proxy." + title={$t('destination.use_coolify_proxy')} + description={$t('destination.new.install_proxy')} />
diff --git a/src/routes/new/destination/_RemoteDocker.svelte b/src/routes/new/destination/_RemoteDocker.svelte index 780c66019..d032d77b4 100644 --- a/src/routes/new/destination/_RemoteDocker.svelte +++ b/src/routes/new/destination/_RemoteDocker.svelte @@ -7,6 +7,7 @@ import Explainer from '$lib/components/Explainer.svelte'; import Setting from '$lib/components/Setting.svelte'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; let loading = false; @@ -25,7 +26,7 @@
-
Configuration
+
{$t('forms.configuration')}
- - + +
- +
- - + +
- - + +
- +
Path{$t('forms.path')}