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 3792da4 commit b0c5863
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:e2e--open": "cypress open",
"test:e2e": "cypress run",
"eject": "react-scripts eject",
"generate-locales": "node scripts/generate-locales.mjs"
"generate-locales": "node scripts/generate-locales.mjs && node scripts/find-untranslated.js"
},
"eslintConfig": {
"extends": [
Expand Down
45 changes: 45 additions & 0 deletions scripts/find-untranslated.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const fs = require('fs-extra')
const path = require('path')

// const __dirname = path.dirname(new URL(import.meta.url).pathname)
const ProjectSourceRoot = path.resolve(__dirname, '..')

const directoryPath = path.join(ProjectSourceRoot, './src/locales')
const englishJsonFilename = 'en-US.json' // Set the English JSON filename

// Function to load JSON files and check for untranslated strings
function findUntranslatedStrings(dirPath) {
const files = fs.readdirSync(dirPath)
const englishFilePath = path.join(dirPath, englishJsonFilename)
const englishData = fs.readJsonSync(englishFilePath)
const untranslated = {}

files.forEach((file) => {
if (path.extname(file) === '.json' && file !== englishJsonFilename) {
const filePath = path.join(dirPath, file)
const data = fs.readJsonSync(filePath)
const languageCode = path.basename(file, '.json')

// Check each key in the JSON file
Object.entries(data).forEach(([key, value]) => {
if (value === '') {
if (!untranslated[key]) {
untranslated[key] = {
untranslated: [],
englishSource:
englishData[key] ||
'No English source available',
}
}
untranslated[key].untranslated.push(languageCode)
}
})
}
})

return untranslated
}

// Execute the function and log the results
const untranslated = findUntranslatedStrings(directoryPath)
console.log(JSON.stringify(untranslated, null, 2))
2 changes: 1 addition & 1 deletion src/containers/apps/appDetails/deploy/Deployment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export default class Deployment extends ApiComponent<
? webhookPushUrlFullPath
: '** ' +
localize(
'apps.deploy_method_github_url_hiint',
'apps.deploy_method_github_url_hint',
'Add repo info and save for this webhook to appear'
) +
' **'
Expand Down
2 changes: 1 addition & 1 deletion src/containers/settings/ThemeSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ThemeSettings = () => {
<Popconfirm
title={localize(
'theme.delete_theme_title',
'Delete ' + currentTheme?.name + '?'
'Delete theme?'
)}
okText={localize('theme.delete', 'Delete')}
onConfirm={() => {
Expand Down
15 changes: 13 additions & 2 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_hiint": "أضف معلومات المستودع واحفظها حتى يظهر هذا الويب هوك",
"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,6 +308,7 @@
"menu_item.app": "التطبيقات",
"menu_item.cluster": "الكتلة",
"menu_item.dashboard": "لوحة التحكم",
"menu_item.maintenance": "",
"menu_item.monitoring": "المراقبة",
"menu_item.settings": "الإعدادات",
"netdata_settings.all_notification_options_are_completely_optional": "جميع خيارات الإشعارات اختيارية تمامًا.",
Expand Down Expand Up @@ -426,6 +427,16 @@
"settings.otp_disabled": "تم تعطيل المصادقة الثنائية",
"settings.otp_enabled_success": "تم تمكين المصادقة الثنائية بنجاح الآن",
"settings.otp_verification_code": "رمز التحقق OTP",
"settings.themes": "",
"settings.time_to_refresh": "الوقت للتحديث: ",
"settings.update_process_started": "بدأت عملية التحديث"
"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": ""
}
15 changes: 13 additions & 2 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_hiint": "",
"apps.deploy_method_github_url_hint": "",
"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,6 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Cluster",
"menu_item.dashboard": "Dashboard",
"menu_item.maintenance": "",
"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 @@ -426,6 +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.time_to_refresh": "Zeit bis zur Aktualisierung: ",
"settings.update_process_started": "Update-Prozess gestartet"
"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": ""
}
15 changes: 13 additions & 2 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "Method 4: Deploy plain Dockerfile",
"apps.deploy_method_github": "Method 3: Deploy from Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "Enter your repository information in the form and save. Then copy the URL in the box as a webhook on Github, Bitbucket, Gitlab and etc. Once you push a commit, CapRover starts a new build.",
"apps.deploy_method_github_url_hiint": "Add repo info and save for this webhook to appear",
"apps.deploy_method_github_url_hint": "Add repo info and save for this webhook to appear",
"apps.deploy_method_image_name": "Method 6: Deploy via ImageName",
"apps.deploy_method_tarball": "Method 2: Tarball",
"apps.deploy_now_button": "Deploy Now",
Expand Down Expand Up @@ -308,6 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Cluster",
"menu_item.dashboard": "Dashboard",
"menu_item.maintenance": "Maintenance",
"menu_item.monitoring": "Monitoring",
"menu_item.settings": "Settings",
"netdata_settings.all_notification_options_are_completely_optional": "All notification options are completely OPTIONAL.",
Expand Down Expand Up @@ -426,6 +427,16 @@
"settings.otp_disabled": "Two factor authentication is disabled",
"settings.otp_enabled_success": "Two factor authentication is now successfully enabled",
"settings.otp_verification_code": "OTP Verification Code",
"settings.themes": "Themes",
"settings.time_to_refresh": "Time to Refresh: ",
"settings.update_process_started": "Update Process Started"
"settings.update_process_started": "Update Process Started",
"theme.delete": "Delete",
"theme.delete_theme_title": "Delete theme?",
"themes.caprover_extra": "Other configuration passed to CapRover",
"themes.customize_theme": "Customize Theme",
"themes.description": "CapRover comes with many built-in themes! Go ahead and select your favorite theme",
"themes.edit_name": "Theme name",
"themes.head_embed": "Embed elements into <head>",
"themes.see_here": "See here for details.",
"themes.theme_custom_help": "You can customize CapRover theme by providing custom theme and inject elements (font, CSS, JS, etc) into the <head> section."
}
15 changes: 13 additions & 2 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_hiint": "Agregue información del repo y guarde para que este webhook aparezca",
"apps.deploy_method_github_url_hint": "",
"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,6 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Clúster",
"menu_item.dashboard": "Panel de Control",
"menu_item.maintenance": "",
"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 @@ -426,6 +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.time_to_refresh": "Tiempo para Refrescar: ",
"settings.update_process_started": "Proceso de Actualización Iniciado"
"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": ""
}
15 changes: 13 additions & 2 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_hiint": "اطلاعات مخزن را اضافه کرده و ذخیره کنید تا این webhook ظاهر شود",
"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,6 +308,7 @@
"menu_item.app": "برنامه‌ها",
"menu_item.cluster": "خوشه",
"menu_item.dashboard": "داشبورد",
"menu_item.maintenance": "",
"menu_item.monitoring": "نظارت",
"menu_item.settings": "تنظیمات",
"netdata_settings.all_notification_options_are_completely_optional": "تمام گزینه‌های اعلان کاملاً اختیاری هستند.",
Expand Down Expand Up @@ -426,6 +427,16 @@
"settings.otp_disabled": "احراز هویت دو عاملی غیرفعال است",
"settings.otp_enabled_success": "احراز هویت دو عاملی اکنون با موفقیت فعال شد",
"settings.otp_verification_code": "کد تأیید OTP",
"settings.themes": "",
"settings.time_to_refresh": "زمان برای تازه‌سازی: ",
"settings.update_process_started": "فرآیند به‌روزرسانی آغاز شد"
"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": ""
}
15 changes: 13 additions & 2 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_hiint": "Ajoutez les informations du dépôt et enregistrez pour que ce webhook apparaisse",
"apps.deploy_method_github_url_hint": "",
"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,6 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Cluster",
"menu_item.dashboard": "Tableau de Bord",
"menu_item.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 @@ -426,6 +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.time_to_refresh": "Temps de Rafraîchissement : ",
"settings.update_process_started": "Le processus de mise à jour a commencé"
"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": ""
}
15 changes: 13 additions & 2 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_hiint": "Tambahkan info repo dan simpan agar webhook ini muncul",
"apps.deploy_method_github_url_hint": "",
"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,6 +308,7 @@
"menu_item.app": "Aplikasi",
"menu_item.cluster": "Klaster",
"menu_item.dashboard": "Dasbor",
"menu_item.maintenance": "",
"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 @@ -426,6 +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.time_to_refresh": "Waktu untuk Segarkan: ",
"settings.update_process_started": "Proses Pembaruan Dimulai"
"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": ""
}
15 changes: 13 additions & 2 deletions src/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"apps.deploy_method_dockerfile": "Método 4: Implantar Dockerfile simples",
"apps.deploy_method_github": "Método 3: Implantar do Github/Bitbucket/Gitlab",
"apps.deploy_method_github_description": "Digite as informações do seu repositório no formulário e salve. Em seguida, copie o URL na caixa como um webhook no Github, Bitbucket, Gitlab, etc. Assim que você fizer um push de um commit, CapRover inicia uma nova build.",
"apps.deploy_method_github_url_hiint": "Adicione informações do repositório e salve para que este webhook apareça",
"apps.deploy_method_github_url_hint": "",
"apps.deploy_method_image_name": "Método 6: Implantar via ImageName",
"apps.deploy_method_tarball": "Método 2: Tarball",
"apps.deploy_now_button": "Implantar Agora",
Expand Down Expand Up @@ -308,6 +308,7 @@
"menu_item.app": "Apps",
"menu_item.cluster": "Cluster",
"menu_item.dashboard": "Painel de Controle",
"menu_item.maintenance": "",
"menu_item.monitoring": "Monitoramento",
"menu_item.settings": "Configurações",
"netdata_settings.all_notification_options_are_completely_optional": "Todas as opções de notificação são completamente OPCIONAIS.",
Expand Down Expand Up @@ -426,6 +427,16 @@
"settings.otp_disabled": "Autenticação de dois fatores desativada",
"settings.otp_enabled_success": "Autenticação de dois fatores agora ativada com sucesso",
"settings.otp_verification_code": "Código de Verificação OTP",
"settings.themes": "",
"settings.time_to_refresh": "Tempo para Atualizar: ",
"settings.update_process_started": "Processo de Atualização Iniciado"
"settings.update_process_started": "Processo de Atualização 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": ""
}
Loading

0 comments on commit b0c5863

Please sign in to comment.