Giter Site home page Giter Site logo

vscode-translations's Introduction

Translations

This extension uses i18next to display localized text for translation keys in code.

Setup

Several translation backends are supported and can be used in conjunction by updating the order in Backend > List setting.

A backend must be selected, otherwise no translations will be loaded.

Additionally, the I18n Options settings are required unless the default suffices. I18n Options > Namespaces are the possible namespaces, and I18n Options > Supported Lngs are all the possible languages. Without these, the extension will not function properly.

Contentful

To enable Contentful backend, add contentful to the Backend > List setting. Then fill in all the required settings in Backend > Contentful Options.

File System

To enable File System backend, add fileSystem to the Backend > List setting. Add the load path according to the Backend > File System Options.

Features

  • Inline translations

    • at the end of the line

      Inline end of line translation

    • adjacent to the key

      Inline adjacent translation

  • Translation on hover showing all translated values

    Hover translation

Extension Settings

  • translations.hover
    • enabled: enable/disable display on hover over a localization key
  • translations.inline
    • enabled: enable/disable inline value of key in default language
    • position: position to show the value of the key, either end of line or adjacent to key
  • translations.backend
    • list: list of backends to use and the order in which to use them. Currently supports File System and Contentful. If more than one item exists in the list, the first will be primary and the rest used as a backup in the case of a missing key in the primary.
    • fileSystemOptions: options to pass to the file system backend, the following is required:
      • loadPath: the path from where to load translations. It contain {{lng}} and {{ns}}.
    • contentfulOptions: options to pass to the contentful backend, the following are required:
      • host: either https://cdn.contentful.com or https://preview.contentful.com
      • environment: "master" or another environment
      • space: the contentful space id to use
      • accessToken: the access token generated in Contentful settings.
  • translations.i18nOptions
    • namespaces: namespaces to search for translations
    • supportedLngs: list of all supported languages for translating purposes
    • defaultNs: default namespace for translations, will default to translation
    • fallbackLng: fallback language for translations, defaults to en-US

Known Issues

Release Notes

Releases

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.