Enhance your Angular application's internationalization process with this Visual Studio Code extension that automatically generates i18n translation keys for HTML and TypeScript files.
- HTML: Go to your HTMl file, press
F1
, typecreatei18nhtml
, and hitEnter
. - TypeScript: Select a string or multiple string (e.g. alt + mouse selection) in a TypeScript file, press
F1
, typecreatei18nts
, and hitEnter
.
<input placeholder="Enter your name">
<p>Welcome to our site!</p>
<input placeholder="Enter your name" i18n-placeholder="@@ANGULAR_FILENAME_ENTERYOURNAME">
<p i18n="@@ANGULAR_FILENAME_WELCOMETOOURSITE">Welcome to our site!</p>
const greeting = "Welcome to our site!";
const greeting = "`Welcome to our site ${hello}!`";
const greeting = $localize`:@@ANGULAR_FILENAME_WELCOMETOOURSITE:Welcome to our site!`;
const greeting = $localize`:@@ANGULAR_FILENAME_WELCOMETOOURSITE:Welcome to our site ${hello}!`;
For questions or updates, visit our GitHub repository.