mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +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
|
@ -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) { },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue