From c1251d333298326e25ef7573e14ed24124f621de Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Wed, 17 Feb 2021 19:14:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=8E=20Contacts=20i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #50 --- src/components/ContactDetail.svelte | 36 +-- src/components/ContactOverview.svelte | 164 ---------- src/components/Contacts.svelte | 4 +- src/components/ContactsEmptyState.svelte | 4 +- src/components/ContactsOverview.svelte | 14 +- src/locales/en.json | 382 ++++++++++++----------- 6 files changed, 230 insertions(+), 374 deletions(-) delete mode 100644 src/components/ContactOverview.svelte diff --git a/src/components/ContactDetail.svelte b/src/components/ContactDetail.svelte index 72607f0f..6777bcb0 100644 --- a/src/components/ContactDetail.svelte +++ b/src/components/ContactDetail.svelte @@ -57,10 +57,9 @@ $: iszipcodevalid = editable.address?.postalcode?.trim().length !== 0; $: iscityvalid = editable.address?.city?.trim().length !== 0; function submit() { - // if (data_loaded === true && save_enabled) { Toastify({ - text: "Contact is being updated...", + text: $_("contact-is-being-updated"), duration: 2500, }).showToast(); editable.address.country = "DE"; @@ -78,7 +77,7 @@ original_data = editable; Object.assign(original_data, editable); Toastify({ - text: "Updated contact!", + text: $_("updated-contact"), duration: 2500, backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", }).showToast(); @@ -97,7 +96,7 @@ {#await promise} - Loading contact details... + {$_('loading-contact-details')} {:then}
@@ -163,8 +162,7 @@ delete_triggered = true; }} 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 - Contact + 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-contact')} {/if} {/if} {#if !delete_triggered} @@ -268,7 +266,7 @@ {#if !isPhoneValidOrEmpty} - valid international phone number is required... + {$_('valid-international-phone-number-is-required')} {/if}
@@ -302,14 +300,16 @@ class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
- +
{#if editable.address_checked === true}
+ class="block text-sm font-medium text-gray-700">{$_('address')} - Address is required + {$_('address-is-required')} {/if}
+ class="block text-sm font-medium text-gray-700">{$_('apartment-suite-etc')} + class="block text-sm font-medium text-gray-700">{$_('zip-postal-code')} - Valid zipcode/ postal code is required + {$_('valid-zipcode-postal-code-is-required')} {/if}
+ class="block text-sm font-medium text-gray-700">{$_('city')} - Valid city is required + {$_('valid-city-is-required')} {/if}
diff --git a/src/components/ContactOverview.svelte b/src/components/ContactOverview.svelte deleted file mode 100644 index fe2d25e1..00000000 --- a/src/components/ContactOverview.svelte +++ /dev/null @@ -1,164 +0,0 @@ - - -{#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:GET')} - {#await promise} - - {:then} - {#if contacts.length === 0} - - {:else} - -
- - - - - - - - - - - {#each contacts as t} - {#if Object.values(t) - .toString() - .toLowerCase() - .includes(searchvalue)} - - - - - {#if active_deletes[t.id] === true} - - {:else} - - {/if} - - {/if} - {/each} - -
- Name - - {$_('organization')} - - Contact - - Action -
-
-
-
- {t.name} -
-
-
-
-
-
-
- {#if t.parentGroup} - {t.parentGroup.name} - {:else}no groups{/if} -
-
-
-
-
-
-
- {#if t.contact} - {JSON.stringify(t.contact)} - {:else}no contact specified{/if} -
-
-
-
- - - - Edit - {#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:DELETE')} - - {/if} -
-
- {/if} - {:catch error} -
- - {$_('general_promise_error')} - {error} - -
- {/await} -{/if} diff --git a/src/components/Contacts.svelte b/src/components/Contacts.svelte index 17ae16a4..cfd8fa73 100644 --- a/src/components/Contacts.svelte +++ b/src/components/Contacts.svelte @@ -4,7 +4,7 @@ import AddContactModal from "./AddContactModal.svelte"; import ContactsOverview from "./ContactsOverview.svelte"; export let modal_open = false; - let current_contacts=[]; + let current_contacts = [];
@@ -17,7 +17,7 @@ }} 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"> - Create Contact + {$_('create-a-new-contact')} {/if} diff --git a/src/components/ContactsEmptyState.svelte b/src/components/ContactsEmptyState.svelte index 61ee6e5b..7188c76f 100644 --- a/src/components/ContactsEmptyState.svelte +++ b/src/components/ContactsEmptyState.svelte @@ -9,8 +9,8 @@

- There are no contacts added yet.
- Add your first contact + {$_('there-are-no-contacts-added-yet')}
+ {$_('add-your-first-contact')}

diff --git a/src/components/ContactsOverview.svelte b/src/components/ContactsOverview.svelte index 9ee992e8..6ebeca5f 100644 --- a/src/components/ContactsOverview.svelte +++ b/src/components/ContactsOverview.svelte @@ -93,7 +93,9 @@ {g.name} {/if} {/each} - {:else}no groups{/if} + {:else} + {$_('contact-is-not-a-member-in-any-group')} + {/if} @@ -121,8 +123,7 @@ active_deletes[t.id] = false; }} tabindex="0" - class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">Cancel - Delete + class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')} + class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')} {:else} Edit + class="text-indigo-600 hover:text-indigo-900">{$_('edit')} {#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:DELETE')} + class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')} {/if} {/if} diff --git a/src/locales/en.json b/src/locales/en.json index e720e8ee..6af67984 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,182 +1,202 @@ { - "404message": "Sorry, the page you are looking for could not be found.", - "404title": "Error 404", - "about": "About", - "action": "Action", - "add-your-first-track": "Add your first track", - "address": "Address", - "application_name": "Lauf fΓΌr Kaya! - Admin", - "author": "Author", - "bitte-bestaetige-diese-laeufer-fuer-den-import": "Please confirm these runners for import", - "browse": "Browse", - "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", - "changelog": "Changelog", - "close": "Close", - "confirm-delete": "Confirm Delete", - "confirm-deletion": "Confirm Deletion", - "contact": "Contact", - "contact-information": "Contact Information", - "count_organizations": "# Organizations", - "count_teams": "# Teams", - "create": "Create", - "create-a-new-runner": "Create a new Runner", - "create-a-new-track": "Create a new Track", - "create-organization": "Create Organization", - "create-user": "Create User", - "credits": "Credits", - "csv_import__class": "Class", - "csv_import__firstname": "Firstname", - "csv_import__lastname": "Lastname", - "csv_import__middlename": "Middlename", - "csv_import__team": "Team", - "dashboard-greeting": "hello there", - "dashboard-title": "Dashboard", - "datatable": { - "search": "πŸ” Search...", - "sort_column_ascending": "Sort column ascending", - "sort_column_descending": "Sort column descending", - "previous": "Previous", - "next": "Next", - "page": "Page", - "showing": "Showing", - "records": "Records", - "of": "of", - "to": "to", - "loading": "Loading...", - "no_matching_records_found": "No matching records found", - "an_error_happened_while_fetching_the_data": "An error happened while fetching the data" - }, - "delete": "Delete", - "delete-organization": "Delete Organization", - "delete-runner": "Delete Runner", - "delete-team": "Delete Team", - "delete-user": "Delete User", - "dependency_name": "Name", - "distance": "Distance", - "distance-in-km": "Distance in km", - "dont-have-your-email-connected": "Don't have your email connected?", - "dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌", - "drag-and-drop-your-files-or": "Drag & Drop your files or", - "e-mail-adress": "E-Mail Adress", - "edit-permissions": "edit permissions", - "email_address_or_username": "Email / username", - "error_on_login": "Error on login", - "faq": "FAQ", - "filepond__abort": "Abort", - "filepond__cancel": "Cancel", - "filepond__error-during-load": "Error during load", - "filepond__error-during-remove": "Error during remove", - "filepond__error-during-revert": "Error during revert", - "filepond__error-during-upload": "Error during upload", - "filepond__field-contains-invalid-files": "Field contains invalid files", - "filepond__loading": "Loading", - "filepond__remove": "Remove", - "filepond__retry": "Retry", - "filepond__size-not-available": "Size not available", - "filepond__tap-to-cancel": "tap to cancel", - "filepond__tap-to-retry": "tap to retry", - "filepond__tap-to-undo": "tap to undo", - "filepond__undo": "Undo", - "filepond__upload": "Upload", - "filepond__upload-cancelled": "Upload cancelled", - "filepond__upload-complete": "Upload complete", - "filepond__uploading": "Uploading", - "filepond__waiting-for-size": "Waiting for size", - "first-name": "First name", - "first-name-is-required": "First Name is required", - "forgot_password?": "Forgot your password?", - "general-stats": "General Stats", - "general_promise_error": "😒 Error", - "go-to-login": "Go To Login", - "goback": "Go Home", - "group": "Group", - "groups": "Groups", - "hallo": "hello", - "icon-image-credits": "We also want to thank these projects for illustrations and icons:", - "import-runners": "Import runners", - "import__target-organization": "Target Organization", - "imprint": "Imprint 🧾", - "imprint-loading": "Imprint loading...", - "installed-version": "Installed version", - "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.", - "license": "License", - "licenses-are-being-loaded": "Licenses are being loaded...", - "loading-runners": "loading runners...", - "log_in": "Log in", - "log_in_to_your_account": "Log in to your account", - "login_is_checked": "Login is being checked...", - "logout": "Logout", - "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", - "name": "Name", - "new-password": "New password", - "no-license-text-could-be-found": "No license text could be found 😒", - "no-tracks-added-yet": "there are no tracks added yet.", - "organization": "Organization", - "organizations": "Organizations", - "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!", - "password": "Password", - "password-is-required": "Password is required", - "password-reset-failed": "Password reset failed!", - "password-reset-in-progress": "Password Reset in Progress...", - "password-reset-successful": "Password Reset successful!", - "permissions": "Permissions", - "phone": "Phone", - "please-provide-a-password": "Please provide a password...", - "please-provide-the-required-csv-xlsx-file": "Please provide the required csv/ xlsx file", - "please-provide-the-required-information-to-add-a-new-runner": "Please provide the required information to add a new runner.", - "please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.", - "please-request-a-new-reset-mail": "Please request a new reset mail...", - "privacy": "Privacy πŸ”’", - "privacy-loading": "Privacy loading...", - "profile-picture": "Profile Picture", - "read-license": "Read License", - "register": "Register", - "repo_link": "Link", - "request-a-new-reset-mail": "Request a new reset mail", - "reset-my-password": "Reset my password", - "reset-password": "Reset your password", - "runner-import": "Runner Import", - "runner-updated": "Runner updated!", - "runnerimport_verify_runners_org": "Please confirm these runners for import into the organization \"{org_name}\"", - "runners": "Runners", - "save-changes": "Save Changes", - "send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services", - "settings": "Settings", - "signout": "Sign out", - "stats-are-being-loaded": "stats are being loaded...", - "successful-password-reset": "Successful password reset!", - "team": "Team", - "team-name": "Team name", - "teams": "Teams", - "the-provided-phone-number-is-invalid-less-than-br-greater-than-please-enter-a-valid-international-number": "the provided phone number is invalid.
please enter a valid international number...", - "this-might-take-a-moment": "This might take a moment πŸ‘€", - "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", - "updating-runner": "Updating runner...", - "updating-user": "updating user...", - "user-updated": "User updated", - "username": "Username", - "users": "Users", - "valid-email-is-required": "valid email is required", - "welcome_wavinghand": "Welcome πŸ‘‹", - "you-can-now-use-your-new-password-to-log-in-to-your-account": "You can now use your new password to log in to your account! πŸŽ‰", - "your_profile": "Your Profile", - "contacts": "Contacts", - "create-a-new-contact": "Create a new contact" -} + "404message": "Sorry, the page you are looking for could not be found.", + "404title": "Error 404", + "about": "About", + "action": "Action", + "add-your-first-contact": "Add your first contact", + "add-your-first-track": "Add your first track", + "address": "Address", + "address-is-required": "Address is required", + "apartment-suite-etc": "Apartment, suite, etc.", + "application_name": "Lauf fΓΌr Kaya! - Admin", + "attention": "Attention!", + "author": "Author", + "bitte-bestaetige-diese-laeufer-fuer-den-import": "Please confirm these runners for import", + "browse": "Browse", + "by": "by", + "cancel": "Cancel", + "cancel-delete": "Cancel Delete", + "cancel-keep-team": "Cancel, keep team", + "cannot-reset-your-password-directly": "Bummer. We unfortunately cannot reset your password directly. Please send us a mail and confirm your identity", + "changelog": "Changelog", + "city": "City", + "close": "Close", + "confirm-delete": "Confirm Delete", + "confirm-delete-team-and-associated-runners": "Confirm, delete team and associated runners.", + "confirm-deletion": "Confirm Deletion", + "contact": "Contact", + "contact-information": "Contact Information", + "contact-is-being-updated": "Contact is being updated...", + "contact-is-not-a-member-in-any-group": "Contact is not a member in any group", + "contacts": "Contacts", + "count_organizations": "# Organizations", + "count_teams": "# Teams", + "create": "Create", + "create-a-new-contact": "Create a new contact", + "create-a-new-runner": "Create a new Runner", + "create-a-new-track": "Create a new Track", + "create-organization": "Create Organization", + "create-user": "Create User", + "credits": "Credits", + "csv_import__class": "Class", + "csv_import__firstname": "Firstname", + "csv_import__lastname": "Lastname", + "csv_import__middlename": "Middlename", + "csv_import__team": "Team", + "dashboard-greeting": "hello there", + "dashboard-title": "Dashboard", + "datatable": { + "search": "πŸ” Search...", + "sort_column_ascending": "Sort column ascending", + "sort_column_descending": "Sort column descending", + "previous": "Previous", + "next": "Next", + "page": "Page", + "showing": "Showing", + "records": "Records", + "of": "of", + "to": "to", + "loading": "Loading...", + "no_matching_records_found": "No matching records found", + "an_error_happened_while_fetching_the_data": "An error happened while fetching the data" + }, + "delete": "Delete", + "delete-contact": "Delete Contact", + "delete-organization": "Delete Organization", + "delete-runner": "Delete Runner", + "delete-team": "Delete Team", + "delete-user": "Delete User", + "dependency_name": "Name", + "distance": "Distance", + "distance-in-km": "Distance in km", + "dont-have-your-email-connected": "Don't have your email connected?", + "dont-panic-were-resetting-it": "Don't panic, we're resetting it ✌", + "drag-and-drop-your-files-or": "Drag & Drop your files or", + "e-mail-adress": "E-Mail Adress", + "edit": "Edit", + "edit-permissions": "edit permissions", + "email_address_or_username": "Email / username", + "error_on_login": "Error on login", + "faq": "FAQ", + "filepond__abort": "Abort", + "filepond__cancel": "Cancel", + "filepond__error-during-load": "Error during load", + "filepond__error-during-remove": "Error during remove", + "filepond__error-during-revert": "Error during revert", + "filepond__error-during-upload": "Error during upload", + "filepond__field-contains-invalid-files": "Field contains invalid files", + "filepond__loading": "Loading", + "filepond__remove": "Remove", + "filepond__retry": "Retry", + "filepond__size-not-available": "Size not available", + "filepond__tap-to-cancel": "tap to cancel", + "filepond__tap-to-retry": "tap to retry", + "filepond__tap-to-undo": "tap to undo", + "filepond__undo": "Undo", + "filepond__upload": "Upload", + "filepond__upload-cancelled": "Upload cancelled", + "filepond__upload-complete": "Upload complete", + "filepond__uploading": "Uploading", + "filepond__waiting-for-size": "Waiting for size", + "first-name": "First name", + "first-name-is-required": "First Name is required", + "forgot_password?": "Forgot your password?", + "general-stats": "General Stats", + "general_promise_error": "😒 Error", + "go-to-login": "Go To Login", + "goback": "Go Home", + "group": "Group", + "groups": "Groups", + "hallo": "hello", + "icon-image-credits": "We also want to thank these projects for illustrations and icons:", + "import-runners": "Import runners", + "import__target-organization": "Target Organization", + "imprint": "Imprint 🧾", + "imprint-loading": "Imprint loading...", + "installed-version": "Installed version", + "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.", + "license": "License", + "licenses-are-being-loaded": "Licenses are being loaded...", + "loading-contact-details": "Loading contact details...", + "loading-runners": "loading runners...", + "log_in": "Log in", + "log_in_to_your_account": "Log in to your account", + "login_is_checked": "Login is being checked...", + "logout": "Logout", + "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", + "name": "Name", + "new-password": "New password", + "no-license-text-could-be-found": "No license text could be found 😒", + "no-tracks-added-yet": "there are no tracks added yet.", + "organization": "Organization", + "organizations": "Organizations", + "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!", + "password": "Password", + "password-is-required": "Password is required", + "password-reset-failed": "Password reset failed!", + "password-reset-in-progress": "Password Reset in Progress...", + "password-reset-successful": "Password Reset successful!", + "permissions": "Permissions", + "phone": "Phone", + "please-provide-a-password": "Please provide a password...", + "please-provide-the-required-csv-xlsx-file": "Please provide the required csv/ xlsx file", + "please-provide-the-required-information-to-add-a-new-runner": "Please provide the required information to add a new runner.", + "please-provide-the-required-information-to-add-a-new-track": "Please provide the required information to add a new track.", + "please-request-a-new-reset-mail": "Please request a new reset mail...", + "privacy": "Privacy πŸ”’", + "privacy-loading": "Privacy loading...", + "profile-picture": "Profile Picture", + "read-license": "Read License", + "register": "Register", + "repo_link": "Link", + "request-a-new-reset-mail": "Request a new reset mail", + "reset-my-password": "Reset my password", + "reset-password": "Reset your password", + "runner-import": "Runner Import", + "runner-updated": "Runner updated!", + "runnerimport_verify_runners_org": "Please confirm these runners for import into the organization \"{org_name}\"", + "runners": "Runners", + "save-changes": "Save Changes", + "send-a-mail-to-lfk-odit-services": "send a mail to lfk@odit.services", + "settings": "Settings", + "signout": "Sign out", + "stats-are-being-loaded": "stats are being loaded...", + "successful-password-reset": "Successful password reset!", + "team": "Team", + "team-name": "Team name", + "teams": "Teams", + "teams-are-being-loaded": "Teams are being loaded...", + "the-provided-phone-number-is-invalid-less-than-br-greater-than-please-enter-a-valid-international-number": "the provided phone number is invalid.
please enter a valid international number...", + "there-are-no-contacts-added-yet": "There are no contacts added yet.", + "this-might-take-a-moment": "This might take a moment πŸ‘€", + "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", + "updated-contact": "Updated contact!", + "updating-runner": "Updating runner...", + "updating-user": "updating user...", + "user-updated": "User updated", + "username": "Username", + "users": "Users", + "valid-city-is-required": "Valid city is required", + "valid-email-is-required": "valid email is required", + "valid-international-phone-number-is-required": "valid international phone number is required...", + "valid-zipcode-postal-code-is-required": "Valid zipcode/ postal code is required", + "welcome_wavinghand": "Welcome πŸ‘‹", + "you-can-now-use-your-new-password-to-log-in-to-your-account": "You can now use your new password to log in to your account! πŸŽ‰", + "your_profile": "Your Profile", + "zip-postal-code": "ZIP/ postal code" +} \ No newline at end of file