mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Refactor the IL10n
implementations to utilize async
methods rather than manually returning Promise
s
This changes the methods signatures of `GenericL10n`, `MozL10n`, and `NullL10n`.
This commit is contained in:
parent
af89ec271d
commit
b0fa02e845
4 changed files with 30 additions and 37 deletions
|
@ -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) { }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue