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

Add Persian translation #690

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

YektaDev
Copy link

@YektaDev YektaDev commented Aug 28, 2024

This PR adds Persian translation.

@bglw
Copy link
Contributor

bglw commented Sep 23, 2024

Hi @YektaDev ! 👋

Sorry for the delay — I have a couple of RTL language PRs open waiting, as I haven't done any work to ensure that Pagefind's UI works when displayed RTL. Would you have any insight into whether changes would be needed on Pagefind's side to support RTL language?

@YektaDev
Copy link
Author

YektaDev commented Sep 23, 2024

Hi @bglw!

Thanks for following up! I've seen a few tweaked previews where the Persian translation was manually provided, and overall, it worked quite well (with the test assuming the element is inside a page or a wrapper that has dir="auto"). One key adjustment that would be really necessary for full RTL support is swapping the positions of the search icon and the clear button. This one wouldn't be taken care of in case of adding the dir="auto" attribute.

I haven't observed any issues other than this. Feel free to reach out if you'd like more input!

p.s. The container also had the following direction-related styles:

text-align: start;
unicode-bidi: plaintext;

@YektaDev
Copy link
Author

Another point to mention is, the number assigned to [COUNT] should be localized, if it isn't already. For the implementation, number.toLocaleString(locale) gets the job done.

For example, in Persian:

  • Non-localized: "1 نتیجه برای تست یافت شد"
  • Localized: "۱ نتیجه برای تست یافت شد"

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.

2 participants