Skip to content
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

feat(i18n): Add Persian translation #2535

Merged
merged 6 commits into from
Mar 4, 2024
Merged

Conversation

mehr32
Copy link
Contributor

@mehr32 mehr32 commented Dec 28, 2023

Hello, Farsi translation for elk with the help of friends:
@DrCode32
@sadraiiali

Copy link

stackblitz bot commented Dec 28, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Dec 28, 2023

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 926a59b
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/658db4ef8d692d0008e379c3

Copy link

netlify bot commented Dec 28, 2023

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 926a59b
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/658db4efcface700079ddeed
😎 Deploy Preview https://deploy-preview-2535--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@userquin userquin changed the title Add Persian translation feat(i18n): Add Persian translation Dec 28, 2023
@userquin
Copy link
Member

userquin commented Dec 28, 2023

locales/fa-IR.json Outdated Show resolved Hide resolved
@userquin
Copy link
Member

userquin commented Dec 28, 2023

I'm fixing some entries in the json file, also adding the locale to be displayed in the settings, can you provide the persian locale in persian (fa-IR)?

imagen

@userquin
Copy link
Member

فارسی

imagen

@userquin
Copy link
Member

userquin commented Dec 28, 2023

The docs not working and so we cannot check missing/outdated entries, here transaltion status from the json file (outdated entries should be removed and for missing, you should add them:

fa-IR translation status
"missing": [
      "compose.draft_title",
      "compose.drafts",
      "report.limiting",
      "report.mute_desc",
      "report.other",
      "report.other_desc",
      "report.reporting",
      "report.select_many",
      "report.select_one",
      "report.select_posts",
      "report.select_posts_other",
      "report.spam",
      "report.spam_desc",
      "report.submit",
      "report.unfollow_desc",
      "report.violation",
      "report.whats_wrong_account",
      "report.whats_wrong_post",
      "search.search_desc",
      "search.search_empty"
    ],
    "outdated": [
      "menu.open_in_original_site_2",
      "report.report.limiting",
      "report.report.mute_desc",
      "report.report.other",
      "report.report.other_desc",
      "report.report.reporting",
      "report.report.select_many",
      "report.report.select_one",
      "report.report.select_posts",
      "report.report.select_posts_other",
      "report.report.spam",
      "report.report.spam_desc",
      "report.report.submit",
      "report.report.unfollow_desc",
      "report.report.violation",
      "report.report.whats_wrong_account",
      "report.report.whats_wrong_post",
      "report.search.search_desc",
      "report.search.search_empty"
    ],

You also need to review lines 249 and 250, it seems you've duplicated entries with same translation: open_in_original_site and open_in_original_site2: keep only 1 using open_in_original_site key.

EDIT: review also the plurals entries, I just copy/paste it from ar-EG (a few lines above) in config/i18n.ts module.

"profile_description": "توضیحات بالای صفحه پروفایل {0}",
"profile_personal_note": "یادداشت شخصی",
"profile_unavailable": "پروفایل در دسترس نیست",
"reject": "رد درخواست دنبال‌ کردن",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't رد درخواست enough for this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why, I'll fix it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just shorter and smoother.

},
"error": {
"account_not_found": "حساب {0} یافت نشد",
"explore_list_empty": "هیچ چیز داغی الآن وجود ندارد. بعداً بررسی کنید!",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of داغ can we have تازه ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is a problem. It looks smoother

"title": "ناوبری"
}
},
"sequence_then": "سپس"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why سپس ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think در ادامه دنباله is a better translation

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly

"dialog_header": "میانبرهای صفحه‌کلید",
"groups": {
"actions": {
"boost": "بوست",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't بوست english?
any other alternative? but it's ok after all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He is not, this is not correct in Farsi. A better translation is تقویت

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much, feel free to work on the issues, I just tried reviewing your amazing PR! Thank you.

I think تقویت means strengthening more! but let's go with it.

@mehr32
Copy link
Contributor Author

mehr32 commented Dec 28, 2023

@userquin
You can easily tell me the problems that exist so that I can correct them. I didn't understand what you meant
And that
@Aslemammad
Will you correct these things that you said or should I correct them myself?

@userquin
Copy link
Member

@mehr32 there is no problem, you should remove the outdated entries, not being used in Elk. You also need to include the missing entries

@mehr32
Copy link
Contributor Author

mehr32 commented Dec 28, 2023

I reviewed the translation. Well, I don't know which ones are not used! I have considered the English Jason file as the base and translated it based on its values

One fact is that Elk does not have a good translation structure at all, you have to accept this! Why not use .po and .mo files? Why don't you make it simple to distinguish the translation file from changing the config file in a few lines of code?

@mehr32
Copy link
Contributor Author

mehr32 commented Dec 28, 2023

I want to see why the app name is the same as "نام نرم‌افزار" in the preview? This is really bad, let me fix it

@userquin
Copy link
Member

Why not use .po and .mo files?

do you have any ref/doc? we're using nuxt i18n module, I've no idea if supporting those formats.

@userquin
Copy link
Member

Why don't you make it simple to distinguish the translation file from changing the config file in a few lines of code?

What do you mean?

@mehr32
Copy link
Contributor Author

mehr32 commented Dec 28, 2023

In the corner of the screen, instead of Elk, the value of "نام نرم‌فزار" was displayed, which means the "name of the app"

@mehr32
Copy link
Contributor Author

mehr32 commented Dec 28, 2023

i18n does not support .po or .mo directly, but it seems to be possible to implement it with gettext-parser in JavaScript and converting the file to an object. In general, I work with Python and do not know much

@mehr32
Copy link
Contributor Author

mehr32 commented Dec 28, 2023

I think the correct translation has been used now. How can I have a preview?

@userquin
Copy link
Member

userquin commented Dec 28, 2023

How can I have a preview?

Go to home, and click on update button (when new version ready)

@userquin
Copy link
Member

userquin commented Dec 28, 2023

@mehr32 you should open PR preview in private browsing, this way when closing the window pwa resources will be automatically removed, between commits you can just close the private browsing window and reopen a new one, you'll get a fresh copy with a new fresh service worker (browser caches empty)

@userquin
Copy link
Member

userquin commented Jan 6, 2024

@mehr32 (not related directly with this PR) check LTR/RTL content support here #2545 and https://main.elk.zone (check #2541)

@patak-dev patak-dev added this pull request to the merge queue Mar 4, 2024
Merged via the queue into elk-zone:main with commit c01a15c Mar 4, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants