From 196b386d6d57e91fbb4f46091a59ba04bb6e6984 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Mon, 2 Dec 2024 11:31:24 +0100 Subject: [PATCH] refactor: translations --- order_i18n.js | 18 +++---- src/locales/de.json | 112 ++++++++++++++++++++------------------------ src/locales/en.json | 112 ++++++++++++++++++++------------------------ 3 files changed, 114 insertions(+), 128 deletions(-) diff --git a/order_i18n.js b/order_i18n.js index 1120c86..b8a5cfe 100644 --- a/order_i18n.js +++ b/order_i18n.js @@ -1,16 +1,18 @@ -const fs = require('fs'); +import { readdirSync, readFileSync, writeFileSync } from "node:fs"; // get all language files -const files = fs.readdirSync('./src/locales/'); +const files = readdirSync("./src/locales/"); files.forEach((f) => { // read file as object - const unordered = JSON.parse(fs.readFileSync(`src/locales/${f}`)); + const unordered = JSON.parse(readFileSync(`src/locales/${f}`)); // order object by keys alpabetically A-Z - const ordered = Object.keys(unordered).sort().reduce((obj, key) => { - obj[key] = unordered[key]; - return obj; - }, {}); + const ordered = Object.keys(unordered) + .sort() + .reduce((obj, key) => { + obj[key] = unordered[key]; + return obj; + }, {}); // format output as json for commit diff compatibility const out = JSON.stringify(ordered, 0, 4); // write output file - fs.writeFileSync(`src/locales/${f}`, out); + writeFileSync(`src/locales/${f}`, out); }); diff --git a/src/locales/de.json b/src/locales/de.json index c605029..a34b48f 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1,61 +1,53 @@ { - "access_is_only_provided_via_your_email_link": "Der Zugang erfolgt über den Link, den Sie bei der Registrierung erhalten haben.", - "already_have_an_account": "Sie haben bereits einen Account?", - "amount_per_kilometer_in_eur": "Betrag pro Kilometer (in €)", - "apartment_suite_etc": "Addresszeile 2", - "cancel_keep_my_data": "Abbrechen, meine Daten behalten", - "configuration_error": "Konfigurationsfehler", - "confirm_delete_all_of_my_data": "Bestätigen, meine Daten löschen", - "confirm_personal_data": "Hiermit bestätige ich die Vollständigkeit und Richtigkeit der oben genannten Angaben", - "current_total_amount_in_eur": "Aktueller Gesamtbetrag (in €)", - "delete_all_of_my_data": "Meine gesamten Daten löschen", - "delete_my_data": "Meine Daten löschen", - "deletion_in_progress": "Daten werden gelöscht...", - "distance": "Distanz", - "download_certificate": "Urkunde herunterladen", - "download_registrationcode": "Registrierungscode herunterladen", - "e_mail_adress": "E-Mail Adresse", - "go_to_login": "Zum Login", - "i_accept": "Ich habe die ", - "i_accept_end": "gelesen und akzeptiert.", - "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "Wenn Sie der Systemadministrator sind, finden Sie Konfigurationsanweisungen in der offiziellen Produktdokumentation / README.", - "imprint": "Impressum", - "lap_time": "Rundenzeit", - "lap_times": "Rundenzeiten", - "lost_your_registration_mail": "Brauchen Sie einen neuen Login-Link?", - "main_page_text": "Hier können Sie sich für den Lauf Für Kaya! registrieren oder ihr Läuferprofil verwalten.", - "mittelname": "Mittelname", - "nachname": "Nachname", - "no_laps_scans_were_recorded_yet": "Es wurden noch keine Runden / Scans aufgezeichnet ...", - "no_sponsorings_for_you_were_recorded_yet": "Es gibt noch keine Sponsorings für dich", - "not_registered_yet": "Noch nicht registriert?", - "organization": "Organisation", - "ort": "Ort", - "phone_number": "Telefonnummer", - "please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...", - "please_provide_valid_mail": "Bitte geben Sie eine gültige E-Mail Adresse an", - "plz": "PLZ", - "privacy_policy": "Datenschutzerklärung", - "profile": "Profil", - "provide_address": "Adresse angeben?", - "register": { - "register_now": "Jetzt für den Lauf für Kaya! 2025 registrieren." - }, - "register_now": "Jetzt registrieren!", - "register_now_small": "Jetzt registrieren", - "registrieren": "Registrieren", - "resend_the_registration_mail": "Login-Link anfordern", - "save_changes": "Änderungen speichern", - "sponsoring": "Sponsoring", - "strasse": "Straße", - "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "Das System ist nicht richtig konfiguriert. Bitte wenden Sie sich an den Systemadministrator, um Hilfe zu erhalten.", - "this_is_not_a_valid_international_phone_number": "Dies ist keine gültige internationale Telefonnummer", - "tos": "AGBs", - "total": "Gesamt", - "view_my_data": "Meine Läuferdaten einsehen", - "vorname": "Vorname", - "you_have_been_registered": "Sie wurden registriert!", - "you_have_not_provided_a_valid_access_key": "Sie haben keinen gültigen Zugangsschlüssel angegeben...", - "registrationcode": "Registrierungscode", - "all_data_deleted": "Alle Daten gelöscht!" -} + "access_is_only_provided_via_your_email_link": "Der Zugang erfolgt über den Link, den Sie bei der Registrierung erhalten haben.", + "amount_per_kilometer_in_eur": "Betrag pro Kilometer (in €)", + "apartment_suite_etc": "Addresszeile 2", + "cancel_keep_my_data": "Abbrechen, meine Daten behalten", + "configuration_error": "Konfigurationsfehler", + "confirm_delete_all_of_my_data": "Bestätigen, meine Daten löschen", + "confirm_personal_data": "Hiermit bestätige ich die Vollständigkeit und Richtigkeit der oben genannten Angaben", + "current_total_amount_in_eur": "Aktueller Gesamtbetrag (in €)", + "delete_my_data": "Meine Daten löschen", + "distance": "Distanz", + "download_certificate": "Urkunde herunterladen", + "download_registrationcode": "Registrierungscode herunterladen", + "e_mail_adress": "E-Mail Adresse", + "i_accept": "Ich habe die ", + "i_accept_end": "gelesen und akzeptiert.", + "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "Wenn Sie der Systemadministrator sind, finden Sie Konfigurationsanweisungen in der offiziellen Produktdokumentation / README.", + "imprint": "Impressum", + "lap_time": "Rundenzeit", + "lap_times": "Rundenzeiten", + "lost_your_registration_mail": "Brauchen Sie einen neuen Login-Link?", + "main_page_text": "Hier können Sie sich für den Lauf Für Kaya! registrieren oder ihr Läuferprofil verwalten.", + "mittelname": "Mittelname", + "nachname": "Nachname", + "no_laps_scans_were_recorded_yet": "Es wurden noch keine Runden / Scans aufgezeichnet ...", + "no_sponsorings_for_you_were_recorded_yet": "Es gibt noch keine Sponsorings für dich", + "not_registered_yet": "Noch nicht registriert?", + "organization": "Organisation", + "ort": "Ort", + "phone_number": "Telefonnummer", + "please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...", + "please_provide_valid_mail": "Bitte geben Sie eine gültige E-Mail Adresse an", + "plz": "PLZ", + "privacy_policy": "Datenschutzerklärung", + "profile": "Profil", + "provide_address": "Adresse angeben?", + "register": { + "register_now": "Jetzt für den Lauf für Kaya! 2025 registrieren." + }, + "register_now": "Jetzt registrieren!", + "register_now_small": "Jetzt registrieren", + "registrationcode": "Registrierungscode", + "registrieren": "Registrieren", + "resend_the_registration_mail": "Login-Link anfordern", + "sponsoring": "Sponsoring", + "strasse": "Straße", + "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "Das System ist nicht richtig konfiguriert. Bitte wenden Sie sich an den Systemadministrator, um Hilfe zu erhalten.", + "this_is_not_a_valid_international_phone_number": "Dies ist keine gültige internationale Telefonnummer", + "total": "Gesamt", + "view_my_data": "Meine Läuferdaten einsehen", + "vorname": "Vorname", + "you_have_not_provided_a_valid_access_key": "Sie haben keinen gültigen Zugangsschlüssel angegeben..." +} \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 52bec54..74c257a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,61 +1,53 @@ { - "access_is_only_provided_via_your_email_link": "Access is only provided via the link you received upon registration.", - "all_data_deleted": "All Data deleted!", - "already_have_an_account": "Already have an account?", - "amount_per_kilometer_in_eur": "Amount per kilometer (in €)", - "apartment_suite_etc": "Apartment, suite, etc.", - "cancel_keep_my_data": "Cancel, keep my data", - "configuration_error": "Configuration error", - "confirm_delete_all_of_my_data": "Confirm, delete all of my data", - "confirm_personal_data": "I hereby confirm that the above information is complete and correct", - "current_total_amount_in_eur": "Current total amount (in €)", - "delete_my_data": "Delete my data", - "deletion_in_progress": "Deletion in progress...", - "distance": "Distance", - "download_certificate": "Download certificate", - "download_registrationcode": "Download registrationcode", - "e_mail_adress": "mail address", - "go_to_login": "Go To Login", - "i_accept": "I have read and accepted the ", - "i_accept_end": "", - "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", - "imprint": "Imprint", - "lap_time": "Lap time", - "lap_times": "Lap times", - "lost_your_registration_mail": "Lost your registration mail?", - "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", - "mittelname": "Middlename", - "nachname": "Lastname", - "no_laps_scans_were_recorded_yet": "No laps/ scans were recorded yet...", - "no_sponsorings_for_you_were_recorded_yet": "No sponsorings for you were recorded yet...", - "not_registered_yet": "Not registered yet?", - "organization": "Organization", - "ort": "City", - "phone_number": "Phone Number", - "please_provide_a_valid_zipcode": "Please provide a valid zipcode...", - "please_provide_valid_mail": "Please provide a valid mail address.", - "plz": "zipcode", - "privacy_policy": "Privacy Policy", - "profile": "Profile", - "provide_address": "Provide a postal address?", - "register": { - "register_now": "Register now for Lauf für Kaya! 2025." - }, - "register_now": "Register now!", - "register_now_small": "Register now", - "registrieren": "Register Now", - "resend_the_registration_mail": "Send me a login link", - "save_changes": "Save changes", - "sponsoring": "Sponsoring", - "strasse": "Street/ Block", - "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", - "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", - "tos": "Terms of Service", - "total": "Total", - "view_my_data": "View my data", - "vorname": "Firstname", - "you_have_been_registered": "You have been registered!", - "you_have_not_provided_a_valid_access_key": "You have not provided a valid access key...", - "delete_all_of_my_data": "Delete all of my data", - "registrationcode": "Registration Code" -} + "access_is_only_provided_via_your_email_link": "Access is only provided via the link you received upon registration.", + "amount_per_kilometer_in_eur": "Amount per kilometer (in €)", + "apartment_suite_etc": "Apartment, suite, etc.", + "cancel_keep_my_data": "Cancel, keep my data", + "configuration_error": "Configuration error", + "confirm_delete_all_of_my_data": "Confirm, delete all of my data", + "confirm_personal_data": "I hereby confirm that the above information is complete and correct", + "current_total_amount_in_eur": "Current total amount (in €)", + "delete_my_data": "Delete my data", + "distance": "Distance", + "download_certificate": "Download certificate", + "download_registrationcode": "Download registrationcode", + "e_mail_adress": "mail address", + "i_accept": "I have read and accepted the ", + "i_accept_end": "", + "if_you_are_the_system_administrator_please_refer_to_the_official_product_documentation_readme_for_configuration_guidance": "If you are the system administrator, please refer to the official product documentation/ README for configuration guidance.", + "imprint": "Imprint", + "lap_time": "Lap time", + "lap_times": "Lap times", + "lost_your_registration_mail": "Lost your registration mail?", + "main_page_text": "Here you can register for the Lauf Für Kaya! or manage your runner profile.", + "mittelname": "Middlename", + "nachname": "Lastname", + "no_laps_scans_were_recorded_yet": "No laps/ scans were recorded yet...", + "no_sponsorings_for_you_were_recorded_yet": "No sponsorings for you were recorded yet...", + "not_registered_yet": "Not registered yet?", + "organization": "Organization", + "ort": "City", + "phone_number": "Phone Number", + "please_provide_a_valid_zipcode": "Please provide a valid zipcode...", + "please_provide_valid_mail": "Please provide a valid mail address.", + "plz": "zipcode", + "privacy_policy": "Privacy Policy", + "profile": "Profile", + "provide_address": "Provide a postal address?", + "register": { + "register_now": "Register now for Lauf für Kaya! 2025." + }, + "register_now": "Register now!", + "register_now_small": "Register now", + "registrationcode": "Registration Code", + "registrieren": "Register Now", + "resend_the_registration_mail": "Send me a login link", + "sponsoring": "Sponsoring", + "strasse": "Street/ Block", + "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", + "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", + "total": "Total", + "view_my_data": "View my data", + "vorname": "Firstname", + "you_have_not_provided_a_valid_access_key": "You have not provided a valid access key..." +} \ No newline at end of file