Bug 1369291 - add l10n support for onboarding overlay;r=mossop,rexboy

MozReview-Commit-ID: AzLol5jeAm3

--HG--
extra : rebase_source : 0e548cf1a81786fb44fbc9745fb639fcc8ae6204
This commit is contained in:
gasolin 2017-06-02 17:44:56 +08:00
parent d6d4bcb282
commit 75d168933a
6 changed files with 26 additions and 1 deletions

View File

@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");
const ONBOARDING_CSS_URL = "resource://onboarding/onboarding.css";
const ABOUT_HOME_URL = "about:home";
const ABOUT_NEWTAB_URL = "about:newtab";
const BUNDLE_URI = "chrome://onboarding/locale/onboarding.properties";
/**
* The script won't be initialized if we turned off onboarding by
@ -20,6 +21,7 @@ const ABOUT_NEWTAB_URL = "about:newtab";
class Onboarding {
constructor(contentWindow) {
this.init(contentWindow);
this.bundle = Services.strings.createBundle(BUNDLE_URI);
}
async init(contentWindow) {
@ -70,7 +72,7 @@ class Onboarding {
div.innerHTML = `
<div id="onboarding-overlay-dialog">
<button id="onboarding-tour-close-btn">X</button>
<header>Getting started?</header>
<header>${this.bundle.GetStringFromName("gettingStarted")}</header>
<nav>
<ul></ul>
</nav>

View File

@ -0,0 +1,5 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
gettingStarted=Getting started?

View File

@ -0,0 +1,8 @@
#filter substitution
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@AB_CD@.jar:
% locale onboarding @AB_CD@ %locale/@AB_CD@/
locale/@AB_CD@/ (en-US/*)

View File

@ -0,0 +1,7 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
JAR_MANIFESTS += ['jar.mn']

View File

@ -7,6 +7,8 @@
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
DIRS += ['locale']
FINAL_TARGET_PP_FILES.features['onboarding@mozilla.org'] += [
'install.rdf.in'
]

View File

@ -105,6 +105,7 @@ endif
ifndef RELEASE_OR_BETA
@$(MAKE) -C ../extensions/presentation/locale AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../extensions/webcompat-reporter/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../extensions/onboarding/locale AB_CD=$* XPI_NAME=locale-$*
endif
@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'