Files
alfresco-ng2-components/tools/i18n/li18nt/README.md
Andy Stark dfc83489e2 [ADF-3093] Added style checking tool for en.json translation file (#3428)
* [ADF-3093] Started li18nt VS Code extension

* [ADF-3093] Started work on UI style lint tool for VSCode

* [ADF-3093] Added UI style rules up to sg0006

* [ADF-3093] Added remaining style rules

* [ADF-3093] Added docs and command line tool

* [ADF-3093] Removed Microsoft notices and updated licences to Apache-2.0
2018-06-05 17:49:52 +02:00

1.9 KiB

li18nt UI text style checker

The purpose of this tool is to provide style "lint" checking for the en.json file, which is used as the starting point for i18n in the user interface. The definitive guidelines can be found in the main style guide document. This tool implements the guidelines as a set of rules that can be checked automatically for common errors (the style rules file contains a full description of the rules currently in use).

Installing and using the VSCode extension

The VS Code extension shows the style warnings as underlined sections in the text with corresponding notes in the Problems window, a lot like standard programming language errors.

The extension is not available in the VS Code marketplace but you can install it locally by copying it to the extensions folder. This can be found at the path

$HOME/.vscode/extensions

...on MacOSX and at

%USERPROFILE%\.vscode\extensions

...on Windows. Copy the client folder (from alfresco-ng2-components/tools/i18n/li18nt/) to the extensions folder and rename it to li18nt. If there is no node_modules folder in the new li18nt folder then you should also cd into this folder and run npm install. When you restart VS Code, you should find li18nt listed among the installed extensions in the extensions panel.

When active, the extension will only check the text of files named en.json. Double-click an item from the Problems window in VS Code to highlight the section of text where the issue occurs. You can find out more about why the error has occurred and what to do about it in the style rules file. For the full description and explanation of all style guidelines, see the main style guide.