Skip to content

RRStudio/ngx-translate-intellisense

Repository files navigation

ngx-translate-intellisense

Enhance your ngx-translate workflows.


Table of Contents

Features

  • Automatic indexing of translation files
  • Easy-to-use translations editor
  • Autocomplete for translations
  • Translation information when hovering over a translation
  • Create translations on the fly
  • Catch untranslated or incomplete translations

  • NOTE: Autocomplete and creation is only supported in html files
  • NOTE: This extension only supports json translation file

Requirements

Usage

The extension automatically indexes all translation files. If the above warning continues to appear, or the translation editor is stuck on loading, run the Update translations command

Create translations

Translation creation demo

  • Write the desired text you want translated
  • Select it, and execute the Create translation from selection command
  • A snake_case key will be generated for you, but you can change it to whatever you want
  • Press the enter key to confirm the creation
  • Open the translation files to see your new translation :)

Translations editor

  • Open the translations view either by using the provided Translations Editor activity bar view, or by executing the Open translations editor command Open editor demo
  • The editor displays all your translations in a table, order by Key -> Languages, and will update automatically when changes to the translation files are made
    • If this is not the case, to fix this issue either click the Refresh button or execute the Update translations command
  • You can now live edit all translation keys and values. NOTE: empty values wlil be marked in red
  • To create a new entry, click the + New button at the bottom of the table
  • To delete a translation, click the 🗑️ button at the end of its row

Autocomplete translations

Translation autocomplete demo

  • To get translation autocomplete suggestions, type t: (all suggestions are prefixed with t:)
  • Choose the desired value, and the translation pipe will be filled for you

Diagnose translation problems

The extension currently provides these diagnostics:

Type Description Suggested action
key-doesnt-exist Error The target translation key doesn't exist Create the translation key
key-not-fully-implemented Warning The target translation key isn't implemented in the described languages Implement the translation key in the missing languages

Commands

Keybinding Description
Update translations Windows: Ctrl+T Ctrl+U
Mac: Cmd+T Cmd+U
Updates and indexes all translations
Create translation from selection Windows: Ctrl+T Ctrl+N
Mac: Cmd+T Cmd+N
Creates a translation from the current text selection.
NOTE: If the translation already exists, the key won't be created and the translation will be filled in for you
Open translations editor Windows: Ctrl+T Ctrl+E
Mac: Cmd+T Cmd+E
Opens the translation editor in a new tab
Open translation files Windows: Ctrl+T Ctrl+O
Mac: Cmd+T Cmd+O
Opens all indexed translation files in new columns

Settings

Type Default Description
ng-translate-intellisense.translationsFolder string i18n Specifies the translations folder name to index. The folder name should not be a path. After changing this, it is recommended to execute the Update translations command

Known Issues

Opening issues is appreciated :)

Pull requests

All contributions to this project are welcome :)

Release Notes

0.0.1 (25/10/2020)

  • First release

0.0.3 (25/10/2020)

  • Minor improvements and documentation fixes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published