Skip to content

Commit

Permalink
Added some languages
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsaturn committed Oct 17, 2024
1 parent f90fe21 commit c89b8b7
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 364 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"test:e2e--open": "cypress open",
"test:e2e": "cypress run",
"eject": "react-scripts eject",
"generate-locales": "node scripts/generate-locales.mjs && node scripts/find-untranslated.js"
"generate-locales": "node scripts/generate-locales.mjs && node scripts/find-untranslated.js",
"populate-misssing-locales": "node scripts/populate-missing-translations.js"
},
"eslintConfig": {
"extends": [
Expand Down
29 changes: 25 additions & 4 deletions scripts/populate-missing-translations.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const prettier = require('prettier')
const fs = require('fs-extra')
const path = require('path')

Expand All @@ -6,6 +7,17 @@ const ProjectSourceRoot = path.resolve(__dirname, '..')
const sourceDirectoryPath = path.join(ProjectSourceRoot, './src/locales')
const translationsFilePath = path.join(ProjectSourceRoot, './translations.json')

function formatJSON(jsonContent) {
const prettierConfig = fs.readJSONSync(
path.resolve(ProjectSourceRoot, '.prettierrc.json')
)

return prettier.format(JSON.stringify(jsonContent), {
...prettierConfig,
parser: 'json',
})
}

// Function to update source JSON files with new translations
function updateTranslations(translationsFile, sourceDir) {
const newTranslations = fs.readJsonSync(translationsFile)
Expand All @@ -20,12 +32,21 @@ function updateTranslations(translationsFile, sourceDir) {

// Update the translation in the source file
data[key] = value
fs.writeJsonSync(langFile, data, { spaces: 2 })

const sortedData = {}
const sortedKeys = Object.keys(data).sort((a, b) =>
a.localeCompare(b)
)
sortedKeys.forEach((key) => {
sortedData[key] = data[key]
})

fs.writeFileSync(langFile, formatJSON(sortedData))

// fs.writeJsonSync(langFile, data, { spaces: 2 })
} else {
// If the language file does not exist, create it
const newData = {}
newData[key] = value
fs.writeJsonSync(langFile, newData, { spaces: 2 })
throw new Error('language does not exist ' + langFile)
}
})
})
Expand Down
24 changes: 12 additions & 12 deletions src/locales/ar-EG.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "الطريقة 4: توزيع Dockerfile عادي",
"apps.deploy_method_github": "الطريقة 3: التوزيع من Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "أدخل معلومات مستودعك في النموذج واحفظه. ثم انسخ عنوان URL في المربع كويب هوك على Github، Bitbucket، Gitlab وما إلى ذلك. بمجرد أن تدفع تعهدًا، يبدأ CapRover بناءً جديدًا.",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_github_url_hint": "أضف معلومات المستودع واحفظ لكي يظهر هذا الويب هوك",
"apps.deploy_method_image_name": "الطريقة 6: التوزيع عبر ImageName",
"apps.deploy_method_tarball": "الطريقة 2: Tarball",
"apps.deploy_now_button": "توزيع الآن",
Expand Down Expand Up @@ -308,7 +308,7 @@
"menu_item.app": "التطبيقات",
"menu_item.cluster": "الكتلة",
"menu_item.dashboard": "لوحة التحكم",
"menu_item.maintenance": "",
"menu_item.maintenance": "الصيانة",
"menu_item.monitoring": "المراقبة",
"menu_item.settings": "الإعدادات",
"netdata_settings.all_notification_options_are_completely_optional": "جميع خيارات الإشعارات اختيارية تمامًا.",
Expand Down Expand Up @@ -427,16 +427,16 @@
"settings.otp_disabled": "تم تعطيل المصادقة الثنائية",
"settings.otp_enabled_success": "تم تمكين المصادقة الثنائية بنجاح الآن",
"settings.otp_verification_code": "رمز التحقق OTP",
"settings.themes": "",
"settings.themes": "الثيمات",
"settings.time_to_refresh": "الوقت للتحديث: ",
"settings.update_process_started": "بدأت عملية التحديث",
"theme.delete": "",
"theme.delete_theme_title": "",
"themes.caprover_extra": "",
"themes.customize_theme": "",
"themes.description": "",
"themes.edit_name": "",
"themes.head_embed": "",
"themes.see_here": "",
"themes.theme_custom_help": ""
"theme.delete": "حذف",
"theme.delete_theme_title": "حذف الثيم؟",
"themes.caprover_extra": "تهيئة أخرى مُررت إلى كابروفر",
"themes.customize_theme": "تخصيص الثيم",
"themes.description": "يأتي كابروفر مع العديد من الثيمات المدمجة! تقدم واختر الثيم المفضل لديك",
"themes.edit_name": "اسم الثيم",
"themes.head_embed": "تضمين العناصر في <head>",
"themes.see_here": "انظر هنا للتفاصيل.",
"themes.theme_custom_help": "يمكنك تخصيص ثيم كابروفر عن طريق توفير ثيم مخصص وحقن العناصر (خط، CSS، JS، إلخ) في قسم <head>."
}
24 changes: 12 additions & 12 deletions src/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "Methode 4: Bereitstellung einfacher Dockerfile",
"apps.deploy_method_github": "Methode 3: Bereitstellung von Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "Geben Sie Ihre Repository-Informationen in das Formular ein und speichern Sie. Kopieren Sie dann die URL in das Feld als Webhook auf Github, Bitbucket, Gitlab usw. Sobald Sie einen Commit durchführen, startet CapRover einen neuen Build.",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_github_url_hint": "Fügen Sie Repo-Informationen hinzu und speichern Sie, damit dieser Webhook erscheint",
"apps.deploy_method_image_name": "Methode 6: Bereitstellung über ImageName",
"apps.deploy_method_tarball": "Methode 2: Tarball",
"apps.deploy_now_button": "Jetzt bereitstellen",
Expand Down Expand Up @@ -308,7 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Cluster",
"menu_item.dashboard": "Dashboard",
"menu_item.maintenance": "",
"menu_item.maintenance": "Wartung",
"menu_item.monitoring": "Überwachung",
"menu_item.settings": "Einstellungen",
"netdata_settings.all_notification_options_are_completely_optional": "Alle Benachrichtigungsoptionen sind vollständig OPTIONAL.",
Expand Down Expand Up @@ -427,16 +427,16 @@
"settings.otp_disabled": "Zwei-Faktor-Authentifizierung ist deaktiviert",
"settings.otp_enabled_success": "Zwei-Faktor-Authentifizierung ist jetzt erfolgreich aktiviert",
"settings.otp_verification_code": "OTP-Überprüfungscode",
"settings.themes": "",
"settings.themes": "Themen",
"settings.time_to_refresh": "Zeit bis zur Aktualisierung: ",
"settings.update_process_started": "Update-Prozess gestartet",
"theme.delete": "",
"theme.delete_theme_title": "",
"themes.caprover_extra": "",
"themes.customize_theme": "",
"themes.description": "",
"themes.edit_name": "",
"themes.head_embed": "",
"themes.see_here": "",
"themes.theme_custom_help": ""
"theme.delete": "Löschen",
"theme.delete_theme_title": "Thema löschen?",
"themes.caprover_extra": "Weitere Konfiguration, die an CapRover übergeben wurde",
"themes.customize_theme": "Thema anpassen",
"themes.description": "CapRover verfügt über viele integrierte Themen! Wählen Sie Ihr Lieblingsthema aus",
"themes.edit_name": "Themenname",
"themes.head_embed": "Elemente in <head> einbetten",
"themes.see_here": "Siehe hier für Details.",
"themes.theme_custom_help": "Sie können das CapRover-Thema anpassen, indem Sie ein benutzerdefiniertes Thema bereitstellen und Elemente (Schriftart, CSS, JS usw.) in den <head>-Abschnitt einfügen."
}
24 changes: 12 additions & 12 deletions src/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "Método 4: Desplegar Dockerfile simple",
"apps.deploy_method_github": "Método 3: Desplegar desde Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "Ingrese la información de su repositorio en el formulario y guarde. Luego, copie la URL en el cuadro como un webhook en Github, Bitbucket, Gitlab, etc. Una vez que realice un commit, CapRover iniciará una nueva construcción.",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_github_url_hint": "Agrega la información del repositorio y guarda para que aparezca este webhook",
"apps.deploy_method_image_name": "Método 6: Desplegar vía Nombre de Imagen",
"apps.deploy_method_tarball": "Método 2: Tarball",
"apps.deploy_now_button": "Desplegar Ahora",
Expand Down Expand Up @@ -308,7 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Clúster",
"menu_item.dashboard": "Panel de Control",
"menu_item.maintenance": "",
"menu_item.maintenance": "Mantenimiento",
"menu_item.monitoring": "Monitoreo",
"menu_item.settings": "Configuraciones",
"netdata_settings.all_notification_options_are_completely_optional": "Todas las opciones de notificación son completamente OPCIONALES.",
Expand Down Expand Up @@ -427,16 +427,16 @@
"settings.otp_disabled": "La autenticación de dos factores está desactivada",
"settings.otp_enabled_success": "La autenticación de dos factores ahora está habilitada con éxito",
"settings.otp_verification_code": "Código de Verificación OTP",
"settings.themes": "",
"settings.themes": "Temas",
"settings.time_to_refresh": "Tiempo para Refrescar: ",
"settings.update_process_started": "Proceso de Actualización Iniciado",
"theme.delete": "",
"theme.delete_theme_title": "",
"themes.caprover_extra": "",
"themes.customize_theme": "",
"themes.description": "",
"themes.edit_name": "",
"themes.head_embed": "",
"themes.see_here": "",
"themes.theme_custom_help": ""
"theme.delete": "Eliminar",
"theme.delete_theme_title": "¿Eliminar tema?",
"themes.caprover_extra": "Otra configuración pasada a CapRover",
"themes.customize_theme": "Personalizar tema",
"themes.description": "¡CapRover viene con muchos temas incorporados! Adelante y selecciona tu tema favorito",
"themes.edit_name": "Nombre del tema",
"themes.head_embed": "Incrustar elementos en <head>",
"themes.see_here": "Consulta aquí para más detalles.",
"themes.theme_custom_help": "Puedes personalizar el tema de CapRover proporcionando un tema personalizado e inyectando elementos (fuente, CSS, JS, etc.) en la sección <head>."
}
24 changes: 12 additions & 12 deletions src/locales/fa-IR.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "روش ۴: استقرار Dockerfile ساده",
"apps.deploy_method_github": "روش ۳: استقرار از Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "اطلاعات مخزن خود را در فرم وارد کنید و ذخیره کنید. سپس URL را در کادر به عنوان یک webhook در Github, Bitbucket, Gitlab و غیره کپی کنید. هر بار که شما یک کامیت را پوش می‌کنید، کپروور یک ساخت جدید را آغاز می‌کند.",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_github_url_hint": "اطلاعات مخزن را اضافه کرده و برای نمایش این وب‌هوک ذخیره کنید",
"apps.deploy_method_image_name": "روش ۶: استقرار از طریق ImageName",
"apps.deploy_method_tarball": "روش ۲: Tarball",
"apps.deploy_now_button": "اکنون استقرار دهید",
Expand Down Expand Up @@ -308,7 +308,7 @@
"menu_item.app": "برنامه‌ها",
"menu_item.cluster": "خوشه",
"menu_item.dashboard": "داشبورد",
"menu_item.maintenance": "",
"menu_item.maintenance": "نگهداری",
"menu_item.monitoring": "نظارت",
"menu_item.settings": "تنظیمات",
"netdata_settings.all_notification_options_are_completely_optional": "تمام گزینه‌های اعلان کاملاً اختیاری هستند.",
Expand Down Expand Up @@ -427,16 +427,16 @@
"settings.otp_disabled": "احراز هویت دو عاملی غیرفعال است",
"settings.otp_enabled_success": "احراز هویت دو عاملی اکنون با موفقیت فعال شد",
"settings.otp_verification_code": "کد تأیید OTP",
"settings.themes": "",
"settings.themes": "تم‌ها",
"settings.time_to_refresh": "زمان برای تازه‌سازی: ",
"settings.update_process_started": "فرآیند به‌روزرسانی آغاز شد",
"theme.delete": "",
"theme.delete_theme_title": "",
"themes.caprover_extra": "",
"themes.customize_theme": "",
"themes.description": "",
"themes.edit_name": "",
"themes.head_embed": "",
"themes.see_here": "",
"themes.theme_custom_help": ""
"theme.delete": "حذف",
"theme.delete_theme_title": "حذف تم؟",
"themes.caprover_extra": "پیکربندی دیگری که به کپ‌روور ارسال شده است",
"themes.customize_theme": "شخصی سازی تم",
"themes.description": "کپ‌روور با تم‌های زیادی مجهز است! به جلو بروید و تم مورد علاقه خود را انتخاب کنید",
"themes.edit_name": "نام تم",
"themes.head_embed": "قرار دادن عناصر در <head>",
"themes.see_here": "برای جزئیات اینجا را ببینید.",
"themes.theme_custom_help": "می‌توانید با ارائه‌ی یک تم سفارشی و تزریق عناصر (فونت، CSS، JS و غیره) به بخش <head>، تم کپ‌روور را شخصی‌سازی کنید."
}
24 changes: 12 additions & 12 deletions src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "Méthode 4 : Déployer Dockerfile brut",
"apps.deploy_method_github": "Méthode 3 : Déployer depuis Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "Entrez les informations de votre dépôt dans le formulaire et enregistrez. Ensuite, copiez l'URL dans la case comme webhook sur Github, Bitbucket, Gitlab, etc. Une fois que vous poussez un commit, CapRover commence un nouveau build.",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_github_url_hint": "Ajoutez les infos du dépôt et sauvegardez pour que ce webhook apparaisse",
"apps.deploy_method_image_name": "Méthode 6 : Déployer via ImageName",
"apps.deploy_method_tarball": "Méthode 2 : Tarball",
"apps.deploy_now_button": "Déployer Maintenant",
Expand Down Expand Up @@ -308,7 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Cluster",
"menu_item.dashboard": "Tableau de Bord",
"menu_item.maintenance": "",
"menu_item.maintenance": "Maintenance",
"menu_item.monitoring": "Monitoring",
"menu_item.settings": "Paramètres",
"netdata_settings.all_notification_options_are_completely_optional": "Toutes les options de notification sont entièrement OPTIONNELLES.",
Expand Down Expand Up @@ -427,16 +427,16 @@
"settings.otp_disabled": "L'authentification à deux facteurs est désactivée",
"settings.otp_enabled_success": "L'authentification à deux facteurs est maintenant activée avec succès",
"settings.otp_verification_code": "Code de Vérification OTP",
"settings.themes": "",
"settings.themes": "Thèmes",
"settings.time_to_refresh": "Temps de Rafraîchissement : ",
"settings.update_process_started": "Le processus de mise à jour a commencé",
"theme.delete": "",
"theme.delete_theme_title": "",
"themes.caprover_extra": "",
"themes.customize_theme": "",
"themes.description": "",
"themes.edit_name": "",
"themes.head_embed": "",
"themes.see_here": "",
"themes.theme_custom_help": ""
"theme.delete": "Supprimer",
"theme.delete_theme_title": "Supprimer le thème ?",
"themes.caprover_extra": "Autre configuration transmise à CapRover",
"themes.customize_theme": "Personnaliser le thème",
"themes.description": "CapRover est livré avec de nombreux thèmes intégrés ! Allez-y et sélectionnez votre thème préféré",
"themes.edit_name": "Nom du thème",
"themes.head_embed": "Intégrer des éléments dans <head>",
"themes.see_here": "Voir ici pour les détails.",
"themes.theme_custom_help": "Vous pouvez personnaliser le thème CapRover en fournissant un thème personnalisé et en injectant des éléments (police, CSS, JS, etc.) dans la section <head>."
}
24 changes: 12 additions & 12 deletions src/locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "Metode 4: Tempatkan Dockerfile biasa",
"apps.deploy_method_github": "Metode 3: Tempatkan dari Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "Masukkan informasi repositori Anda dalam formulir dan simpan. Kemudian salin URL di kotak sebagai webhook di Github, Bitbucket, Gitlab, dan lainnya. Setiap Anda mendorong komit, CapRover memulai pembangunan baru.",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_github_url_hint": "Tambahkan info repo dan simpan agar webhook ini muncul",
"apps.deploy_method_image_name": "Metode 6: Tempatkan melalui ImageName",
"apps.deploy_method_tarball": "Metode 2: Tarball",
"apps.deploy_now_button": "Tempatkan Sekarang",
Expand Down Expand Up @@ -308,7 +308,7 @@
"menu_item.app": "Aplikasi",
"menu_item.cluster": "Klaster",
"menu_item.dashboard": "Dasbor",
"menu_item.maintenance": "",
"menu_item.maintenance": "Pemeliharaan",
"menu_item.monitoring": "Pemantauan",
"menu_item.settings": "Pengaturan",
"netdata_settings.all_notification_options_are_completely_optional": "Semua opsi notifikasi sepenuhnya OPSIONAL.",
Expand Down Expand Up @@ -427,16 +427,16 @@
"settings.otp_disabled": "Autentikasi dua faktor dinonaktifkan",
"settings.otp_enabled_success": "Autentikasi dua faktor sekarang berhasil diaktifkan",
"settings.otp_verification_code": "Kode Verifikasi OTP",
"settings.themes": "",
"settings.themes": "Tema",
"settings.time_to_refresh": "Waktu untuk Segarkan: ",
"settings.update_process_started": "Proses Pembaruan Dimulai",
"theme.delete": "",
"theme.delete_theme_title": "",
"themes.caprover_extra": "",
"themes.customize_theme": "",
"themes.description": "",
"themes.edit_name": "",
"themes.head_embed": "",
"themes.see_here": "",
"themes.theme_custom_help": ""
"theme.delete": "Hapus",
"theme.delete_theme_title": "Hapus tema?",
"themes.caprover_extra": "Konfigurasi lain yang diteruskan ke CapRover",
"themes.customize_theme": "Sesuaikan Tema",
"themes.description": "CapRover dilengkapi banyak tema bawaan! Lanjutkan dan pilih tema favorit Anda",
"themes.edit_name": "Nama Tema",
"themes.head_embed": "Menyematkan elemen ke dalam <head>",
"themes.see_here": "Lihat di sini untuk detailnya.",
"themes.theme_custom_help": "Anda dapat menyesuaikan tema CapRover dengan menyediakan tema khusus dan menyuntikkan elemen (font, CSS, JS, dll) ke dalam bagian <head>."
}
Loading

0 comments on commit c89b8b7

Please sign in to comment.