Refactor the IL10n implementations to utilize async methods rather than manually returning Promises

This changes the methods signatures of `GenericL10n`, `MozL10n`, and `NullL10n`.
This commit is contained in:
Jonas Jenwald 2018-07-30 16:28:39 +02:00
parent af89ec271d
commit b0fa02e845
4 changed files with 30 additions and 37 deletions

View file

@ -56,21 +56,19 @@ function formatL10nValue(text, args) {
* @implements {IL10n}
*/
let NullL10n = {
getLanguage() {
return Promise.resolve('en-us');
async getLanguage() {
return 'en-us';
},
getDirection() {
return Promise.resolve('ltr');
async getDirection() {
return 'ltr';
},
get(property, args, fallback) {
return Promise.resolve(formatL10nValue(fallback, args));
async get(property, args, fallback) {
return formatL10nValue(fallback, args);
},
translate(element) {
return Promise.resolve();
},
async translate(element) { },
};
/**