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

@ -163,12 +163,12 @@ class IL10n {
/**
* @returns {Promise<string>} - Resolves to the current locale.
*/
getLanguage() {}
async getLanguage() {}
/**
* @returns {Promise<string>} - Resolves to 'rtl' or 'ltr'.
*/
getDirection() {}
async getDirection() {}
/**
* Translates text identified by the key and adds/formats data using the args
@ -179,12 +179,12 @@ class IL10n {
* @param {string} fallback
* @returns {Promise<string>}
*/
get(key, args, fallback) { }
async get(key, args, fallback) { }
/**
* Translates HTML element.
* @param {HTMLElement} element
* @returns {Promise<void>}
*/
translate(element) { }
async translate(element) { }
}