Finish routes translations

This commit is contained in:
Restray
2022-04-03 14:14:59 +02:00
parent 360fb5ea37
commit fe787538e3
17 changed files with 195 additions and 111 deletions

View File

@@ -6,6 +6,7 @@
import { onMount } from 'svelte';
import { post } from '$lib/api';
import { browser } from '$app/env';
import { t } from '$lib/translations';
const { id } = $page.params;
let loading = false;
@@ -93,25 +94,25 @@
{#if !source.gitlabApp?.appId}
<form class="grid grid-flow-row gap-2 py-4" on:submit|preventDefault={newApp}>
<div class="grid grid-cols-2 items-center">
<label for="type">GitLab Application Type</label>
<label for="type">{$t('source.gitlab.gitlab_application_type')}</label>
<select name="type" id="type" class="w-96" bind:value={payload.applicationType}>
<option value="user">User owned application</option>
<option value="group">Group owned application</option>
<option value="user">{$t('source.gitlab.user_owned')}</option>
<option value="group">{$t('source.gitlab.group_owned')}</option>
{#if source.htmlUrl !== 'https://gitlab.com'}
<option value="instance">Instance-wide application (self-hosted)</option>
<option value="instance">{$t('source.gitlab.self_hosted')}</option>
{/if}
</select>
</div>
{#if payload.applicationType === 'group'}
<div class="grid grid-cols-2 items-center">
<label for="groupName">Group Name</label>
<label for="groupName">{$t('source.group_name')}</label>
<input name="groupName" id="groupName" required bind:value={payload.groupName} />
</div>
{/if}
<div class="w-full pt-10 text-center">
<button class="w-96 bg-orange-600 hover:bg-orange-500" type="submit"
>Register new OAuth application on GitLab</button
>{$t('source.register_oauth_gitlab')}</button
>
</div>
@@ -131,21 +132,19 @@
</form>
<form on:submit|preventDefault={handleSubmit} class="grid grid-flow-row gap-2 py-4 pt-10">
<div class="flex h-8 items-center space-x-2">
<div class="text-xl font-bold text-white">Configuration</div>
<div class="text-xl font-bold text-white">{$t('forms.configuration')}</div>
<button
type="submit"
class:bg-orange-600={!loading}
class:hover:bg-orange-500={!loading}
disabled={loading}>{loading ? 'Saving...' : 'Save'}</button
disabled={loading}>{loading ? $t('forms.saving') : $t('forms.save')}</button
>
</div>
<div class="grid grid-cols-2 items-start">
<div class="flex-col">
<label for="oauthId" class="pt-2">OAuth ID</label>
<Explainer
text="The OAuth ID is the unique identifier of the GitLab application. <br>You can find it <span class='font-bold text-orange-600' >in the URL</span> of your GitLab OAuth Application."
/>
<label for="oauthId" class="pt-2">{$t('source.oauth_id')}</label>
<Explainer text={$t('source.oauth_id_explainer')} />
</div>
<input
on:change={checkOauthId}
@@ -159,16 +158,16 @@
</div>
{#if payload.applicationType === 'group'}
<div class="grid grid-cols-2 items-center">
<label for="groupName">Group Name</label>
<label for="groupName">{$t('source.group_name')}</label>
<input name="groupName" id="groupName" required bind:value={payload.groupName} />
</div>
{/if}
<div class="grid grid-cols-2 items-center">
<label for="appId">Application ID</label>
<label for="appId">{$t('source.application_id')}</label>
<input name="appId" id="appId" required bind:value={payload.appId} />
</div>
<div class="grid grid-cols-2 items-center">
<label for="appSecret">Secret</label>
<label for="appSecret">{$t('index.secret')}</label>
<input
name="appSecret"
id="appSecret"
@@ -188,9 +187,11 @@
type="submit"
class:bg-orange-600={!loading}
class:hover:bg-orange-500={!loading}
disabled={loading}>{loading ? 'Saving...' : 'Save'}</button
disabled={loading}>{loading ? $t('forms.saving') : $t('forms.save')}</button
>
<button on:click|preventDefault={changeSettings}
>{$t('source.change_app_settings', { name: 'GitLab' })}</button
>
<button on:click|preventDefault={changeSettings}>Change GitLab App Settings</button>
{/if}
</div>
<div class="grid grid-flow-row gap-2 px-10">