You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java java.util.Locale is currently used in various places, most of them in the UI. Features used are (non-exhaustive list):
access language code, country code and script code of user's locale
access the display names of languages, countries and scripts in the user's locale
to correctly upper-, lower- and titlecase words
to correctly format decimals (e.g. in German, decimals are separated by a comma from the number, not a point)
to set the app's locale and the map's locale to whatever has been set by the language selector
And also:
get the localized names of months and weekdays (using java.text.DateFormatSymbols) (for monthday and weekday picker)
format time correctly (using java.text.DateFormat / java.time.format.DateTimeFormatter) (for wherever a time is displayed)
This functionality must be replaced with something that works on multiplatform.
Migration
In some places, Locale is just used as a key in a map or something. These could be just replaced by a string, i.e. the IETF BCP 47 language tag (e.g. "de-DE") to remove any dependency to any sort of specific Locale implementation.
NSLocale
The iOS equivalent of java.util.Locale is NSLocale. On first glance, it has all the features that the Java version has. So, a simple actual / expect implementation may be possible.
However, at the time of writing, it is very fresh, so there are no guarantees about stability, continuous maintenance of the library etc. Additionally, it may have many features that we don't need while lacking others that we may need.
Date and time format
We are using kotlinx-datetime for anything date/time-related (as a replacement for Java 8 Date/Time classes). However, this library is missing any (locale-aware) formatting of these. Though it is planned to add support for formatting dates and times in the next major release 0.6.0 (see Kotlin/kotlinx-datetime#251), this is still not the Java locale-aware date/time formatting.
The iOS equivalent of date formatting is NSDateFormatter, so at the time of writing, a simple actual / expect implementation may be possible.
The text was updated successfully, but these errors were encountered:
Requires #5412.
Java
java.util.Locale
is currently used in various places, most of them in the UI. Features used are (non-exhaustive list):access language code, country code and script code of user's locale
access the display names of languages, countries and scripts in the user's locale
to correctly upper-, lower- and titlecase words
to correctly format decimals (e.g. in German, decimals are separated by a comma from the number, not a point)
to set the app's locale and the map's locale to whatever has been set by the language selector
And also:
get the localized names of months and weekdays (using
java.text.DateFormatSymbols
) (for monthday and weekday picker)format time correctly (using
java.text.DateFormat
/java.time.format.DateTimeFormatter
) (for wherever a time is displayed)This functionality must be replaced with something that works on multiplatform.
Migration
In some places,
Locale
is just used as a key in a map or something. These could be just replaced by a string, i.e. the IETF BCP 47 language tag (e.g. "de-DE") to remove any dependency to any sort of specific Locale implementation.NSLocale
The iOS equivalent of
java.util.Locale
isNSLocale
. On first glance, it has all the features that the Java version has. So, a simpleactual
/expect
implementation may be possible.multiplatform-locale
There is one multiplatform library that already does the wrapping: https://github.com/vanniktech/multiplatform-locale
However, at the time of writing, it is very fresh, so there are no guarantees about stability, continuous maintenance of the library etc. Additionally, it may have many features that we don't need while lacking others that we may need.
Date and time format
We are using
kotlinx-datetime
for anything date/time-related (as a replacement for Java 8 Date/Time classes). However, this library is missing any (locale-aware) formatting of these. Though it is planned to add support for formatting dates and times in the next major release 0.6.0 (see Kotlin/kotlinx-datetime#251), this is still not the Java locale-aware date/time formatting.The iOS equivalent of date formatting is
NSDateFormatter
, so at the time of writing, a simpleactual
/expect
implementation may be possible.The text was updated successfully, but these errors were encountered: