mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Merge pull request #18643 from Snuffleupagus/l10n-translateOnce
Introduce a `L10n`-method to translate an element once, and use that in `PDFLayerViewer`
This commit is contained in:
commit
f11baea3e3
2 changed files with 14 additions and 2 deletions
|
@ -80,6 +80,15 @@ class L10n {
|
|||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
async translateOnce(element) {
|
||||
try {
|
||||
await this.#l10n.translateElements([element]);
|
||||
} catch (ex) {
|
||||
console.error(`translateOnce: "${ex}".`);
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
async destroy() {
|
||||
for (const element of this.#elements) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue