Cwa-app-android: Transnational country list names displayed in English when system is German

Created on 19 Dec 2020  Â·  7Comments  Â·  Source: corona-warn-app/cwa-app-android

Avoid duplicates

  • [X] Bug is not mentioned in the FAQ
  • [X] Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • [X] Bug is not already reported in another issue

Technical details

  • Device name: Samsung Galaxy A50 SM-A505FN
  • Android version: 10
  • App version: 1.9.1

Describe the bug

The country names are shown in English when the system language is set to Deutsch (Deutschland).
This is a regression from version 1.7.1 (see screenshots from previous version in https://github.com/corona-warn-app/cwa-app-android/issues/1872#issuecomment-743124411)

Steps to reproduce the issue

  1. Set Android system language to Deutsch (Deutschland)
  2. Tap RISIKO-ERMITTLUNG AKTIV
  3. Tap Länderübergreifende Risiko-Ermittlung
  4. Scroll down to heading "Derzeit nehmen die folgenden Länder an der länderübergreifenden Risiko-Ermittlung teil:"

Country_list_1 9 1_de

Expected behaviour

The names of the countries should be shown in German when the system language is set to German.

Possible Fix

Use German country names when the UI is set to German and sort the names according to their German names.

Additional context

See also https://github.com/corona-warn-app/cwa-app-android/issues/1957 regarding sorting.


Internal Tracking ID: EXPOSUREAPP-4416

bug mirrored-to-jira

All 7 comments

ok, thanks, in iOS this not an issue. Thanks, DS


Internal Tracking ID: EXPOSUREAPP-4416
Corona-Warn-App Open Source Team

Android 10 with Android security update: November 1st, 2020
Nokia 7.1, Build: 00WW_4_16B_SP01
CWA version: 1.9.1
ENF: 18204713000

No problems here:

CWA 1 9 1 - Country-Info

Best regards.

@Jo-Achim, ok! Interesting. Thanks for the information, will be forwarded to devs. DS

@Jo-Achim
Thanks for your screen shot!
The problem was changing the language from English to German without closing and re-opening CWA.
Android apps are supposed to cope with this, but this is a minor problem if the work-around is simply to restart the app.

This issue occurs because of the usage of

https://github.com/corona-warn-app/cwa-app-android/blob/5bfc89c1d91bf8afd6aa610dbd611b4515d30e46/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/util/ui/LazyString.kt#L9-L15

in

https://github.com/corona-warn-app/cwa-app-android/blob/5bfc89c1d91bf8afd6aa610dbd611b4515d30e46/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/view/CountryListView.kt#L23-L29

After you changed the language the cached string still stays the same obviously. I'm not 100% sure what was the idea to use this approach of a cached string. It could be fixed (already tried) by simply using context.getString(it.labelRes) at this point but maybe there was a good reason (performance or anything like that?) to use cached strings.
Another approach would be to store the language code to the cached string as well but then you would have to look up the language code each time you try to get the string. Not sure, if that isn't even worse in performance.

Maybe @maugst can say something about it. I could then open a new PR to also match the sorting reintroduced in #1961

@PhilippNowak96, thanks, I forwarded your post to the developer's ticket. Best, DS

An alternative could be to carry a (global) 'cache valid flag' that determines whether the cache data is used or renewed.
Especially if the problem exists multiple times.

Was this page helpful?
0 / 5 - 0 ratings