Skip to content

Add Arabic translation#120

Closed
jermanuts wants to merge 1 commit intopynicolas:mainfrom
jermanuts:ar
Closed

Add Arabic translation#120
jermanuts wants to merge 1 commit intopynicolas:mainfrom
jermanuts:ar

Conversation

@jermanuts
Copy link
Contributor

No description provided.

Copy link
Owner

@pynicolas pynicolas left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the translation!

Please see the comments about plural forms.

Arabic would be the first right-to-left language in FairScan. Were you able to test the app with your translation?
I don't understand Arabic but I did a few tests and noticed two issues (which I believe are not blockers):

Comment on lines +72 to +75
<plurals name="files_saved_to">
<item quantity="one">حُفظ %2$s في %3$s</item>
<item quantity="other">حُفظ %1$d من الملفات في %3$s</item>
</plurals>
Copy link
Owner

Choose a reason for hiding this comment

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

This triggers a failure in an automated check (see https://github.com/pynicolas/FairScan/actions/runs/22554421820/job/65409818705?pr=120):

For locale "ar" (Arabic) the following quantities should also be defined: few (e.g. "3"), many (e.g. "11"), two (e.g. "2"), zero (e.g. "0") [MissingQuantity]

I honestly don't know whether this is a real problem for Arabic. We can disable the automated check on this string by adding tools:ignore="MissingQuantity". It's already done for some languages (see https://github.com/pynicolas/FairScan/blob/v1.15.0/app/src/main/res/values-it/strings.xml#L68)

Copy link
Contributor Author

@jermanuts jermanuts Mar 2, 2026

Choose a reason for hiding this comment

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

Arabic would be the first right-to-left language in FairScan. Were you able to test the app with your translation?

Yes, it does require Fairscan to support RTL. Is there some build I can install to test it out?

actually this is important, Arabic indeed require this form of plurals. Weblate makes this easier to translate see https://hosted.weblate.org/translate/geoshare/android-app/ar/?checksum=b1a973c0af6be020

https://docs.weblate.org/en/latest/user/translating.html#plurals

which I think needs to be like

<plurals name="page_count">
    <item quantity="zero">لا صفحات</item>
    <item quantity="one">%d صفحة</item>
    <item quantity="two">%d صفحتان</item>
    <item quantity="few">%d صفحات</item>
    <item quantity="many">%d صفحة</item>
    <item quantity="other">%d صفحة</item>
</plurals>

Comment on lines +76 to +79
<plurals name="page_count">
<item quantity="one">%d صفحة</item>
<item quantity="other">%d صفحات</item>
</plurals>
Copy link
Owner

Choose a reason for hiding this comment

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

Same as above.

@pynicolas pynicolas mentioned this pull request Mar 2, 2026
@pynicolas
Copy link
Owner

@jermanuts If it helps you, I created another PR based on yours: #124

  • It's based on a commit I just pushed to the main branch (d26f404) so that the APKs that are built during a PR build are attached. You may download APKs from https://github.com/pynicolas/FairScan/actions/runs/22594026136
  • It includes another commit (29e1b46) with:
    • the change you suggested for page_count
    • tools:ignore="MissingQuantity" for files_saved_to: I believe we should fix that

I understand that Weblate may make this work easier for non-developers. I will look into it but not in the short term.

@jermanuts
Copy link
Contributor Author

jermanuts commented Mar 2, 2026

Isn't automatic build of APKs based on PRs may attract bad actors? Unless these builds require some interaction from you which is fine.

I was going to add commits to add these plurals but it seems like your PR added xmlns:tools for some reason only to my -ar, shouldn't it be for main values file?

and the ignore for page_count is not necessarily as I can add plural to it too.


<plurals name="files_saved_to">
    <item quantity="zero">لم يُحفظ أي ملفات في %3$s</item>
    <item quantity="one">حُفظ %2$s في %3$s</item>
    <item quantity="two">حُفظ ملفين في %3$s</item>
    <item quantity="few">حُفظ %1$d ملفات في %3$s</item>
    <item quantity="many">حُفظ %1$d ملفًا في %3$s</item>
    <item quantity="other">حُفظ %1$d ملف في %3$s</item>
</plurals>

@pynicolas
Copy link
Owner

Isn't automatic build of APKs based on PRs may attract bad actors? Unless these builds require some interaction from you which is fine.

I don't think so. The APKs are built only as CI artifacts attached to the PR, with no secrets involved and no automatic release or distribution. And I need to manually trigger the build.

What I realize is that you probably can't install those APKs because they are not signed. So they don't really help.

I was going to add commits to add these plurals but it seems like your PR added xmlns:tools for some reason only to my -ar, shouldn't it be for main values file?

I added tools:ignore="MissingQuantity" only to the Arabic translation because that should be checked separately for each language: it may be OK to accept a missing quantity for a specific language and not for others.

and the ignore for page_count is not necessarily as I can add plural to it too.

That would be perfect.

@jermanuts
Copy link
Contributor Author

jermanuts commented Mar 3, 2026

I added tools:ignore="MissingQuantity" only to the Arabic

I meant this line but I think this is necessary for apk builds by github actions?

That would be perfect.

Yes, please add it to your PR (copy code block from my previous comment) and remove the ignore attribute.

@pynicolas
Copy link
Owner

I added tools:ignore="MissingQuantity" only to the Arabic

I meant this line but I think this is necessary for apk builds by github actions?

This change was required so that the XML file is valid: tools:ignore="MissingQuantity" was using a tools namespace that had to be defined with xmlns:tools="http://schemas.android.com/tools".

That would be perfect.

Yes, please add it to your PR (copy code block from my previous comment) and remove the ignore attribute.

Thanks. I added that to #124. That made it possible to drop tools:ignore="MissingQuantity" entirely from the file.

I then merged #124. Your commit is now on the main branch and the Arabic translation will be available in the next release. I will now close this PR.

Thanks a lot for your contribution!

@pynicolas pynicolas closed this Mar 3, 2026
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