Home

Awesome

i18n Tagged Template Literals Marketplace Version Marketplace Downloads Rating

i18n Tagged Template Literals

Overview

This Visual Studio Code Extension genarates a json schema based on i18n tagged template literals in your JavaScript project. It also adds useful features like translation validation and translation key export.

For more details please see: Template Literal based i18n translation and localization

This extension is based on i18n-tag-schema

i18n Tagged Template Literals Extension

.vscode/settings.json

For quick configuration use i18nTag: Configure translation schema generator command

    "i18nTag.src": "./src",
    "i18nTag.schema": "./translation.schema.json",
    "i18nTag.filter": "\\.jsx?$",
    "i18nTag.preprocessor": "./preprocessors/typescript", /* add this if you want typescript support or add a custom preprocessor */
    "i18nTag.postprocessor": "./postprocessors/po", /* add this if you want to export a PO file format or add a custom postprocessor */
    "i18nTag.indention": 2, /* The number of spaces to be used for schema indention. if not set, tabs will be used. */
    "i18nTag.babylonConfig": { /* add this if you want to override the default babylon parser options */
        "sourceType": "module",
        "plugins": [
            "jsx",
            "asyncFunctions",
            "flow",
            "classConstructorCall",
            "doExpressions",
            "trailingFunctionCommas",
            "objectRestSpread",
            "decorators",
            "classProperties",
            "exportExtensions",
            "exponentiationOperator",
            "asyncGenerators",
            "functionBind",
            "functionSent"
        ]
    },
    "json.schemas": [
        {
            "fileMatch": [
                "/src/i18n/*.json"
            ],
            "url": "./translation.schema.json"
        }
    ]

Use

Reference schema in individual JSON file

If you don't set the translation directory in configuration you can reference the schema directly in your json file.

{
    "$schema": "./translation.schema.json",
    "key": "value"
}

Translation Validation and Translation Key Export

i18n Tagged Template Literals Extension

Tools

Run time translation and localization

Build time translation

Schema based translations

License

Copyright (c) 2016 Steffen Kolmer

This software is licensed under the MIT license. See the LICENSE file accompanying this software for terms of use.