[Stingray][smart-system] use data-l10n-id in template

RESOLVED FIXED

Status

Firefox OS
Gaia
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: johnhu, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

+++ This bug was initially created as a clone of Bug #1100808 +++

1) change the tv_apps/smart-system/js/ime_menu.js and tv_apps/smart-system/js/permission_manager.js should interpolate Template by setting data-l10n-id, instead of passing strings.

Comment 1

3 years ago
Created attachment 8553781 [details] [review]
Bug 1121815 - Interpolate templates by setting data-l10n-id in tv_apps
Attachment #8553781 - Flags: review?(im)
Comment on attachment 8553781 [details] [review]
Bug 1121815 - Interpolate templates by setting data-l10n-id in tv_apps

Sorry. This is a wrong patch, I think.

We should change the index.html to set the data-l10n-id in template. Like:
        <!--
        <form role="dialog" data-type="value-selector" class="ime-menu value-selector-container" data-z-index-level="action-menu">
          <section>
            <h1 data-l10n-id="${title}"></h1>
            <ol class="value-selector-options-container ime-menu-list" aria-multiselectable="false" role="listbox">
            </ol>
          </section>
          <menu class="ime-menu-button-container">
            <button class="ime-menu-button" data-type="cancel" data-action="cancel" data-l10n-id="${cancelLabel}"></button>
          </menu>
        </div>
        -->

And replace the _('key') with 'key', so that the Template.interpolate will gives us the content like:
        <form role="dialog" data-type="value-selector" class="ime-menu value-selector-container" data-z-index-level="action-menu">
          <section>
            <h1 data-l10n-id="key-title"></h1>
            <ol class="value-selector-options-container ime-menu-list" aria-multiselectable="false" role="listbox">
            </ol>
          </section>
          <menu class="ime-menu-button-container">
            <button class="ime-menu-button" data-type="cancel" data-action="cancel" data-l10n-id="key-cancel"></button>
          </menu>
        </div>

Once you finish, please set review again and set feedback to zb.
Attachment #8553781 - Flags: review?(im) → review-

Comment 3

3 years ago
John, I don't think I understand what you mean. I have already changed index.html to set data-l10n-id in this patch. For example, changing 

<span class="device-item">${label}</span>

to 

<span class="device-item" data-l10n-id="${label}"></span>
Flags: needinfo?(im)
Comment on attachment 8553781 [details] [review]
Bug 1121815 - Interpolate templates by setting data-l10n-id in tv_apps

Sorry,

I didn't not find it before. let me review it again.
Flags: needinfo?(im)
Attachment #8553781 - Flags: review- → review?(im)
Comment on attachment 8553781 [details] [review]
Bug 1121815 - Interpolate templates by setting data-l10n-id in tv_apps

Looks good to me. Thanks for the patch.
Attachment #8553781 - Flags: review?(im) → review+
merged to master:
https://github.com/mozilla-b2g/gaia/commit/23434ebfad124ca5ca6d954c2b4c95b27a48d614

gaia try is all green:
https://treeherder.mozilla.org/ui/#/jobs?repo=gaia-try&revision=de8532ec7411
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.