Wraps mozL10n to async calls; splits firefox and generic l10n libs.

This commit is contained in:
Yury Delendik 2017-05-03 20:05:53 -05:00
parent 09d46e94c6
commit 5438ce9b98
28 changed files with 463 additions and 260 deletions

View file

@ -118,9 +118,39 @@ class IPDFAnnotationLayerFactory {
/**
* @param {HTMLDivElement} pageDiv
* @param {PDFPage} pdfPage
* @param {IL10n} l10n
* @param {boolean} renderInteractiveForms
* @returns {AnnotationLayerBuilder}
*/
createAnnotationLayerBuilder(pageDiv, pdfPage,
renderInteractiveForms = false) {}
renderInteractiveForms = false,
l10n = undefined) {}
}
/**
* @interface
*/
class IL10n {
/**
* @returns {Promise<string>} - Resolves to 'rtl' or 'ltr'.
*/
getDirection() {}
/**
* Translates text identified by the key and adds/formats data using the args
* property bag. If the key was not found, translation falls back to the
* fallback text.
* @param {string} key
* @param {object} args
* @param {string} fallback
* @returns {Promise<string>}
*/
get(key, args, fallback) { }
/**
* Translates HTML element.
* @param {HTMLElement} element
* @returns {Promise<void>}
*/
translate(element) { }
}