Bug 1570239 - GenerateMessages in Localization.webidl shouldn't take locales parameter. r=Pike

Differential Revision: https://phabricator.services.mozilla.com/D40081

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Zibi Braniecki 2019-07-31 18:04:09 +00:00
Родитель fb004baac4
Коммит afd14b912e
18 изменённых файлов: 36 добавлений и 36 удалений

Просмотреть файл

@ -40,11 +40,11 @@ dictionary L10nMessage {
};
/**
* A callback function which takes a list of locales and a list
* of localization resources and produces an iterator over
* FluentBundle objects used for localization with fallbacks.
* A callback function which takes a list of localization resources
* and produces an iterator over FluentBundle objects used for
* localization with fallbacks.
*/
callback GenerateMessages = Promise<any> (sequence<DOMString> aAppLocales, sequence<DOMString> aResourceIds);
callback GenerateMessages = Promise<any> (sequence<DOMString> aResourceIds);
/**
* Localization is an implementation of the Fluent Localization API.

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
key1 = Value for Key 1

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
key1 = Value for Key 1
`));

Просмотреть файл

@ -47,8 +47,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
key1 = Value for Key 1
`));

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
key1 = Value for Key 1
key2 = Value for Key 2

Просмотреть файл

@ -13,8 +13,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function * generateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function * generateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
file-menu =
.label = File

Просмотреть файл

@ -8,7 +8,7 @@
<script type="application/javascript">
"use strict";
async function* mockGenerateMessages(locales, resourceIds) {}
async function* mockGenerateMessages(resourceIds) {}
window.onload = function() {
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource("title = Hello World"));
bundle.addResource(new FluentResource("title2 = Hello Another World"));
yield bundle;

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource("title = <strong>Hello</strong> World"));
bundle.addResource(new FluentResource(`title2 = This is <a data-l10n-name="link">a link</a>!`));
yield bundle;

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
// No translations!
yield bundle;
}

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`title = Visit <a data-l10n-name="mozilla-link">Mozilla</a> or <a data-l10n-name="firefox-link">Firefox</a> website!`));
yield bundle;
}

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`title = Visit <a data-l10n-name="mozilla-link">Mozilla</a> or <a data-l10n-name="firefox-link">Firefox</a> website!`));
yield bundle;
}

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
key1 =
.href = https://www.hacked.com

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource(`
key1 = Translation For Key 1

Просмотреть файл

@ -8,7 +8,7 @@
<script type="application/javascript">
"use strict";
async function* mockGenerateMessages(locales, resourceIds) {}
async function* mockGenerateMessages(resourceIds) {}
window.onload = function() {
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource("title = Hello World"));
bundle.addResource(new FluentResource("link =\n .title = Click me"));
yield bundle;

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource("title = Hello World"));
bundle.addResource(new FluentResource("subtitle = Welcome to FluentBundle"));
yield bundle;

Просмотреть файл

@ -10,8 +10,8 @@
const { FluentBundle, FluentResource } =
ChromeUtils.import("resource://gre/modules/Fluent.jsm");
async function* mockGenerateMessages(locales, resourceIds) {
const bundle = new FluentBundle(locales);
async function* mockGenerateMessages(resourceIds) {
const bundle = new FluentBundle("en-US");
bundle.addResource(new FluentResource("title = Hello World"));
bundle.addResource(new FluentResource("title2 = Hello Another World"));
yield bundle;