🌎 improved i18n for AddUserModal and UserDetail

ref #12
This commit is contained in:
Philipp Dormann 2021-01-10 14:45:34 +01:00
parent 6012d0577e
commit 1c356a41f5
3 changed files with 128 additions and 112 deletions

View File

@ -136,11 +136,11 @@
<div class="col-span-6"> <div class="col-span-6">
<label <label
for="firstname" for="firstname"
class="block text-sm font-medium text-gray-700">First Name</label> class="block text-sm font-medium text-gray-700">{$_('first-name')}</label>
<input <input
use:focus use:focus
autocomplete="off" autocomplete="off"
placeholder="First Name" placeholder={$_('first-name')}
class:border-red-500={!isFirstnameValid} class:border-red-500={!isFirstnameValid}
class:focus:border-red-500={!isFirstnameValid} class:focus:border-red-500={!isFirstnameValid}
class:focus:ring-red-500={!isFirstnameValid} class:focus:ring-red-500={!isFirstnameValid}
@ -152,17 +152,17 @@
{#if !isFirstnameValid} {#if !isFirstnameValid}
<span <span
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1"> class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
First Name is required {$_('first-name-is-required')}
</span> </span>
{/if} {/if}
</div> </div>
<div class="col-span-6"> <div class="col-span-6">
<label <label
for="trackname" for="trackname"
class="block text-sm font-medium text-gray-700">Middle Name</label> class="block text-sm font-medium text-gray-700">{$_('middle-name')}</label>
<input <input
autocomplete="off" autocomplete="off"
placeholder="Middle Name" placeholder={$_('middle-name')}
bind:value={middlename_input_value} bind:value={middlename_input_value}
bind:this={middlename_input} bind:this={middlename_input}
type="text" type="text"
@ -187,17 +187,17 @@
{#if !isLastnameValid} {#if !isLastnameValid}
<span <span
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1"> class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
Last Name is required {$_('last-name-is-required')}
</span> </span>
{/if} {/if}
</div> </div>
<div class="col-span-6"> <div class="col-span-6">
<label <label
for="password" for="password"
class="block text-sm font-medium text-gray-700">Password</label> class="block text-sm font-medium text-gray-700">{$_('password')}</label>
<input <input
autocomplete="off" autocomplete="off"
placeholder="Password" placeholder={$_('password')}
class:border-red-500={!isPasswordValid} class:border-red-500={!isPasswordValid}
class:focus:border-red-500={!isPasswordValid} class:focus:border-red-500={!isPasswordValid}
class:focus:ring-red-500={!isPasswordValid} class:focus:ring-red-500={!isPasswordValid}
@ -209,17 +209,17 @@
{#if !isPasswordValid} {#if !isPasswordValid}
<span <span
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1"> class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
Password is required {$_('password-is-required')}
</span> </span>
{/if} {/if}
</div> </div>
<div class="col-span-6"> <div class="col-span-6">
<label <label
for="email" for="email"
class="block text-sm font-medium text-gray-700">E-Mail</label> class="block text-sm font-medium text-gray-700">{$_('e-mail-adress')}</label>
<input <input
autocomplete="off" autocomplete="off"
placeholder="E-Mail" placeholder={$_('e-mail-adress')}
class:border-red-500={!isEmailValid} class:border-red-500={!isEmailValid}
class:focus:border-red-500={!isEmailValid} class:focus:border-red-500={!isEmailValid}
class:focus:ring-red-500={!isEmailValid} class:focus:ring-red-500={!isEmailValid}
@ -231,7 +231,7 @@
{#if !isEmailValid} {#if !isEmailValid}
<span <span
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1"> class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
valid email is required {$_('valid-email-is-required')}
</span> </span>
{/if} {/if}
</div> </div>
@ -246,7 +246,7 @@
on:click={submit} on:click={submit}
type="button" type="button"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm"> class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
Create {$_('create')}
</button> </button>
<button <button
on:click={() => { on:click={() => {
@ -254,7 +254,7 @@
}} }}
type="button" type="button"
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
Cancel {$_('cancel')}
</button> </button>
</div> </div>
</div> </div>

View File

@ -79,22 +79,20 @@
<button <button
class="hidden w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-400 text-base font-medium text-white sm:w-auto sm:text-sm" class="hidden w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-400 text-base font-medium text-white sm:w-auto sm:text-sm"
data-userid="${user.id}" data-userid="${user.id}"
onclick="user__delete_cancel()">Cancel</button> onclick="user__delete_cancel()">{$_('cancel')}</button>
<button <button
class="hidden w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-500 text-base font-medium text-white sm:w-auto sm:text-sm" class="hidden w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-500 text-base font-medium text-white sm:w-auto sm:text-sm"
data-userid="${user.id}" data-userid="${user.id}"
onclick="user__delete_confirm()">Confirm Delete</button> onclick="user__delete_confirm()">{$_('confirm-delete')}</button>
<button <button
type="button" type="button"
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">Delete class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-user')}</button>
User</button>
<button <button
disabled={!changes_performed} disabled={!changes_performed}
class:opacity-50={!changes_performed} class:opacity-50={!changes_performed}
type="button" type="button"
on:click={submit} on:click={submit}
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">Save class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('save-changes')}</button>
Changes</button>
</span> </span>
</div> </div>
@ -132,30 +130,36 @@
<p class="text-gray-500">set the user active/ inactive</p> <p class="text-gray-500">set the user active/ inactive</p>
</div> </div>
<div class="text-sm w-full"> <div class="text-sm w-full">
<label for="firstname" class="font-medium text-gray-700">First name</label> <label
for="firstname"
class="font-medium text-gray-700">{$_('first-name')}</label>
<input <input
autocomplete="off" autocomplete="off"
placeholder="First name" placeholder={$_('first-name')}
type="text" type="text"
bind:value={editable_userdata.firstname} bind:value={editable_userdata.firstname}
name="firstname" name="firstname"
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" /> class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
</div> </div>
<div class="text-sm w-full"> <div class="text-sm w-full">
<label for="middlename" class="font-medium text-gray-700">Middle name</label> <label
for="middlename"
class="font-medium text-gray-700">{$_('middle-name')}</label>
<input <input
autocomplete="off" autocomplete="off"
placeholder="Middle name" placeholder={$_('middle-name')}
type="text" type="text"
bind:value={editable_userdata.middlename} bind:value={editable_userdata.middlename}
name="middlename" name="middlename"
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" /> class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
</div> </div>
<div class="text-sm w-full"> <div class="text-sm w-full">
<label for="lastname" class="font-medium text-gray-700">Last name</label> <label
for="lastname"
class="font-medium text-gray-700">{$_('last-name')}</label>
<input <input
autocomplete="off" autocomplete="off"
placeholder="Last name" placeholder={$_('last-name')}
type="text" type="text"
bind:value={editable_userdata.lastname} bind:value={editable_userdata.lastname}
name="lastname" name="lastname"

View File

@ -7,11 +7,15 @@
"application_name": "Lauf für Kaya! - Admin", "application_name": "Lauf für Kaya! - Admin",
"author": "Author", "author": "Author",
"by": "by", "by": "by",
"cancel": "Cancel",
"cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity", "cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity",
"changelog": "Changelog", "changelog": "Changelog",
"confirm-delete": "Confirm Delete",
"count_organizations": "# Organizations", "count_organizations": "# Organizations",
"count_teams": "# Teams", "count_teams": "# Teams",
"create": "Create",
"create-a-new-track": "Create a new Track", "create-a-new-track": "Create a new Track",
"create-user": "Create User",
"credits": "Credits", "credits": "Credits",
"dashboard-greeting": "hello there", "dashboard-greeting": "hello there",
"dashboard-title": "Dashboard", "dashboard-title": "Dashboard",
@ -30,6 +34,7 @@
"no_matching_records_found": "No matching records found", "no_matching_records_found": "No matching records found",
"an_error_happened_while_fetching_the_data": "An error happened while fetching the data" "an_error_happened_while_fetching_the_data": "An error happened while fetching the data"
}, },
"delete-user": "Delete User",
"dependency_name": "Name", "dependency_name": "Name",
"dont-have-your-email-connected": "Don't have your email connected?", "dont-have-your-email-connected": "Don't have your email connected?",
"dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌", "dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
@ -37,6 +42,8 @@
"email_address_or_username": "Email / username", "email_address_or_username": "Email / username",
"error_on_login": "Error on login", "error_on_login": "Error on login",
"faq": "FAQ", "faq": "FAQ",
"first-name": "First name",
"first-name-is-required": "First Name is required",
"forgot_password?": "Forgot your password?", "forgot_password?": "Forgot your password?",
"general-stats": "General Stats", "general-stats": "General Stats",
"general_promise_error": "😢 Error", "general_promise_error": "😢 Error",
@ -44,6 +51,8 @@
"hallo": "hello", "hallo": "hello",
"installed-version": "Installed version", "installed-version": "Installed version",
"invalid-mail-reset": "the provided email is invalid", "invalid-mail-reset": "the provided email is invalid",
"last-name": "Last name",
"last-name-is-required": "Last Name is required",
"lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.", "lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.",
"license": "License", "license": "License",
"log_in": "Log in", "log_in": "Log in",
@ -51,12 +60,15 @@
"login_is_checked": "Login is being checked...", "login_is_checked": "Login is being checked...",
"logout": "Logout", "logout": "Logout",
"mail-validation-in-progress": "mail validation in progress...", "mail-validation-in-progress": "mail validation in progress...",
"manage-admin-users": "manage admin users",
"middle-name": "Middle name",
"minimum-lap-time-in-s": "minimum lap time in s", "minimum-lap-time-in-s": "minimum lap time in s",
"no-license-text-could-be-found": "No license text could be found 😢", "no-license-text-could-be-found": "No license text could be found 😢",
"no-tracks-added-yet": "there are no tracks added yet.", "no-tracks-added-yet": "there are no tracks added yet.",
"orgs": "Orgs", "orgs": "Orgs",
"oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!", "oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!",
"password": "Password", "password": "Password",
"password-is-required": "Password is required",
"please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.", "please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.",
"profile-picture": "Profile Picture", "profile-picture": "Profile Picture",
"read-license": "Read License", "read-license": "Read License",
@ -64,6 +76,7 @@
"repo_link": "Link", "repo_link": "Link",
"reset-my-password": "Reset my password", "reset-my-password": "Reset my password",
"runners": "Runners", "runners": "Runners",
"save-changes": "Save Changes",
"send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services", "send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services",
"settings": "Settings", "settings": "Settings",
"signout": "Sign out", "signout": "Sign out",
@ -80,8 +93,7 @@
"track-name": "Track name", "track-name": "Track name",
"tracks": "Tracks", "tracks": "Tracks",
"users": "Users", "users": "Users",
"valid-email-is-required": "valid email is required",
"welcome_wavinghand": "Welcome 👋", "welcome_wavinghand": "Welcome 👋",
"your_profile": "Your Profile", "your_profile": "Your Profile"
"manage-admin-users": "manage admin users",
"create-user": "Create User"
} }