Git Product home page Git Product logo

stijn-rutten / vscode-transloco-extension Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 236 KB

A simple VS code extension that allows you to quickly add translation in your Angular project using Transloco (https://github.com/ngneat/transloco)

Home Page: https://marketplace.visualstudio.com/items?itemName=StijnRutten.transloco-entry-generator

License: MIT License

TypeScript 88.53% JavaScript 11.47%
vscode-extension visual-studio-code vscode transloco

vscode-transloco-extension's Introduction

VsCode Transloco Extension

This extension allows you to quickly and easily add new translations to your Angular project using Transloco

Marketplace

Features

Currently this extension supports the following features:

Name Description Note
Add Translation Provide the key you want to use for your translation, followed by the string that should be translatable. Currently the given string is added to all json files in the assets/i18n directory in your project. Customizable i18n-directories or different translations per json file are not yet supported
Translate Highlighted text After highlighting a string, use this command to provide an ID. The highlighted text is replaced with t('GIVEN_ID') and the text is placed in all json files in the assets/i18n directory of the project. Currently the given string is added to all json files in the assets/i18n directory in your project. Customizable i18n-directories or different translations per json file are not yet supported

Requirements

  1. This extension only works in Angular project in combination with Transloco.

Extension Settings

Currently vscode-transloco-extension does not support extension settings.

Release Notes

Users appreciate release notes as you update your extension.

0.0.1

  • ๐ŸŽ‰ Project setup ๐ŸŽ‰
  • Added "Add Translation" and "Translate Highlighted text" commands.

vscode-transloco-extension's People

Contributors

stijn-rutten avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

fataloz j0et0m

vscode-transloco-extension's Issues

Adding a translation will overwrite existing translations

Describe the bug
If a translation key already exists, but the enduser is not aware and selects 'create new translation', then the existing values will be overwritten. This is not necessarily a problem for the main/original language, however all translated values are also reset to the original language.

To Reproduce
Steps to reproduce the behavior:

  1. make sure you have multiple language files configured(otherwise why use this tool)
  2. In a file select text "hello world"
  3. press ctrl + p and select the Transloco: Translate selected text
  4. set the key to "bug.helloworld". So far soo good.
  5. Change the texts in the language files for "bug.helloworld" to "hallo wereld" or "hi world".
  6. redo steps 1-3
  7. see that the text in the translation files has reset

Expected behavior
Either an error or warning should occur stating that the key already exists.
Or it should only apply the key to the selected text, without actually changing the translation files if the key matches.

Desktop (please complete the following information):
not applicable. Software verion: 0.5.0

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.