From 8f58b14629f986c8486f6aa409fa7aa86ee154ef Mon Sep 17 00:00:00 2001 From: Restray Date: Sat, 2 Apr 2022 22:04:50 +0200 Subject: [PATCH] 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')}