Extension ngx-translatorex is a vscode extension designed to facilitate translations in Angular projects.
Features
Tooltips with translation value.
Intellisense completions.
Autogenerated keys in scope mode.
Support for .html and .ts files (support for component templates in .ts and for HTML element attributes coming soon).
Support for translation params in .html.
Params rename feature.
Translations json sort.
Extension Settings
This extension contributes the following settings:
ngx-translatorex.mode: Mode in which extension works - can be key or scope. Default: key
ngx-translatorex.language: Main i18n file (e.g. en): Default: en
ngx-translatorex.path: Full path or pattern to main i18n folder. Default: **/assets/i18n/
Commands
ngx-translatorex.setLanguage: Set main i18n .json file
ngx-translatorex.setPath: Set path to i18n folder
ngx-translatorex.setMode: Set extension mode
ngx-translatorex.addNewTranslation: Add translation for selected text (ctrl+t/cmd+t)
How to add new key?
Select text node
Press ctrl+t or cmd+t and enter your key (scope in scope mode).
Scope mode creates a key basing on selected text and given scope. Example: scope label with selection My text will result in label.my_text: "My text". If user does not want autogenerated key in some cases in this mode, it's possible to it by putting . at the end of entered scope. Example: label.renamed. + My text = label.renamed: "My text".
Requirements
Opened Angular project with at least 1 i18n .json file.