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
|
@ -145,21 +145,20 @@ class MozL10n {
|
|||
this.mozL10n = mozL10n;
|
||||
}
|
||||
|
||||
getLanguage() {
|
||||
return Promise.resolve(this.mozL10n.getLanguage());
|
||||
async getLanguage() {
|
||||
return this.mozL10n.getLanguage();
|
||||
}
|
||||
|
||||
getDirection() {
|
||||
return Promise.resolve(this.mozL10n.getDirection());
|
||||
async getDirection() {
|
||||
return this.mozL10n.getDirection();
|
||||
}
|
||||
|
||||
get(property, args, fallback) {
|
||||
return Promise.resolve(this.mozL10n.get(property, args, fallback));
|
||||
async get(property, args, fallback) {
|
||||
return this.mozL10n.get(property, args, fallback);
|
||||
}
|
||||
|
||||
translate(element) {
|
||||
async translate(element) {
|
||||
this.mozL10n.translate(element);
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue