lit-translate | fast lightweight internationalization library | Frontend Framework library
kandi X-RAY | lit-translate Summary
kandi X-RAY | lit-translate Summary
A blazing-fast lightweight internationalization (i18n) library for your next web-based project
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 lit-translate
lit-translate Key Features
lit-translate Examples and Code Snippets
Community Discussions
Trending Discussions on lit-translate
QUESTION
I'm using the excellent JS i18n library lit-translate
for a LitElement-project. If I understand correctly, get("foo.bar")
is supposed to get the value of that key from a JSON file that contains the translations.
In my project, however, get("foo.bar")
doesn't return the value of the key, but returns [foo.bar]
instead. translate("foo.bar")
works, but only inside a LitElement's HTML structure like
${translate("foo.bar")}
constructor()
part or simply outside of the LitElement class definition, translate("foo.bar")
only returns part => { partCache.set(part, cb); updatePart(part, cb); }
.
How can I simply get the value of a key through get()
? I'm still a JavaScript novice and probably overlooking something, but what? Help is appreciated!
Here's my code (the relevant parts of it):
...ANSWER
Answered 2019-Aug-21 at 08:24The problem has been identified (see comments to my question). Here's what was missing in my LitElement:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lit-translate
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