Skip to content

Commit

Permalink
feat: Extra items for translation (#62)
Browse files Browse the repository at this point in the history
* Load the new account theme for reference

Signed-off-by: John Gomersall <[email protected]>

* Get messages from new theme

Signed-off-by: John Gomersall <[email protected]>

* Styling fixes

Signed-off-by: John Gomersall <[email protected]>

* Mention properties that we use

Signed-off-by: John Gomersall <[email protected]>

* Existing keycloak translations for fields we use

Signed-off-by: John Gomersall <[email protected]>

* Dummy language xx for seeing missed translations

Signed-off-by: John Gomersall <[email protected]>

* Combining translations with languages and countries

---------

Signed-off-by: John Gomersall <[email protected]>
Co-authored-by: Open Food Facts Bot <[email protected]>
  • Loading branch information
john-gom and Open Food Facts Bot authored Aug 23, 2024
1 parent b92a612 commit 9904493
Show file tree
Hide file tree
Showing 268 changed files with 9,776 additions and 17 deletions.
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,25 @@ test:
# We keep a copy of the Keycloak themes in our own source control so that we can easily see diffs after keycloak upgrades.
# These themese aren't actually used in the deployment, they are just for reference
refresh_themes:
wget https://github.com/keycloak/keycloak/releases/download/${KEYCLOAK_VERSION}/keycloak-${KEYCLOAK_VERSION}.tar.gz
tar -xzvf keycloak-${KEYCLOAK_VERSION}.tar.gz keycloak-${KEYCLOAK_VERSION}/lib/lib/main/org.keycloak.keycloak-themes-${KEYCLOAK_VERSION}.jar --strip-components=4
rm -rf theme/base
rm -rf theme/keycloak
rm -rf theme/keycloak.v2
wget https://github.com/keycloak/keycloak/releases/download/${KEYCLOAK_VERSION}/keycloak-${KEYCLOAK_VERSION}.tar.gz

tar -xzvf keycloak-${KEYCLOAK_VERSION}.tar.gz keycloak-${KEYCLOAK_VERSION}/lib/lib/main/org.keycloak.keycloak-themes-${KEYCLOAK_VERSION}.jar --strip-components=4
jar xf org.keycloak.keycloak-themes-${KEYCLOAK_VERSION}.jar theme
rm keycloak-${KEYCLOAK_VERSION}.tar.gz
rm org.keycloak.keycloak-themes-${KEYCLOAK_VERSION}.jar

tar -xzvf keycloak-${KEYCLOAK_VERSION}.tar.gz keycloak-${KEYCLOAK_VERSION}/lib/lib/main/org.keycloak.keycloak-account-ui-${KEYCLOAK_VERSION}.jar --strip-components=4
jar xf org.keycloak.keycloak-account-ui-${KEYCLOAK_VERSION}.jar theme
rm org.keycloak.keycloak-account-ui-${KEYCLOAK_VERSION}.jar

rm keycloak-${KEYCLOAK_VERSION}.tar.gz

$(MAKE) refresh_messages

# This will find any existing Keycloak translations for messages defined in the messages_en file
refresh_messages:
node build-scripts/refresh_messages.mjs

# Called by other projects to start this project as a dependency
Expand Down
4 changes: 4 additions & 0 deletions build-scripts/build_languages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ fetch('https://static.openfoodfacts.org/data/taxonomies/languages.json').then(as
// Currently sort countries by english name until keycloak supports sorting by localized name
const sortedCountryCodes = Object.entries(countryList).sort((a,b) => a[1].localeCompare(b[1])).map((entry) => entry[0]);
const sortedLanguageCodes = Object.entries(languageList).sort((a,b) => a[1].localeCompare(b[1])).map((entry) => entry[0]);

// Add dummy language to show property names
sortedLanguageCodes.push('xx');

const realmSettings = {
supportedLocales: sortedLanguageCodes
}
Expand Down
24 changes: 23 additions & 1 deletion build-scripts/refresh_messages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const offMessagesDir = `src/messages`;
const enMessages = [];
const allKeycloakMessages = {};
const themeTypes = ['login', 'account', 'admin', 'email'];
const sourceThemes = ['base', 'keycloak', 'keycloak.v2'];
const sourceThemes = ['base', 'keycloak', 'keycloak.v2', 'keycloak.v3'];

const sourceFile = `${offMessagesDir}/messages_en.properties`;
enMessages.push(...readFileSync(sourceFile, 'utf-8').split('\n'));
Expand Down Expand Up @@ -47,3 +47,25 @@ for (const [code, keycloakMessages] of Object.entries(allKeycloakMessages)) {
}
writeFileSync(existingMessageFile, existingMessages.join('\n'));
}

// Create a test message file that includes all keycloak messages marked with * if we haven't listed them
const xxMessages = ['# The following are used for translation test purposes',
'# If items surrounded by ** appear in the UI then we need to add that property into the',
'# messages_en file so that translations can be done in Crowdin'];

// First add all the messages we've identified
for (const message of enMessages) {
const parts = message.split('=');
xxMessages.push(parts.length > 1 ? `${parts[0]}=[${parts[0]}]` : message);
}

// Then add any keycloak ones that we don't already list
xxMessages.push("# The following Keycloak messages won't be picked up by Crowdin");
for (const message of allKeycloakMessages.en) {
const parts = message.split('=');
if (parts.length < 2) continue;
const messageSearch = `${parts[0]}=`;
if (!enMessages.find(m => m.startsWith(messageSearch))) xxMessages.push(`${parts[0]}=[*${parts[0]}*]`);
}

writeFileSync('theme/off/common/messages/messages_xx.properties', xxMessages.join('\n'));
3 changes: 2 additions & 1 deletion runtime-scripts/realm_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"cr",
"ko",
"ja",
"zh"
"zh",
"xx"
]
}
79 changes: 79 additions & 0 deletions src/messages/messages_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,82 @@ name=اﻹسم
username-before=Your username will appear on all contributions you make and cannot be changed
username-after=Usernames must be between 2 and 20 characters and can only contain numbers and letters


loginAccountTitle=تسجيل الدخول إلى حسابك
usernameOrEmail=اسم المستخدم أو البريد الإلكتروني
password=كلمة المرور
doForgotPassword=نسيت كلمة المرور؟
doLogIn=تسجيل دخول
noAccount=مستخدم جديد؟
invalidUserMessage=اسم المستخدم أو كلمة مرور غير صالحة.
registerTitle=تسجيل
backToLogin=&raquo; العودة إلى تسجيل الدخول
requiredFields=الحقول المطلوبة
username=اسم المستخدم
passwordConfirm=تأكيد كلمة المرور
email=البريد الإلكتروني
country=الدولة
missingUsernameMessage=الرجاء تحديد اسم المستخدم.
missingPasswordMessage=الرجاء تحديد كلمة المرور.
missingEmailMessage=الرجاء تحديد البريد الإلكتروني.
error-invalid-value=قيمة غير صالحة.
error-pattern-no-match=قيمة غير صالحة.
invalidPasswordMinLengthMessage=كلمة المرور غير صالحة: الحد الأدنى للطول {0}.
invalidPasswordConfirmMessage=تأكيد كلمة المرور غير متطابق.
usernameExistsMessage=اسم المستخدم مستخدم مسبقًا.
emailExistsMessage=البريد الإلكتروني مستخدم مسبقًا.
invalidEmailMessage=البريد الإلكتروني غير صالح.
doSignOut=تسجيل خروج
signOut=تسجيل خروج
personalInfo=البيانات الشخصية:
personalSubMessage=قم بإدارة البيانات الأساسية الخاصة بك.
selectALocale=اختر لغة
doSave=حفظ
save=حفظ
doCancel=إلغاء
cancel=إلغاء
deleteAccount=تأكيد حذف الحساب
deleteAccountWarning=هذا أمر لا رجوع فيه. سيتم إتلاف جميع بياناتك بشكل دائم، ولا يمكن استرجاعها.
delete=حذف
accountSecurity=أمان الحساب
signingIn=عملية تسجيل الدخول
signingInDescription=إعداد طرق تسجيل الدخول.
basic-authentication=مصادقة أساسية
password-help-text=سجل الدخول باستخدام كلمة المرور.
credentialCreatedAt=<0>أنشئ في</0> {{date}}.
update=تحديث
two-factor=التحقق بخطوتين
otp-display-name=تطبيق مصادق
otp-help-text=أدخل رمز التحقق الصادرة من التطبيق المصادق.
setUpNew=إعداد {{name}}
notSetUp=لم يتم إعداد {{name}}.
deviceActivity=نشاط الأجهزة
signedInDevicesExplanation=قم بتسجيل الخروج من أي جهاز غير مألوف.
signedInDevices=الأجهزة المسجلة للدخول
refreshPage=تحديث الصفحة
currentSession=الجلسة الحالية
ipAddress=عنوان الشبكة
lastAccessedOn=آخر وصول
clients=العملاء
started=ابتدأ في
expires=ينتهي في
applications=التطبيقات
applicationsIntroMessage=قم بتتبع وإدارة أذونات التطبيقات للوصول إلى حسابك
applicationName=الاسم
applicationType=نوع التطبيق
status=الحالة
internalApp=داخلی
notInUse=غير مستخدم
client=العميل
description=الوصف
inUse=قيد الاستخدام
reauthenticate=يرجى إعادة المصادقة للمتابعة
updatePasswordTitle=تم تحديث كلمة المرور
logoutOtherSessions=تسجيل الخروج من الأجهزة الأخرى
passwordNew=كلمة مرور جديدة
doSubmit=إرسال
notMatchPasswordMessage=كلمات المرور غير متطابقة.
invalidPasswordHistoryMessage=كلمة المرور غير صالحة: يجب ألا تكون مطابقة لأي من كلمات المرور الـ {0} الأخيرة.
loginTimeout=انتهت مهلة محاولة تسجيل الدخول. سيتم البدء في عملية تسجيل الدخول من جديد.
accountUpdatedMessage=تم تحديث الحساب الخاص بك.
client_account-console=لوحة التحكم بالحساب
72 changes: 72 additions & 0 deletions src/messages/messages_ca.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,75 @@ name=Nom
username-before=Your username will appear on all contributions you make and cannot be changed
username-after=Usernames must be between 2 and 20 characters and can only contain numbers and letters


loginAccountTitle=Accediu al vostre compte
usernameOrEmail=Usuari o adreça electrònica
password=Contrasenya
doForgotPassword=Heu oblidat la vostra contrasenya?
doLogIn=Inicia la sessió
noAccount=Usuari nou?
invalidUserMessage=El nom d''usuari o contrasenya no són vàlids.
registerTitle=Registreu-vos
backToLogin=&laquo; Torna a la identificació
requiredFields=Camps requerits
username=Usuari
passwordConfirm=Confirma la contrasenya
email=Email
country=País
missingUsernameMessage=Indiqueu el vostre nom d''usuari.
missingPasswordMessage=Indiqueu la vostra contrasenya.
missingEmailMessage=Indiqueu la vostra adreça de correu electrònic.
error-invalid-value=El valor no és vàlid.
error-pattern-no-match=El valor no és vàlid.
invalidPasswordMinLengthMessage=La contrasenya no és vàlida: la llargària mínima és {0}.
invalidPasswordConfirmMessage=La confirmació de contrasenya no coincideix.
usernameExistsMessage=El nom d''usuari ja existeix.
emailExistsMessage=El correu electrònic ja existeix.
invalidEmailMessage=L''adreça de correu electrònic no és vàlida.
doSignOut=Surt
personalInfo=Informació personal:
personalSubMessage=Gestioneu la vostra informació bàsica.
doSave=Desa
doCancel=Cancel·la
cancel=Cancel·la
deleteAccount=Elimina el compte
deleteAccountWarning=Això és irreversible. Totes les vostres dades es destruiran permanentment i no seran accessibles.
signingIn=Identificació
basic-authentication=Autenticació bàsica
password-help-text=Entreu introduint la vostra contrasenya.
credentialCreatedAt=Creada
update=Actualitza
two-factor=Autenticació de doble factor
otp-display-name=Aplicació d''autenticació
otp-help-text=Introduïu el codi de verificació de l''aplicació d''autenticació.
setUpNew=Configura {{name}}
notSetUp={0} no està configurat.
signedInDevicesExplanation=Desconnecteu qualsevol dispositiu que no us siga familiar.
signedInDevices=Dispositius identificats
refreshPage=Refresca la pàgina
currentSession=Sessió actual
ipAddress=Adreça IP
lastAccessedOn=Últim accés
clients=Clients
started=Iniciat
expires=Caduca
applications=Aplicacions
applicationsIntroMessage=Feu seguiment i gestioneu els permisos de les aplicacions per a accedir al vostre compte
applicationName=Nom
applicationType=Tipus d''aplicació
status=Estat
internalApp=Internes
notInUse=No en ús
client=Client
description=Descripció
inUse=En ús
reauthenticate=Torneu a identificar-vos per a continuar
updatePasswordTitle=Actualitza la contrasenya
logoutOtherSessions=Surt d''altres dispositius
passwordNew=Contrasenya nova
doSubmit=Envia
notMatchPasswordMessage=Les contrasenyes no coincideixen.
invalidPasswordHistoryMessage=Contrasenya incorrecta: no pot ser igual a cap de les últimes {0} contrasenyes.
loginTimeout=S''ha excedit el temps per a realitzar una entrada. L''entrada començarà des del principi.
accountUpdatedMessage=S''ha actualitzat el compte.
client_account-console=Consola del compte
47 changes: 47 additions & 0 deletions src/messages/messages_cs.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,50 @@ name=Jméno
username-before=Your username will appear on all contributions you make and cannot be changed
username-after=Usernames must be between 2 and 20 characters and can only contain numbers and letters


loginAccountTitle=Přihlásit k vašemu účtu
usernameOrEmail=Přihlašovací jméno nebo e-mail
password=Heslo
doForgotPassword=Zapomenuté heslo?
doLogIn=Přihlásit se
noAccount=Nový uživatel?
invalidUserMessage=Neplatné jméno nebo heslo.
registerTitle=Registrovat
backToLogin=&laquo; Zpět k přihlášení
requiredFields=Vyžadované položky
username=Přihlašovací jméno
passwordConfirm=Potvrdit heslo
email=E-mail
country=Stát
missingUsernameMessage=Zadejte prosím uživatelské jméno.
missingPasswordMessage=Zadejte prosím heslo.
missingEmailMessage=Zadejte prosím e-mail.
error-invalid-value=Nesprávná hodnota.
error-pattern-no-match=Nesprávná hodnota.
invalidPasswordMinLengthMessage=Neplatné heslo: minimální délka {0}.
invalidPasswordConfirmMessage=Potvrzení hesla se neshoduje.
usernameExistsMessage=Uživatelské jméno již existuje.
emailExistsMessage=E-mail již existuje.
invalidEmailMessage=Neplatný e-mail.
doSignOut=Odhlásit se
personalInfo=Osobní údaje:
doSave=Uložit
doCancel=Zrušit
password-help-text=Přihlaste se pomocí hesla.
otp-display-name=Autentizační Aplikace
otp-help-text=Zadejte ověřovací kód z aplikace.
clients=Klienti
started=Zahájeno
expires=Vyprší
applications=Aplikace
client=Klient
reauthenticate=Pro pokračování se prosím znovu přihlaste
updatePasswordTitle=Aktualizace hesla
logoutOtherSessions=Odhlásit se z ostatních zařízení
passwordNew=Nové heslo
doSubmit=Odeslat
notMatchPasswordMessage=Hesla se neshodují.
invalidPasswordHistoryMessage=Neplatné heslo: Nesmí se rovnat žádnému z posledních {0} hesel.
loginTimeout=Přihlašování trvalo příliš dlouho. Přihlašovací proces začíná od začátku.
accountUpdatedMessage=Váš účet byl aktualizován.
client_account-console=Uživatelská konzola
47 changes: 47 additions & 0 deletions src/messages/messages_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,50 @@ name=Navn
username-before=Dit brugernavn vises på alle bidrag du laver og kan ikke ændres
username-after=Brugernavne skal være fra 2 til 20 tegn langt og kan kun indeholde tal og bogstaver


usernameOrEmail=Brugernavn eller email
password=Adgangskode
doForgotPassword=Glemt adgangskode?
doLogIn=Log ind
noAccount=Ny bruger?
invalidUserMessage=Ugyldig brugernavn eller adgangskode.
registerTitle=Registrer
backToLogin=&laquo; Tilbage til log ind
requiredFields=Nødvendige felter
username=Brugernavn
passwordConfirm=Bekræft adgangskode
email=Email
country=Land
missingUsernameMessage=Angiv brugernavn.
missingPasswordMessage=Angiv password.
missingEmailMessage=Angiv email adressse.
invalidPasswordMinLengthMessage=Ugyldig adgangskode: minimum længde {0}.
invalidPasswordConfirmMessage=Adgangskoderne er ikke ens
usernameExistsMessage=Brugernavnet eksisterer allerede.
emailExistsMessage=Email adressen eksisterer allerede.
invalidEmailMessage=Ugyldig email adresse.
doSignOut=Log Ud
personalInfo=Personlig information:
personalSubMessage=Administrer disse grundinformationer; dit fornavn, efternavn og email adresse
doSave=Gem
doCancel=Annuller
password-help-text=Log ind ved at indtaste din adgangskode.
otp-display-name=Engangskodegenerator
otp-help-text=Indtast en godkendelseskode fra engangskodegeneratoren.
clients=Klienter
started=Påbegyndt
expires=Udløber
applications=Applikationer
applicationsIntroMessage=Spor og administrer dine app tilladelser for at tilgå din konto
applicationName=Navn
applicationType=Applikationstype
client=Klient
description=Beskrivelse
updatePasswordTitle=Opdater adgangskode
passwordNew=Ny Adgangskode
doSubmit=Indsend
notMatchPasswordMessage=Passwords er ikke ens.
invalidPasswordHistoryMessage=Ugyldig adgangskode: må ikke være identisk med nogle af de seneste {0} adgangskoder.
loginTimeout=Dit login tog for lang tid. Login processen vil nu begynde forfra.
accountUpdatedMessage=Din konto er blevet opdateret.
client_account-console=Kontokonsol
Loading

0 comments on commit 9904493

Please sign in to comment.