🌎 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

@ -1,87 +1,99 @@
{ {
"404message": "Sorry, the page you are looking for could not be found.", "404message": "Sorry, the page you are looking for could not be found.",
"404title": "Error 404", "404title": "Error 404",
"about": "About", "about": "About",
"action": "Action", "action": "Action",
"add-your-first-track": "Add your first track", "add-your-first-track": "Add your first track",
"application_name": "Lauf für Kaya! - Admin", "application_name": "Lauf für Kaya! - Admin",
"author": "Author", "author": "Author",
"by": "by", "by": "by",
"cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity", "cancel": "Cancel",
"changelog": "Changelog", "cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity",
"count_organizations": "# Organizations", "changelog": "Changelog",
"count_teams": "# Teams", "confirm-delete": "Confirm Delete",
"create-a-new-track": "Create a new Track", "count_organizations": "# Organizations",
"credits": "Credits", "count_teams": "# Teams",
"dashboard-greeting": "hello there", "create": "Create",
"dashboard-title": "Dashboard", "create-a-new-track": "Create a new Track",
"datatable": { "create-user": "Create User",
"search": "🔍 Search...", "credits": "Credits",
"sort_column_ascending": "Sort column ascending", "dashboard-greeting": "hello there",
"sort_column_descending": "Sort column descending", "dashboard-title": "Dashboard",
"previous": "Previous", "datatable": {
"next": "Next", "search": "🔍 Search...",
"page": "Page", "sort_column_ascending": "Sort column ascending",
"showing": "Showing", "sort_column_descending": "Sort column descending",
"records": "Records", "previous": "Previous",
"of": "of", "next": "Next",
"to": "to", "page": "Page",
"loading": "Loading...", "showing": "Showing",
"no_matching_records_found": "No matching records found", "records": "Records",
"an_error_happened_while_fetching_the_data": "An error happened while fetching the data" "of": "of",
}, "to": "to",
"dependency_name": "Name", "loading": "Loading...",
"dont-have-your-email-connected": "Don't have your email connected?", "no_matching_records_found": "No matching records found",
"dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌", "an_error_happened_while_fetching_the_data": "An error happened while fetching the data"
"e-mail-adress": "E-Mail Adress", },
"email_address_or_username": "Email / username", "delete-user": "Delete User",
"error_on_login": "Error on login", "dependency_name": "Name",
"faq": "FAQ", "dont-have-your-email-connected": "Don't have your email connected?",
"forgot_password?": "Forgot your password?", "dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌",
"general-stats": "General Stats", "e-mail-adress": "E-Mail Adress",
"general_promise_error": "😢 Error", "email_address_or_username": "Email / username",
"goback": "Go Home", "error_on_login": "Error on login",
"hallo": "hello", "faq": "FAQ",
"installed-version": "Installed version", "first-name": "First name",
"invalid-mail-reset": "the provided email is invalid", "first-name-is-required": "First 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.", "forgot_password?": "Forgot your password?",
"license": "License", "general-stats": "General Stats",
"log_in": "Log in", "general_promise_error": "😢 Error",
"log_in_to_your_account": "Log in to your account", "goback": "Go Home",
"login_is_checked": "Login is being checked...", "hallo": "hello",
"logout": "Logout", "installed-version": "Installed version",
"mail-validation-in-progress": "mail validation in progress...", "invalid-mail-reset": "the provided email is invalid",
"minimum-lap-time-in-s": "minimum lap time in s", "last-name": "Last name",
"no-license-text-could-be-found": "No license text could be found 😢", "last-name-is-required": "Last Name is required",
"no-tracks-added-yet": "there are no tracks added yet.", "lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.",
"orgs": "Orgs", "license": "License",
"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!", "log_in": "Log in",
"password": "Password", "log_in_to_your_account": "Log in to your account",
"please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.", "login_is_checked": "Login is being checked...",
"profile-picture": "Profile Picture", "logout": "Logout",
"read-license": "Read License", "mail-validation-in-progress": "mail validation in progress...",
"register": "Register", "manage-admin-users": "manage admin users",
"repo_link": "Link", "middle-name": "Middle name",
"reset-my-password": "Reset my password", "minimum-lap-time-in-s": "minimum lap time in s",
"runners": "Runners", "no-license-text-could-be-found": "No license text could be found 😢",
"send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services", "no-tracks-added-yet": "there are no tracks added yet.",
"settings": "Settings", "orgs": "Orgs",
"signout": "Sign out", "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!",
"stats-are-being-loaded": "stats are being loaded...", "password": "Password",
"teams": "Teams", "password-is-required": "Password is required",
"this-might-take-a-moment": "This might take a moment 👀", "please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.",
"total-distance": "total distance", "profile-picture": "Profile Picture",
"total-donations": "total donations", "read-license": "Read License",
"total-scans": "total scans", "register": "Register",
"track-added": "Track added", "repo_link": "Link",
"track-data-is-being-loaded": "Track data is being loaded", "reset-my-password": "Reset my password",
"track-is-being-added": "Track is being added...", "runners": "Runners",
"track-length-in-m": "Track Length in m", "save-changes": "Save Changes",
"track-name": "Track name", "send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services",
"tracks": "Tracks", "settings": "Settings",
"users": "Users", "signout": "Sign out",
"welcome_wavinghand": "Welcome 👋", "stats-are-being-loaded": "stats are being loaded...",
"your_profile": "Your Profile", "teams": "Teams",
"manage-admin-users": "manage admin users", "this-might-take-a-moment": "This might take a moment 👀",
"create-user": "Create User" "total-distance": "total distance",
} "total-donations": "total donations",
"total-scans": "total scans",
"track-added": "Track added",
"track-data-is-being-loaded": "Track data is being loaded",
"track-is-being-added": "Track is being added...",
"track-length-in-m": "Track Length in m",
"track-name": "Track name",
"tracks": "Tracks",
"users": "Users",
"valid-email-is-required": "valid email is required",
"welcome_wavinghand": "Welcome 👋",
"your_profile": "Your Profile"
}