streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.9k stars 357 forks source link

App closes immediately when tapping About from the menu while using Finnish language #5396

Closed lliehu closed 11 months ago

lliehu commented 11 months ago

It looks like StreetComplete immediately closes when trying to open the About screen while using Finnish as the user interface language. Tested several other languages (English, Swedish, Norwegian, German, Japanese, Russian, and a few more) and this problem did not occur.

How to Reproduce

  1. Open StreetComplete.
  2. Switch user interface language to suomi - Finnish (Menu > Settings > Switch language).
  3. Go back to main screen.
  4. Tap on the menu.
  5. Tap "Tietoa" (Finnish equivalent of "About").

Expected Behavior The About screen opens, with version history, credits and so on.

Versions affected At least v55.1 but I have a vague memory of seeing this also earlier.

Helium314 commented 11 months ago

The crash seems to hapen because the Finnish translation of about_description_translate is badly formatted.

matkoniecz commented 11 months ago

bad translation should be fixable by anyone if you follow https://github.com/streetcomplete/StreetComplete/blob/master/CONTRIBUTING.md#translating-the-app

( but if you run into login issues see https://github.com/streetcomplete/StreetComplete/issues/5393 )

westnordost commented 11 months ago

fixed it in poeditor

HolgerJeromin commented 11 months ago

But should a translation be able to crash an app?

westnordost commented 11 months ago

IMO it shouldn't, but it is not my decision.

HolgerJeromin commented 11 months ago

Just as a reference for the curious. fi translation had a missing % in %2$d%%: https://github.com/streetcomplete/StreetComplete/blob/593596fb0e4ec8d9ee57d14e09d9611353ddaeaa/app/src/main/res/values/strings.xml#L311 vs https://github.com/streetcomplete/StreetComplete/blob/593596fb0e4ec8d9ee57d14e09d9611353ddaeaa/app/src/main/res/values-fi/strings.xml#L737

riQQ commented 11 months ago

This is reported as information (?) when building.

> Task :app:mergeDebugResources /home/runner/work/StreetComplete/StreetComplete/app/src/main/res/values-fi/strings.xml:53:4: Multiple substitutions specified in non-positional format of string resource string/about_description_translate. Did you mean to add the formatted="false" attribute?

streetcomplete build error in strings

lliehu commented 11 months ago

Interesting. Actually, it looks like the intention was to not have any percentage symbol in the Finnish translation. The wording "on 98%-prosenttisesti käännetty" is incorrect whereas "on 98-prosenttisesti käännetty" is correct. Probably that's why it was removed but perhaps the localizer did not know or notice that they need to remove two of them or it will cause a crash. Just fixed this in POEditor. Thanks for finding the problem.