-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] i18n: Translate arabic strings using Google cloud translate. #19069
Conversation
I wrote a script to see how many strings have the variable names couurputed. Looks like 17/55 strings with with variable names got their variable corrupted during the translation. https://gist.github.com/hackerkid/b51e153cc8b2e3176a350b21dc4f15e6 I opened an issue in upstream to see if they have any idea on how to deal wiith this As a temporary fix, I have removed the translation of the 14/17 corrupted translated strings and fixed the 3 remaining ones manually. These are the ones I corrected manually. The change I made was to replace You are not subscribed to stream __stream__
أنت غير مشترك في البث __ Stream__
You subscribed to stream __stream__
لقد اشتركت في البث __ Stream__
You unsubscribed from stream __stream__
لقد ألغيت اشتراكك في تيار __ Stream__ |
Oops. I just realized the locale/en/translations.json file I have been using as the template was of the outdated format. That is it uses Just ran the script with the the newer format and pushed to master. So the issue mentioned above is no longer present. But let me update my script to see and run it again just to make sure that that there are other lines that are corrupt. |
Okay. Ran the script. There does not seems to be any issues with corrupted variables
https://gist.github.com/hackerkid/7cecbc9b1119674f49103b80071f8c90 |
I went through the translations(variables, escaping etc) to see if I can find any issues. I found some issues which is detailed below. If the issue was easily fixable for me, I would just fix it directly. Else I removed the translation so that the human translator can translate the string manually. Most of the time I found an issue, I also updated my translation verifier script so that it can check whether there are any other occurances of that issue. Some of the /commands got translated. I am just going to remove those translations {
"/dark (Toggle night mode)": "/ غامق (تبديل الوضع الليلي)",
"/day (Toggle day mode)": "/ يوم (تبديل وضع اليوم)",
"/fixed-width (Toggle fixed width mode)": "/ عرض ثابت (تبديل وضع العرض الثابت)",
"/fluid-width (Toggle fluid width mode)": "/ عرض السوائل (تبديل وضع عرض السوائل)",
"/light (Toggle day mode)": "/ ضوء (تبديل وضع النهار)",
"/me is excited (Display action text)": "/ أنا متحمس (عرض نص الإجراء)",
"/night (Toggle night mode)": "/ ليلاً (تبديل الوضع الليلي)",
"/poll Where should we go to lunch today? (Create a poll)": "/ استطلاع أين يجب أن نذهب لتناول الغداء اليوم؟ (إنشاء استطلاع)",
"/settings (Load settings menu)": "/ الإعدادات (تحميل قائمة الإعدادات)",
"/todo (Create a todo list)": "/ todo (إنشاء قائمة مهام)",
"Tip: You can also send \"/poll Some question\"": "نصيحة: يمكنك أيضًا إرسال \"/ استطلاع بعض الأسئلة\"",
} Strings with {
"<p>Stream will be announced in <b>#{notifications_stream}</b>.</p>": "<p style=\";text-align:right;direction:rtl\">سيتم الإعلان عن الدفق في <b># {notifications_stream}</b> .</p>",
"<p>The stream <b>{stream_name}</b> does not exist.</p><p>Manage your subscriptions <z-link>on your Streams page</z-link>.</p>": "<p style=\";text-align:right;direction:rtl\">الدفق <b>{stream_name}</b> غير موجود.</p><p style=\";text-align:right;direction:rtl\"> ادير مشاركاتك<z-link> على صفحة البث الخاصة بك</z-link> .</p>",
}
A shortcut seems to have translated {
"Filter topics (t)": "مواضيع التصفية (ر)",
} Variables of format {
"<p>Stream will be announced in <b>#{notifications_stream}</b>.</p>": "<p style=\";text-align:right;direction:rtl\">سيتم الإعلان عن الدفق في <b># {notifications_stream}</b> .</p>",
"Change stream permissions for #{stream_name}": "تغيير أذونات البث لـ # {stream_name}",
"Message #{stream_name}": "الرسالة رقم {stream_name}",
"Message #{stream_name} > {topic_name}": "الرسالة رقم {stream_name} > {topic_name}",
"{count} users are subscribed to #{title}": "{count} مستخدم مشترك في # {title}",
} When a variable is inside {
"Message {recipient_name} ({recipient_status})": "الرسالة {recipient_name} ( {recipient_status} )",
"{username} [said]({link_to_message}):": "{username} [قال] ( {link_to_message} ):",
"Check your email ({email}) to confirm the new address.": "تحقق من بريدك الإلكتروني ( {email} ) لتأكيد العنوان الجديد.",
"Drafts ({draft_count})": "مسودات ( {draft_count} )",
"Edited ({last_edit_timestr})": "محرر ( {last_edit_timestr} )",
} An extra space was added between the variable {
"Narrow to stream "{display_recipient}"": "ضيق للتدفق " {display_recipient} "",
"Narrow to stream "{display_recipient}", topic "{topic}"": "ضيق للدفق " {display_recipient} " ، الموضوع " {topic} "",
} Single quotes and double quotes were getting replaced with {
"Alert word \"{word}\" added successfully!": "تمت إضافة كلمة التنبيه " {word} " بنجاح!",
"We've replaced the \"{originalHotkey}\" hotkey with \"{replacementHotkey}\" to make this common shortcut easier to trigger.": "لقد استبدلنا مفتاح التشغيل السريع " {originalHotkey} {replacementHotkey} " لتسهيل تشغيل هذا الاختصار الشائع.",
"Are you sure you want to create stream ''''{stream_name}'''' and subscribe {count} users to it?": "هل أنت متأكد أنك تريد إنشاء تيار " ''{stream_name}'' " واشتراك {count} فيه؟",
"Default is {language}. Use 'text' to disable highlighting.": "الافتراضي هو {language} . استخدم "نص" لتعطيل التمييز.",
}
|
@timabbott I think at this point this PR should be ready for review from your side. I will also create a PR to include the script as well as documentation on how to generate these translations. |
Heads up @hackerkid, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
4ec3636
to
88b200c
Compare
Closing since this has became quite stale. |
The PR contains only the frontend translations. This was translated using
json-autotranslate
NPM package which make use of Google Cloud Translate API. They have a generous free tier so this was all in the free plan(500k chars free per month). I think this covers running the script a couple more times. After that we might get charged. Can't seem to see the eaxct charcter usage in dashboard. But the pricing is not that high anyway.Some of the variable names seems to have also been translated which is something we should fix before merging this.
I haven't gone through the translations properly. So there might be other issues as well.