l10n.js | Passive localization JavaScript library | Internationalization library
kandi X-RAY | l10n.js Summary
kandi X-RAY | l10n.js Summary
l10n.js is a JavaScript library that enables passive localization through native JavaScript methods, gracefully degrading if the library is not present. You can make Ajax applications, JavaScript libraries, etc. that can be localized but not require l10n.js to function. There is already a placeholder method for all API calls as specified in the ECMAScript specification and is present in all JavaScript engines, so when l10n.js isn’t present, your application works fine.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of l10n.js
l10n.js Key Features
l10n.js Examples and Code Snippets
Community Discussions
Trending Discussions on l10n.js
QUESTION
I have a UWP cordova app, which uses the PDFJS to render the pdf files. It's loading the embedded fonts as data-uri
, but I am getting the error An app can’t load remote web content in the local context.
along with the warning Warning: Load test font never loaded.
. What I am trying to do is like this, but within a UWP app: https://mozilla.github.io/pdf.js/web/viewer.html
This is the code where it loads the fonts (found in pdf.js around line 7390):
...ANSWER
Answered 2017-May-01 at 01:56From the error message, you are currently loading some remote web content in the local context, which is not allowed due to safety reason. Please refer to the table of Features and restrictions by context (HTML) for details.
So, to fix the problem, you can put the loading PDF part into x-ms-webview:
onDeviceReady
in index.js:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install l10n.js
[Download l10n.js][4].
Localize strings used in your JavaScript application. See the [demo localizations file][5] for an example localizations file. You can also specify external localizations in your main localizations file by assigning a URL string to a language code, such as "en-us": "localizations/en-us.json".
Include the appropriate link elements, as described in the usage section, anywhere in your document. I recommend putting it in the document’s <head>.
Place <script type="text/javascript" src="path/to/l10n.js"></script> anywhere after the <link> tag.
Call toLocaleString() on any strings you wish to localize.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page