CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.51k stars 115 forks source link

Observations: Issues with RTL / Persian in `v1.2.0` #734

Open YektaDev opened 19 hours ago

YektaDev commented 19 hours ago
  1. Number formatting. For some reason—even though it's mentioned that numbers are already being formatted—I’m seeing "1 نتیجه برای تست یافت شد" instead of "۱ نتیجه برای تست یافت شد". Am I missing something?
    console.log(new Intl.NumberFormat('fa').format(1)); // Returns ۱, the expected value
  2. The buttons are incorrectly placed.
    As previously mentioned, the positions of the Search and Clear buttons need to be swapped in all RTL layouts, but this behavior doesn't seem to have been implemented yet.
bglw commented 2 hours ago

👋 Thanks for the quick feedback!

Regarding the number formatting, can you provide a screenshot, or a link to a page exhibiting the issue? Here's the relevant code, where translations.language will be fa. Unsure what could be causing an issue here. https://github.com/CloudCannon/pagefind/blob/596a56e9f35798742ed7023673e69cfec57395e6/pagefind_ui/default/svelte/ui.svelte#L308-L313

Regarding the buttons — yes I didn't get that into the 1.2.0 release, but will make sure it's in the next release (1.2.1 or 1.3.0) along with any other feedback that is surfaced 🙂

bglw commented 2 hours ago

Actually, I think I see the issue here. That check should also be looking at automatic_translations.language — I'll put a test case into the suite and get that fixed up.