Skip to content

Quickly and easily turn hard coded strings into ngx-translate pipes

Notifications You must be signed in to change notification settings

NextFaze/ngx-translate-quickcreate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngx-translate-quickcreate

Quickly and easily turn hard coded strings into ngx-translate pipes

This project contains VSCode extension ngx-translate-quickcreate.

Requirements

For usage in an Angular project that uses @ngx-translate.

Extension Commands

This extension contributes the following commands:

Generate Translation String

Turns your selected text into a ngx-translate string and pipe.

Example Usage

  1. Select word(s) that you want to translate
  2. Open up the command palette (⇧⌘P (Windows, Linux Ctrl+Shift+P))
  3. Search for Translate: Generate Translation String
  4. Input a name you wish to refer to this value as, e.g. hello world
  5. Selected text is now changed to the translation key with the pipe and translation copied to clipboard
  6. Open your translations .json file and paste the clipboard contents

Extension Settings

This extension contributes the following settings:

  • ngx-translate-quickcreate.autocapitalize: Automatically capitalize the translation string key - only applies in snake case mode.
  • ngx-translate-quickcreate.caseMode: Type of case to use for translation string - options are 'camel' and 'snake'.
  • ngx-translate-quickcreate.replaceOnTranslate: Replace the selected text after generating a translation string.
  • ngx-translate-quickcreate.translatePipeName: The name of the pipe to handle the translation.
  • ngx-translate-quickcreate.quote: Which quote to use around the inserted translation key.
  • ngx-translate-quickcreate.padding: Add spaces inside the curly bracket pair.

Release Notes

1.0.1

  • Added setting to use camel or snake case
  • Added setting for capitalization
  • Fixed using only workspace settings
  • Fixed only the first space being underscored

1.0.0

Initial release of ngx-translate-quickcreate

Contributing

Contributions are welcome. After updating the version, run npm run package to create a .vsix file to upload. See Microsofts guide on publishing extensions.

Accreditations

About

Quickly and easily turn hard coded strings into ngx-translate pipes

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •