[android]Enable per-app language #3584

Merged
Jean-BaptisteC merged 3 commits from language into master 2022-10-13 12:56:49 +00:00
Jean-BaptisteC commented 2022-10-11 18:54:45 +00:00 (Migrated from github.com)

This PR add ability to change app language only for OM on devices on Android 13.
More information here

  • List of languages is picked from directory values-{languages} in res directory.
  • To check if that works, used devices on Android 13 -> go to OM Android settings or language settings.

This PR cannot be merge because bump appcompat to 1.6.0 need update app theme -> check this organicmaps/organicmaps#3537 (comment)

This PR add ability to change app language only for OM on devices on Android 13. More information [here](https://developer.android.com/guide/topics/resources/app-languages) - List of languages is picked from directory values-{languages} in res directory. - To check if that works, used devices on Android 13 -> go to OM Android settings or language settings. This PR cannot be merge because bump appcompat to 1.6.0 need update app theme -> check this https://git.omaps.dev/organicmaps/organicmaps/issues/3537#issuecomment-1275106065
Jean-BaptisteC commented 2022-10-12 05:01:54 +00:00 (Migrated from github.com)

When i changed language in Android settings and i back to OM, app language have changed. But to update maps language we need to restart app. @biodranik Is it ok for you, i'm not sure user change language every day and restart app to update map is not big inconvenient.

When i changed language in Android settings and i back to OM, app language have changed. But to update maps language we need to restart app. @biodranik Is it ok for you, i'm not sure user change language every day and restart app to update map is not big inconvenient.
Owner
https://git.omaps.dev/organicmaps/organicmaps/pulls/3586
biodranik commented 2022-10-12 08:53:53 +00:00 (Migrated from github.com)

It is ok, maybe we can show some kind of hint about that? Or at least add it into the FAQ.

It is ok, maybe we can show some kind of hint about that? Or at least add it into the FAQ.
biodranik commented 2022-10-12 16:06:54 +00:00 (Migrated from github.com)

What about adding this?
image

What about adding this? <img width="904" alt="image" src="https://user-images.githubusercontent.com/170263/195393316-dcd621af-640f-4b5c-b770-c479003ef735.png">
biodranik (Migrated from github.com) reviewed 2022-10-12 16:07:33 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 16:07:33 +00:00

Are you sure about en-rGB? Should it be en-GB, as in the example?

Are you sure about en-rGB? Should it be en-GB, as in the example?
biodranik (Migrated from github.com) reviewed 2022-10-12 16:08:10 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 16:08:10 +00:00

Are you sure about these? In the example they use zh-Hant and zh-Hans. Can you please test if it works properly?

Are you sure about these? In the example they use zh-Hant and zh-Hans. Can you please test if it works properly?
biodranik (Migrated from github.com) reviewed 2022-10-12 16:08:15 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 16:08:15 +00:00

ditto

ditto
biodranik (Migrated from github.com) reviewed 2022-10-12 16:08:21 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 16:08:21 +00:00

ditto

ditto
biodranik (Migrated from github.com) reviewed 2022-10-12 16:08:28 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 16:08:27 +00:00

ditto

ditto
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-12 16:24:06 +00:00
Jean-BaptisteC (Migrated from github.com) commented 2022-10-12 16:24:06 +00:00

Check this

Check [this ](https://developer.android.com/guide/topics/resources/localization#avoid-creating-more-resource-files-and-text-strings-than-you-need)
Jean-BaptisteC commented 2022-10-12 16:55:53 +00:00 (Migrated from github.com)

What about adding this? image

I think the real interest is to reduce size of app by remove unused strings in libraries.

Edit:

  • I have add resConfigs in build.gradle in other branch. APK have lost 600Ko ~ in size.
  • Do you want i implement this configuration ?
> What about adding this? <img alt="image" width="904" src="https://user-images.githubusercontent.com/170263/195393316-dcd621af-640f-4b5c-b770-c479003ef735.png"> I think the real interest is to reduce size of app by remove unused strings in libraries. Edit: - I have add resConfigs in build.gradle in other branch. APK have lost 600Ko ~ in size. - Do you want i implement this configuration ?
Jean-BaptisteC commented 2022-10-12 16:59:48 +00:00 (Migrated from github.com)

It is ok, maybe we can show some kind of hint about that? Or at least add it into the FAQ.

  • I not sure, it's necessary to add something in FAQ (I have discover FAQ in app today :) ) because this feature is only available on devices used Android 13.

  • About map languages not synchronised when you changes language, maybe you can implement this with organicmaps/organicmaps#391

> It is ok, maybe we can show some kind of hint about that? Or at least add it into the FAQ. - I not sure, it's necessary to add something in FAQ (I have discover FAQ in app today :) ) because this feature is only available on devices used Android 13. - About map languages not synchronised when you changes language, maybe you can implement this with https://git.omaps.dev/organicmaps/organicmaps/issues/391
biodranik (Migrated from github.com) reviewed 2022-10-12 20:13:13 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 20:13:12 +00:00

Did you test these languages on your device? Did they work?

Did you test these languages on your device? Did they work?
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-12 20:26:40 +00:00
Jean-BaptisteC (Migrated from github.com) commented 2022-10-12 20:26:40 +00:00

I have test with english

  • en_US (default english)

-en_GB

I have test with english - en_US (default english) <img src="https://user-images.githubusercontent.com/87148630/195440640-b73e999b-9cf3-4e49-985e-7714a43fc1fc.png" height="500"/> -en_GB <img src="https://user-images.githubusercontent.com/87148630/195440840-e60d1b96-f4cc-49f7-a532-25a7b80b6bf1.png" height="500" />
biodranik (Migrated from github.com) reviewed 2022-10-12 20:54:05 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 20:54:05 +00:00

What about Chinese?

What about Chinese?
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-12 22:00:13 +00:00
Jean-BaptisteC (Migrated from github.com) commented 2022-10-12 22:00:12 +00:00

Examples:

  • pt
    delete (bottomsheet on map)=Eliminar

  • pt_BR(Brazil)
    delete=Apagar

Examples: - pt delete (bottomsheet on map)=Eliminar - pt_BR(Brazil) delete=Apagar
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-12 22:02:30 +00:00
Jean-BaptisteC (Migrated from github.com) commented 2022-10-12 22:02:30 +00:00

Examples:

  • fr (France)
    Translittération en latin (App settings)

  • fr_CA (Canada)
    Translittération vers l'alphabet latin (App settings)

Examples: - fr (France) Translittération en latin (App settings) - fr_CA (Canada) Translittération vers l\'alphabet latin (App settings)
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-12 22:05:14 +00:00
Jean-BaptisteC (Migrated from github.com) commented 2022-10-12 22:05:14 +00:00

Examples:

es (Spain)
Transliteración al latín (App settings)

es_MX (Mexico)
Transliteración al alfabeto latino (App settings)
Examples: es (Spain) Transliteración al latín (App settings) es_MX (Mexico) Transliteración al alfabeto latino (App settings)
rtsisyk reviewed 2022-10-13 08:18:00 +00:00

nit: new line

nit: new line
@ -0,0 +39,4 @@
<locale android:name="uk" />
<locale android:name="vi" />
<locale android:name="zh" />
<locale android:name="zh-HK" />

Are you sure here? I can see the following names in res/values:

  • values-zh-rHK
  • values-zh-rMO
  • values-zh-rTW
Are you sure here? I can see the following names in res/values: - values-zh-rHK - values-zh-rMO - values-zh-rTW
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-13 10:04:49 +00:00
Jean-BaptisteC (Migrated from github.com) commented 2022-10-13 10:04:49 +00:00

zh-Hans

zh-Hant

zh-Hans <img src="https://user-images.githubusercontent.com/87148630/195567788-6a039942-ab40-4cce-8516-395936283998.png" height="500"/> zh-Hant <img src="https://user-images.githubusercontent.com/87148630/195567911-36f497fb-1805-4ba7-9e57-2424da542700.png" height="500"/>
Jean-BaptisteC (Migrated from github.com) reviewed 2022-10-13 10:13:19 +00:00
@ -0,0 +39,4 @@
<locale android:name="uk" />
<locale android:name="vi" />
<locale android:name="zh" />
<locale android:name="zh-HK" />
Jean-BaptisteC (Migrated from github.com) commented 2022-10-13 10:13:19 +00:00

add zh-HK or zh-rHK have none difference, because string name file contains r is just use tu specifie when you have some strings only for country.
Examples:
If i want translate all strings for Great Britain, i create res file with this name values-en-GB
If i want only translate special strings for Great Britain, i create res file with this name values-en-rGB. (And strings not translate in this file are take from values-en or values.

I have test with r and without, 0 difference.

https://developer.android.com/guide/topics/resources/localization#avoid-creating-more-resource-files-and-text-strings-than-you-need

add zh-HK or zh-rHK have none difference, because string name file contains `r` is just use tu specifie when you have some strings only for country. Examples: If i want translate all strings for Great Britain, i create res file with this name values-en-GB If i want only translate special strings for Great Britain, i create res file with this name values-en-rGB. (And strings not translate in this file are take from values-en or values. I have test with `r` and without, 0 difference. https://developer.android.com/guide/topics/resources/localization#avoid-creating-more-resource-files-and-text-strings-than-you-need
biodranik (Migrated from github.com) approved these changes 2022-10-13 12:54:14 +00:00
biodranik (Migrated from github.com) commented 2022-10-13 12:53:50 +00:00
</locale-config>

```suggestion </locale-config> ```
biodranik (Migrated from github.com) reviewed 2022-10-13 12:55:04 +00:00
@ -0,0 +39,4 @@
<locale android:name="uk" />
<locale android:name="vi" />
<locale android:name="zh" />
<locale android:name="zh-HK" />
biodranik (Migrated from github.com) commented 2022-10-13 12:55:03 +00:00

I've read the docs and confirm that the new locale format should work. We use the old one, pre-Android 7 for our resources because we need to support Android 5 and 6.

I've read the docs and confirm that the new locale format should work. We use the old one, pre-Android 7 for our resources because we need to support Android 5 and 6.
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#3584
No description provided.