i18n-sample | A sample of internationalization with Angular 2 RC | Learning library
kandi X-RAY | i18n-sample Summary
kandi X-RAY | i18n-sample Summary
A sample of internationalization with Angular 2 RC 6
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 i18n-sample
i18n-sample Key Features
i18n-sample Examples and Code Snippets
Community Discussions
Trending Discussions on i18n-sample
QUESTION
I am trying to understand the workflow presented in https://github.com/microsoft/vscode-extension-samples/tree/master/i18n-sample for localizing Visual Studio Code extensions.
I cannot figure out how the i18n directory gets created to begin with, as well as how the set of string keys in that directory get maintained over time.
There is one line in the README.md which says "You could have created this folder by hand, or you could have used the vscode-nls-dev tool to extract it."...how would one use vscode-nls-dev tool to extract it?
What I Understand
I understand that you can use vscode-nls
, and wrap strings like this: localize("some.key", "My String")
to pick up the localized version of that string at runtime.
I am pretty sure I understand that vscode-nls-dev
is used at build time to substitute the content of files in the i18n
directory into the transpiled JavaScript code, as well as creating files like out/extension.nls.ja.json
What is missing
Surely it is not expected that: for every file.ts
file in your project you create an i18n/lang/out/file.i18n.json
for every lang you support...and then keep the set of keys in that file up to date manually with every string change.
I am assuming that there is some process which automatically goes "are there any localize("key", "String")
calls in file.ts for new keys not yet in file.i18n.json? If so, add those keys with some untranslated values". What is that process?
ANSWER
Answered 2019-Oct-08 at 23:58I have figured this out, referencing https://github.com/Microsoft/vscode-extension-samples/issues/74
This is built to work if you use Transifex for your translator. At the bare minimum you need to use .xlf
files as your translation file format.
I think that this is best illustrated with an example, so lets say you wanted to get the sample project working after you had deleted the i18n folder
- Step 1: Clone that project, and delete the i18n directory
- Step 2: Modify the gulp file so that the
compile
function also generates nls metadata files in theout
directory. Something like:
QUESTION
has anyone been able to successfully use aurelia-i18n
with a project started using aurelia-cli
written in TypeScript? I have tried a couple of projects following the instructions in the github project doco, but it comes up with an error in the browser when running it.
ANSWER
Answered 2017-Sep-04 at 08:52Thanks to @zewa666 for the help on gitter. It seems that altering aurelia_project/aurelia.json
to set build.loader.plugins.stub
to false
fixed my problem.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install i18n-sample
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