Closed Bug 915468 Opened 11 years ago Closed 11 years ago

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

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

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

RESOLVED FIXED
Tracking Status
b2g-v1.2 --- fixed
b2g-v1.3 --- fixed

People

(Reporter: leo.bugzilla.gaia, Assigned: alive)

References

Details

Attachments

(4 files, 1 obsolete file)

Attached image 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
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
Gaia patch: Use manifestURL to localize app name.
Attachment #803995 - Flags: review?(timdream)
Attached patch 915648-gecko.patch (obsolete) — Splinter Review
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+
v2
Attachment #803997 - Attachment is obsolete: true
Attachment #803995 - Flags: review?(timdream) → review+
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...
Thanks Ryan.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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?
Blocks: 917359
Please complete the form, specially the part user impact if declined.
Flags: needinfo?(gasolin)
[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
Uplifted 32e01e27ea32e39b0722afeecba37d8caf12fc86 to:
v1.3 already had this commit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: