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

Formatter crash due to urdu alphabet #2940

Closed
3 tasks done
B0pol opened this issue Jan 9, 2020 · 8 comments
Closed
3 tasks done

Formatter crash due to urdu alphabet #2940

B0pol opened this issue Jan 9, 2020 · 8 comments
Labels
bug Issue is related to a bug localisation / translation Everything that has to do with translations or Weblate

Comments

@B0pol
Copy link
Member

B0pol commented Jan 9, 2020

Urdu strings import_soundcloud_instructions and did_you_mean are causing crash.
Here is the crash log :

Exception

  • User Action: ui error
  • Request: App crash, UI failure
  • Content Language: GB
  • Service: none
  • Version: 0.18.0
  • OS: Linux Android 8.1.0 - 27
Crash log

java.util.UnknownFormatConversionException: Conversion = 'End of String'
	at java.util.Formatter$FormatSpecifierParser.peek(Formatter.java:2641)
	at java.util.Formatter$FormatSpecifierParser.<init>(Formatter.java:2602)
	at java.util.Formatter.parse(Formatter.java:2557)
	at java.util.Formatter.format(Formatter.java:2504)
	at java.util.Formatter.format(Formatter.java:2458)
	at java.lang.String.format(String.java:2770)
	at androidx.preference.ListPreference.getSummary(ListPreference.java:178)
	at androidx.preference.Preference.onBindViewHolder(Preference.java:584)
	at androidx.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:381)
	at androidx.preference.PreferenceGroupAdapter.onBindViewHolder(PreferenceGroupAdapter.java:45)
	at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
	at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:286)
	at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:343)
	at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:359)
	at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:366)
	at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:397)
	at android.os.Handler.handleCallback(Handler.java:790)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6494)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)


I exactly know why it's crashing but can't fix it (alphabet weirdies)

The string in english : <string name="did_you_mean">Did you mean: %1$s\?</string>
In urdu : <string name="did_you_mean">کیا آپ کا مطلب تھا: %1$s \?</string>
as you can see %1$s is not in the right order

same for import_soundcloud_instructions :
English : <string name="import_soundcloud_instructions">Import a SoundCloud profile by typing either the URL or your ID:\n\n1. Enable \"desktop mode\" in a web-browser (the site is not available for mobile devices)\n2. Go to this URL: %1$s\n3. Log in when asked\n4. Copy the profile URL you were redirected to.</string>
Urdu :

\n
\n1. ویب براؤزر میں \"ڈیسک ٹاپ موڈ\" کو فعال کریں (سائٹ موبائل آلات کے لئے دستیاب نہیں ہے)
\n2. اس URL پر جائیں: %1 $ s
\n3. پوچھا گیا میں لاگ ان کریں
\n4. پروفائل یو آر ایل کاپی کریں جو آپ کو ہدایت کی گئی تھی.</string>```

If someone succes to make %1$s in the right order, it will be fixed.
@Stypox Stypox added bug Issue is related to a bug localisation / translation Everything that has to do with translations or Weblate labels Jan 9, 2020
@TobiGr
Copy link
Member

TobiGr commented Jan 9, 2020

Thanks!
We might need to add some scripts which check the translations for these kind of issues. I recently saw plural translations which did not have any %1 arguments although the source strings had.
IIRC the F-Droid project wrote some python scripts to check translations. But I don't know what they do exactly.

@B0pol
Copy link
Member Author

B0pol commented Jan 10, 2020

To be precise, with urdu :
Lines causing app crash :

Lines that have %1$s wrongly written and it's not causing crash :

Lines that are missing %1$s or %s (then it's not causing crash but content is missing) :

@abusarimhindi
Copy link
Contributor

To be precise, with Urdu :
Lines causing app crash :

Lines that have %1$s wrongly written and it's not causing crash :

Lines that are missing %1$s or %s (then it's not causing crash but content is missing) :

Edited all above said strings.
Now reviewing all the translated Urdu strings.

I have previous experience of localization of some apps, i.e. Telegram, Mobogram, Facebook, Graph Messenger, etc. Also translated many bots of the Telegram.

@B0pol
Copy link
Member Author

B0pol commented Jan 24, 2020

Great job!
I took the file from weblate and tested it, everything is solved except 1 strings:

Lines causing app crash
line 356 when you load subscriptions / import-export subscriptions / Soundclound.

@abusarimhindi

By the way, I don't know if we can do something about it:
Links are working, clickable, but are displayed badly:

@abusarimhindi
Copy link
Contributor

Great job!
I took the file from weblate and tested it, everything is solved except 1 strings:

Lines causing app crash
line 356 when you load subscriptions / import-export subscriptions / Soundclound.

@abusarimhindi

By the way, I don't know if we can do something about it:
Links are working, clickable, but are displayed badly:

I checked and rectified.
The reason of this badly display is RTL & LTR combination. How could the URL start from RTL?

@abusarimhindi
Copy link
Contributor

One problem is with me when I am applying Urdu language on the NewPipe app, the interface still remains in English.

@B0pol
Copy link
Member Author

B0pol commented Jan 24, 2020

One problem is with me when I am applying Urdu language on the NewPipe app, the interface still remains in English.

This is the normal behaviour, content language is used to get content with service, and the language displayed in NewPipe is phone's language.
In #2921 , I added a "NewPipe's language" selector, which allows to change the app language with only restarting the app, changing system's language is not needed.

The APK is available in the last comment, if you wanna test.

@B0pol
Copy link
Member Author

B0pol commented Jan 24, 2020

I close this issue as it will be solved as soon as someone update strings with Weblate.
Feel free to open an issue for the related problem that @TobiGr mentionned here #2940 (comment), some other language are missing %1$s or %s.

@B0pol B0pol closed this as completed Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug localisation / translation Everything that has to do with translations or Weblate
Projects
None yet
Development

No branches or pull requests

4 participants