Skip to content

Commit

Permalink
Atualizado traduções da interface
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipePS committed Feb 24, 2024
1 parent 2983448 commit 0d31c0e
Show file tree
Hide file tree
Showing 45 changed files with 593 additions and 518 deletions.
71 changes: 71 additions & 0 deletions extra/check_locales.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const fs = require("fs");
const path = require("path");

function getDirectories(path) {
return fs.readdirSync(path).filter(function (file) {
return fs.statSync(path + "/" + file).isDirectory();
});
}

const langs = getDirectories(path.join(__dirname, "./result"));

const en_messages = require(path.join(
__dirname,
`./result/en/messages.json`
));
const en_keys = Object.keys(en_messages);

for (const code of langs) {
const messages = require(path.join(
__dirname,
`./result/${code}/messages.json`
));
const keys = Object.keys(messages);
if (keys.length !== Object.keys(en_messages).length) {
console.log(`Different number of keys in "${code}" compared to "en"`);
}
for (const en_key of en_keys) {
if (!messages[en_key]) {
console.log(`Key "${en_key}" not found in "en"`);
} else {
if (!messages[en_key].message) {
console.log(`Key "${en_key}" is missing "message" in "${code}"`);
}
if (en_messages[en_key].placeholders) {
if (!messages[en_key].placeholders) {
console.log(`Key "${en_key}" is missing "placeholders" in "${code}"`);
} else {
const en_vars = Object.keys(en_messages[en_key].placeholders);
const vars = Object.keys(messages[en_key].placeholders);
if (vars.length !== en_vars.length) {
console.log(
`Different number of placeholders in "${en_key}" compared to "en"`
);
}
for (const en_var of en_vars) {
if (!messages[en_key].placeholders[en_var]) {
console.log(
`Placeholder "${en_var}" not found in "${en_key}" in "${code}"`
);
}
}
const placeHolderInMessage =
messages[en_key].message.match(/\$\w+\$/g);
if (placeHolderInMessage) {
for (const placeHolder of en_vars) {
if (!placeHolderInMessage.includes("$" + placeHolder + "$")) {
console.log(
`Placeholder "${placeHolder}" not found in "${en_key}" in "${code}"`
);
}
}
} else {
console.log(`No placeholder found in "${en_key}" in "${code}"`);
}
}
}
}
}

console.log("=====================================");
}
36 changes: 18 additions & 18 deletions src/_locales/af/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"message": "Minder"
},
"dontShowIfIsNotValidText": {
"message": "Do not show if the selected text is not valid"
"message": "Moenie wys as die geselekteerde teks nie geldig is nie"
},
"dontShowIfPageLangIsTargetLang": {
"message": "Moenie wys of die bladsytaal die doeltaal is nie"
Expand Down Expand Up @@ -291,7 +291,7 @@
"message": "Teks-na-spraak klank spoed"
},
"lblTtsVolume": {
"message": "Text-to-speech audio volume"
"message": "Teks-na-spraak klankvolume"
},
"enterShortcut": {
"message": "Tik 'n kortpad"
Expand Down Expand Up @@ -402,7 +402,7 @@
"message": "Vertaal PDF"
},
"msgOpenTranslatedPDF": {
"message": "Open translated PDF"
"message": "Maak vertaalde PDF oop"
},
"btncopy": {
"message": "Kopieer"
Expand Down Expand Up @@ -538,19 +538,19 @@
"message": "Teks-na-spraak diens"
},
"msgDeepLTabReasoOpened": {
"message": "This tab opened because you clicked to translate selected text using DeepL."
"message": "Hierdie oortjie het oopgemaak omdat jy geklik het om geselekteerde teks met DeepL te vertaal."
},
"msgDontShowAgain": {
"message": "Don't show again"
"message": "Moenie weer wys nie"
},
"msgTranslatePage": {
"message": "Translate page?"
"message": "Vertaal bladsy?"
},
"msgPageTranslated": {
"message": "Page translated"
"message": "Bladsy vertaal"
},
"msgTranslateFromTo": {
"message": "$FROM_LANGUAGE$ to $TO_LANGUAGE$",
"message": "$FROM_LANGUAGE$ tot $TO_LANGUAGE$",
"placeholders": {
"FROM_LANGUAGE": {
"content": "$1",
Expand All @@ -563,38 +563,38 @@
}
},
"btnUndoTranslation": {
"message": "Undo"
"message": "Ontdoen"
},
"msgAutoDetect": {
"message": "Auto-detect"
"message": "Outo-bespeur"
},
"msgEnableIframePageTranslation": {
"message": "Enable page translation in $IFRAME_TAG$",
"message": "Aktiveer bladsyvertaling in $IFRAME_TAG$",
"placeholders": {
"IFRAME_TAG": {
"content": "<IFRAME>"
}
}
},
"btnTranslateRestoreThisFrame": {
"message": "Translate/Restore this frame"
"message": "Vertaal/Herstel hierdie raam"
},
"msgWhenShowMobilePopup": {
"message": "When to show the mobile popup"
"message": "Wanneer om die mobiele pop-up te wys"
},
"msgWhenNecessary": {
"message": "When necessary"
"message": "Wanneer nodig"
},
"msgOnlyWhenItouch3Fingers": {
"message": "Only when I touch three fingers on the screen"
"message": "Eers wanneer ek drie vingers op die skerm raak"
},
"msgAlwaysShow": {
"message": "Always show"
"message": "Wys altyd"
},
"btnKeepOnScreen": {
"message": "Keep on screen"
"message": "Hou op die skerm"
},
"btnChangePosition": {
"message": "Change position"
"message": "Verander posisie"
}
}
36 changes: 18 additions & 18 deletions src/_locales/ar/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"message": "أقل"
},
"dontShowIfIsNotValidText": {
"message": "Do not show if the selected text is not valid"
"message": "لا تظهر إذا كان النص المحدد غير صالح"
},
"dontShowIfPageLangIsTargetLang": {
"message": "لا تعرض ما إذا كانت لغة الصفحة هي اللغة الهدف"
Expand Down Expand Up @@ -291,7 +291,7 @@
"message": "سرعة صوت تحويل النص إلى كلام"
},
"lblTtsVolume": {
"message": "Text-to-speech audio volume"
"message": "حجم الصوت تحويل النص إلى كلام"
},
"enterShortcut": {
"message": "أدخل الاختصار"
Expand Down Expand Up @@ -402,7 +402,7 @@
"message": "ترجمة PDF"
},
"msgOpenTranslatedPDF": {
"message": "Open translated PDF"
"message": "افتح ملف PDF المترجم"
},
"btncopy": {
"message": "نسخ"
Expand Down Expand Up @@ -538,19 +538,19 @@
"message": "خدمة تحويل النص إلى كلام"
},
"msgDeepLTabReasoOpened": {
"message": "This tab opened because you clicked to translate selected text using DeepL."
"message": "تم فتح علامة التبويب هذه لأنك نقرت لترجمة النص المحدد باستخدام DeepL."
},
"msgDontShowAgain": {
"message": "Don't show again"
"message": "لا تظهر مرة أخرى"
},
"msgTranslatePage": {
"message": "Translate page?"
"message": "ترجمة الصفحة؟"
},
"msgPageTranslated": {
"message": "Page translated"
"message": "الصفحة مترجمة"
},
"msgTranslateFromTo": {
"message": "$FROM_LANGUAGE$ to $TO_LANGUAGE$",
"message": "$FROM_LANGUAGE$ إلى $TO_LANGUAGE$",
"placeholders": {
"FROM_LANGUAGE": {
"content": "$1",
Expand All @@ -563,38 +563,38 @@
}
},
"btnUndoTranslation": {
"message": "Undo"
"message": "الغاء التحميل"
},
"msgAutoDetect": {
"message": "Auto-detect"
"message": "اكتشاف تلقائي"
},
"msgEnableIframePageTranslation": {
"message": "Enable page translation in $IFRAME_TAG$",
"message": "تمكين ترجمة الصفحة في $IFRAME_TAG$",
"placeholders": {
"IFRAME_TAG": {
"content": "<IFRAME>"
}
}
},
"btnTranslateRestoreThisFrame": {
"message": "Translate/Restore this frame"
"message": "ترجمة/استعادة هذا الإطار"
},
"msgWhenShowMobilePopup": {
"message": "When to show the mobile popup"
"message": "متى تظهر النافذة المنبثقة للجوال"
},
"msgWhenNecessary": {
"message": "When necessary"
"message": "عند الضرورة"
},
"msgOnlyWhenItouch3Fingers": {
"message": "Only when I touch three fingers on the screen"
"message": "فقط عندما ألمس ثلاثة أصابع على الشاشة"
},
"msgAlwaysShow": {
"message": "Always show"
"message": "اعرض دائما"
},
"btnKeepOnScreen": {
"message": "Keep on screen"
"message": "إبقاء على الشاشة"
},
"btnChangePosition": {
"message": "Change position"
"message": "غير المكان"
}
}
36 changes: 18 additions & 18 deletions src/_locales/bn/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"message": "কমিয়ে দিন"
},
"dontShowIfIsNotValidText": {
"message": "Do not show if the selected text is not valid"
"message": "নির্বাচিত টেক্সট বৈধ না হলে দেখাবেন না"
},
"dontShowIfPageLangIsTargetLang": {
"message": "পৃষ্ঠার ভাষা শুরুতেই টার্গেট ভাষা হলে দেখাবেন না"
Expand Down Expand Up @@ -291,7 +291,7 @@
"message": "টেক্সট-টু-স্পিচ অডিও গতি"
},
"lblTtsVolume": {
"message": "Text-to-speech audio volume"
"message": "টেক্সট-টু-স্পিচ অডিও ভলিউম"
},
"enterShortcut": {
"message": "শর্টকাট লিখুন"
Expand Down Expand Up @@ -402,7 +402,7 @@
"message": "PDF অনুবাদ করুন"
},
"msgOpenTranslatedPDF": {
"message": "Open translated PDF"
"message": "অনূদিত PDF খুলুন"
},
"btncopy": {
"message": "কপি করুন"
Expand Down Expand Up @@ -538,19 +538,19 @@
"message": "টেক্সট-টু-স্পিচ পরিষেবা"
},
"msgDeepLTabReasoOpened": {
"message": "This tab opened because you clicked to translate selected text using DeepL."
"message": "এই ট্যাবটি খোলা হয়েছে কারণ আপনি DeepL ব্যবহার করে নির্বাচিত পাঠ্য অনুবাদ করতে ক্লিক করেছেন।"
},
"msgDontShowAgain": {
"message": "Don't show again"
"message": "আবার দেখাবেন না"
},
"msgTranslatePage": {
"message": "Translate page?"
"message": "পৃষ্ঠা অনুবাদ করবেন?"
},
"msgPageTranslated": {
"message": "Page translated"
"message": "পৃষ্ঠা অনূদিত"
},
"msgTranslateFromTo": {
"message": "$FROM_LANGUAGE$ to $TO_LANGUAGE$",
"message": "$FROM_LANGUAGE$ থেকে $TO_LANGUAGE$",
"placeholders": {
"FROM_LANGUAGE": {
"content": "$1",
Expand All @@ -563,38 +563,38 @@
}
},
"btnUndoTranslation": {
"message": "Undo"
"message": "পূর্বাবস্থায় ফেরান"
},
"msgAutoDetect": {
"message": "Auto-detect"
"message": "স্বয়ং সনাক্ত"
},
"msgEnableIframePageTranslation": {
"message": "Enable page translation in $IFRAME_TAG$",
"message": "$IFRAME_TAG$এ পৃষ্ঠা অনুবাদ সক্ষম করুন৷",
"placeholders": {
"IFRAME_TAG": {
"content": "<IFRAME>"
}
}
},
"btnTranslateRestoreThisFrame": {
"message": "Translate/Restore this frame"
"message": "এই ফ্রেমটি অনুবাদ/পুনরুদ্ধার করুন"
},
"msgWhenShowMobilePopup": {
"message": "When to show the mobile popup"
"message": "কখন মোবাইলের পপআপ দেখাবেন"
},
"msgWhenNecessary": {
"message": "When necessary"
"message": "যখন প্রয়োজন"
},
"msgOnlyWhenItouch3Fingers": {
"message": "Only when I touch three fingers on the screen"
"message": "স্ক্রিনে তিনটি আঙুল স্পর্শ করলেই"
},
"msgAlwaysShow": {
"message": "Always show"
"message": "সবসময় প্রদর্শন"
},
"btnKeepOnScreen": {
"message": "Keep on screen"
"message": "পর্দায় রাখুন"
},
"btnChangePosition": {
"message": "Change position"
"message": "অবস্থান পরিবর্তন"
}
}
Loading

0 comments on commit 0d31c0e

Please sign in to comment.