[System] App name in Permission dialog is not translated.

RESOLVED FIXED

Status

Firefox OS
Gaia::System
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Leo, Assigned: alive)

Tracking

unspecified
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(b2g-v1.2 fixed, b2g-v1.3 fixed)

Details

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

4 years ago
Created attachment 803388 [details]
Repro steps

1. Title : [System] App name in Permission dialog is not translated.
2. Precondition : Run Camera app for the first time after reset.
3. Tester's Action : Wait for the geolocation permission dialog.
4. Detailed Symptom : The app name in the permission dialog is not translated.
5. Expected : It is expected to be displayed in the corresponding language.
6. Reproducibility: Y
1) Frequency Rate : 100%
7. Personal email id : hanj.kim25@gmail.com
(Reporter)

Comment 1

4 years ago
Created attachment 803416 [details]
Pull request for v1-train
Attachment #803416 - Flags: review?(alive)
This string is provided from gecko, and it should be localized before. I don't know who regresses this from gecko..
http://mxr.mozilla.org/mozilla-central/source/b2g/components/ContentPermissionPrompt.js#255
http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/AppsUtils.jsm#525

Fabrice, I don't recommend that we let gecko do the l10n stuff. And for some reason it seems doesn't get the locale info correctly. No any other gecko -> gaia communication provides the localized string. I don't know why permission request needs to do this for gaia.
Proposed change:
We shall provide manifest or manifestURL in ContentPermissionPrompt event detail to let Gaia:System:PermissionManager to use ManifestHelper to get the localized app name.

How do you think?
Flags: needinfo?(fabrice)
Comment on attachment 803416 [details]
Pull request for v1-train

r-, sorry. This is a gecko bug and I don't want to see workaround like this to be landed no matter we decide to fix it in gecko or gaia.
Attachment #803416 - Flags: review?(alive)
Alive, we can indeed change b2g/components/ContentPermissionPrompt.js to send the manifest url to gaia and let gaia handle localization.
Flags: needinfo?(fabrice)
Assignee: nobody → alive
Created attachment 803995 [details]
https://github.com/mozilla-b2g/gaia/pull/12181

Gaia patch: Use manifestURL to localize app name.
Attachment #803995 - Flags: review?(timdream)
Created attachment 803997 [details] [diff] [review]
915648-gecko.patch

Gecko patch: Provide manifestURL in permission request detail
Attachment #803997 - Flags: review?(fabrice)
BTW,
I tried to trace why manifestHelper in gecko doesn't work when language is changed at run time:
1. Settings.js in gecko monitors language.current and changes pref 'general.useragent.locale'
   http://mxr.mozilla.org/mozilla-central/source/b2g/chrome/content/settings.js#74
2. manifestHelper in gecko use chrome.getSelectedLocale to get the locale
   http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/AppsUtils.jsm#525
3. chromeReg observes pref changes at
   http://mxr.mozilla.org/mozilla-central/source/chrome/src/nsChromeRegistryChrome.cpp#159
   and define the pref name at
   http://mxr.mozilla.org/mozilla-central/source/chrome/src/nsChromeRegistryChrome.cpp#50
   and remove observer at
   http://mxr.mozilla.org/mozilla-central/source/chrome/src/nsChromeRegistryChrome.cpp#378

   I wonder this is why run time change doesn't get the new locale but I need to investigate more. I plan to file another bug for this.
Comment on attachment 803997 [details] [diff] [review]
915648-gecko.patch

Review of attachment 803997 [details] [diff] [review]:
-----------------------------------------------------------------

::: b2g/components/ContentPermissionPrompt.js
@@ +250,5 @@
>      }
>  
>      // When it's an app, get the manifest to add the l10n application name.
>      let app = DOMApplicationRegistry.getAppByLocalId(principal.appId);
> +    details.manifestURL = app.manifestURL;

Just do: details.manifestURL = DOMApplicationRegistry.getManifestURLByLocalId(principal.appId)l
Attachment #803997 - Flags: review?(fabrice) → review+
Created attachment 804010 [details] [diff] [review]
915468-gecko-v2.patch

v2
Attachment #803997 - Attachment is obsolete: true
Attachment #803995 - Flags: review?(timdream) → review+
Checkin-needed for gecko https://bugzilla.mozilla.org/attachment.cgi?id=804010
Keywords: checkin-needed
Gaia patch depends on mc landing, let's wait and cross finger....
I backed out https://github.com/mozilla-b2g/gaia/commit/669b4b40972ae008b26270557a393383ae094a2b because it was breaking two unit tests.

Backed out with https://github.com/mozilla-b2g/gaia/commit/35c02581299063e80abc91d8ac4120dcdd738831.


1) [system] system/LockScreen > Emergency call: should disable emergency-call button:
TypeError: overlay is null
at ls_switchPanel (http://system.gaiamobile.org:8080/js/lockscreen.js:939)
at ls_handleEvent (http://system.gaiamobile.org:8080/js/lockscreen.js:477)
at (anonymous) (http://system.gaiamobile.org:8080/test/unit/lockscreen_test.js:122)
at wrapper (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:62)
at run (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3709)
at runTest (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4081)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4127)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4007)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4016)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3964)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3979)
at done (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3700)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3712)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:46)
at wrapper (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:73)
at run (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3709)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3973)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3984)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4932)

2) [system] system/LockScreen > Emergency call: should enable emergency-call button:
TypeError: overlay is null
at ls_switchPanel (http://system.gaiamobile.org:8080/js/lockscreen.js:939)
at ls_handleEvent (http://system.gaiamobile.org:8080/js/lockscreen.js:477)
at (anonymous) (http://system.gaiamobile.org:8080/test/unit/lockscreen_test.js:130)
at wrapper (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:62)
at run (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3709)
at runTest (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4081)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4127)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4007)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4016)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3964)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3979)
at done (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3700)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3712)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:46)
at wrapper (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:73)
at run (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3709)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3973)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3984)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4932)
It's bug 915468 I think.

(In reply to Anthony Ricaud (:rik) from comment #13)
(In reply to Alive Kuo [:alive] from comment #14)
> It's bug 915468 I think.
> 
> (In reply to Anthony Ricaud (:rik) from comment #13)

Oh, I put the wrong bug number...
Shall be bug 912796
Gecko: https://hg.mozilla.org/integration/b2g-inbound/rev/8b613f4803f6
Gaia Master: https://github.com/mozilla-b2g/gaia/commit/32e01e27ea32e39b0722afeecba37d8caf12fc86
Keywords: checkin-needed
Thanks Ryan.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
https://hg.mozilla.org/mozilla-central/rev/8b613f4803f6

Comment 20

4 years ago
Comment on attachment 803995 [details]
https://github.com/mozilla-b2g/gaia/pull/12181

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment] part of gUM voice support
[Bug caused by] (feature/regressing bug #):
[User impact] if declined:
[Testing completed]:
[Risk to taking this patch] (and alternatives if risky):
[String changes made]:
Attachment #803995 - Flags: approval-gaia-v1.2?

Updated

4 years ago
Blocks: 917359
Please complete the form, specially the part user impact if declined.
Flags: needinfo?(gasolin)

Comment 22

4 years ago
[Approval Request Comment] part of gUM voice support
[Bug caused by] (feature/regressing bug #): 917359 
[User impact] if declined: feature not complete
[Testing completed]:
[Risk to taking this patch] (and alternatives if risky): low
[String changes made]:
Flags: needinfo?(gasolin)
Comment on attachment 803995 [details]
https://github.com/mozilla-b2g/gaia/pull/12181

+ as GUM is a new feature in 1.2
Attachment #803995 - Flags: approval-gaia-v1.2? → approval-gaia-v1.2+
Uplifted 32e01e27ea32e39b0722afeecba37d8caf12fc86 to:
v1.2 already had this commit
status-b2g-v1.2: --- → fixed
Uplifted 32e01e27ea32e39b0722afeecba37d8caf12fc86 to:
v1.3 already had this commit
status-b2g-v1.3: --- → fixed
You need to log in before you can comment on or make changes to this bug.