refactor: add missing translations in fa.json#5410
Conversation
fix Persian translation
|
Hi @farshidinanloo! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
✔️ [V2] 🔨 Explore the source changes: 820f826 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/612a724222e06000087c97a2 😎 Browse the preview: https://deploy-preview-5410--docusaurus-2.netlify.app |
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5410--docusaurus-2.netlify.app/ |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
lex111
left a comment
There was a problem hiding this comment.
@farshidinanloo do you have a desire to provide a missing translation for other messages in this file? Maybe you could do that in this PR?
|
@massoudmaboudi can you help review this change? |
|
@lex111 @massoudmaboudi |
There was a problem hiding this comment.
Thanks but this is not exactly what we wanted 😅
Also if there is a problem with a date, please give much more details (screenshot, URL, date displayed when using English locale...) or something because it's hard to understand what you are talking about here. Have you noticed that it's written the date is simulated in dev?
| @@ -1,18 +1,32 @@ | |||
| { | |||
| "theme.AnnouncementBar.closeButtonAriaLabel": "بستن", | |||
| "theme.AnnouncementBar.closeButtonAriaLabel___DESCRIPTION": "برچسب ARIA دکمه بستن در نوار اعلانات", | |||
There was a problem hiding this comment.
please don't add/translate fields with ___DESCRIPTION, those are only in the base file to help you with additional context about the string to translate 🤪
Let me know how we can make this clearer
| "theme.lastUpdated.lastUpdatedAtBy": "آخرین بروزرسانی در {atDate} توسط {byUser}", | ||
| "theme.lastUpdated.lastUpdatedAtBy": "آخرین بروزرسانی {atDate} {byUser}", | ||
| "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": "→ بازگشت به منو اصلی", | ||
| "theme.navbar.mobileVersionsDropdown.label": "Versions", |
There was a problem hiding this comment.
The missing translations"we talk about are keys that are already in this file, such as this one (theme.navbar.mobileVersionsDropdown.label)
You are not supposed to add keys from base.json, just make sure all the keys already there are properly translated
| "theme.lastUpdated.atDate": " در تاریخ {date}", | ||
| "theme.lastUpdated.byUser": " توسط {user}", | ||
| "theme.lastUpdated.lastUpdatedAtBy": "آخرین بروزرسانی در {atDate} توسط {byUser}", | ||
| "theme.lastUpdated.lastUpdatedAtBy": "آخرین بروزرسانی {atDate} {byUser}", |
There was a problem hiding this comment.
doesn't this lead to duplicate spaces?
Because theme.lastUpdated.atDate alrready contains a space (on purpose).
Other languages usually don't add spaces in theme.lastUpdated.lastUpdatedAtBy.
Please double-check for potentially duplicated spaces. I believe the correct form may be:
"theme.lastUpdated.lastUpdatedAtBy": "آخرین بروزرسانی{atDate}{byUser}",The spaces are in {atDate}{byUser} because both of those variables are optional
There was a problem hiding this comment.
@slorber
sorry about adding wrong translations 😁
and about spaces you are right this is true form: {atDate}{byUser}
I role back the changes and fix this spaces
and the date in the snapshot is 1397/07/22 but in Solar Hijri calendar we are in year 1400, I try to add demo link
thank you
|
Thanks There are others untranslated strings in this file that you could also translate. I see these 2:
Yes that would be useful because I have no idea about this calendar what's the problem here 🤪 The code we use to format blog post dates is: new Intl.DateTimeFormat("fa", {
day: 'numeric',
month: 'long',
year: 'numeric',
timeZone: 'UTC',
}).format(new Date())Isn't it correct? Do you have another alternative JS solution using the Intl API to print the correct date? |
|
@slorber but look at this demo I notice the date in local development and production is different when locale config is fa in local it show wrong Solar Hijri calendar as I said before and in production it show Gregorian date. please look at this demo: https://docs-test-date.netlify.app/ |
|
Thanks 👍 Please take a look at this other PR, suggesting to use slightly different fa translations: #5434 |
|
About the calendars, thanks, I was able to figure out the problem and opened a dedicated issue: #5440 |
|
@slorber |

fix Persian translation
Motivation
there is repetitive word in translation:

the correct one is like this:
