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

App manifest: use only supported locales #200

Merged
merged 1 commit into from Apr 7, 2020
Merged

App manifest: use only supported locales #200

merged 1 commit into from Apr 7, 2020

Conversation

stephanebisson
Copy link
Collaborator

Phabricator Link: https://phabricator.wikimedia.org/T248675

Problem Statement

KaiOS has a limited set of supported language. For displaying basic app information in the store, it needs the exact language codes it knows about. For instance, it supports both fr-CA and fr-FR and needs to see those codes exactly in the manifest. It won't pick up translations simply for fr.

Solution

Generate the manifest locales from the lists of supported locales for KaiOS and Jio and map to the i18n files as needed.

'or-IN',
'pa-IN',
'sa-IN',
'sd-IN', // RTL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RTL stands for right to left, correct?

@medied
Copy link
Contributor

medied commented Apr 6, 2020

This seems to be working well. Here's the test that I did with the banana phone:

  • First, I changed the language of the device (under the KaiOS settings) to Brazilian Portuguese
  • Then I deployed this branch onto device with usual npm run deploy method
  • Upon successful deployment, opened up the Wikipedia app and it was set to Portuguese right from the start (onboarding screens where in Portuguese)

The above makes sense to me and my understanding is that's the behavior we are looking for. At this point I was able to switch the app language through the app normally, and set it back to Portuguese at the end.

After that:

  • I switched the language of device (under the KaiOS settings again) to Spanish (Latam).
  • Then (without redeploying) I opened the app again, and the app was still in Portuguese.

This also makes sense to me, I'm assuming that's expected behavior as well.

@hueitan
Copy link
Member

hueitan commented Apr 7, 2020

I tried to run it locally (on my Windows environment), it seems like the translation is not correct.

Is that only Windows env.? how it looks like in Mac env.?

Or is that my local doesn't have the language supported?

image

@stephanebisson
Copy link
Collaborator Author

Is that only Windows env.? how it looks like in Mac env.?

The encoding is messed up for you. What does it look like when you open i18n/fr.json?

@medied
Copy link
Contributor

medied commented Apr 7, 2020

This is what I get from Mac env:

image

@hueitan
Copy link
Member

hueitan commented Apr 7, 2020

it looks good to me in fr.json file

"app-title": "Wikipédia",
"app-subtitle": "L’encyclopédie libre",
"app-description": "Avec l’application libre Wikipédia, cherchez et explorez des informations du monde entier en plus de 300 langues.",

@hueitan
Copy link
Member

hueitan commented Apr 7, 2020

This is what I get from Mac env:

Ooo.. then forget about Windows env.

@hueitan
Copy link
Member

hueitan commented Apr 7, 2020

I can't find the locale in the supported locales, we added them to language file before for Bodo Goan Konkani #156, are these languages we can skip?

@stephanebisson
Copy link
Collaborator Author

I can't find the locale in the supported locales, we added them to language file before for Bodo Goan Konkani #156, are these languages we can skip?

We only want the languages that are supported by KaiOS or Jio.

This is to display the app info in the store in the same language as the phone. If there's no way to set your phone to Bodo, then there is no need for this translation in the manifest.

Copy link
Member

@hueitan hueitan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@stephanebisson stephanebisson merged commit 65d1384 into master Apr 7, 2020
@stephanebisson stephanebisson deleted the T248675 branch April 7, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants