TypeScript Hints and Navigation
Integrate with VS Code for TypeScript hints and navigation to translation files.
Overview
The @resourge/translations
library provides integration with VS Code, offering TypeScript hints for translations and easy navigation to translation files. This feature enhances your development experience by providing quick access to translation values and the ability to navigate to translation files directly from your code.
Prerequisites
Before you begin, ensure that you have the following:
- Visual Studio Code (VS Code) installed on your system
- The VS Code project workspace open and configured for your project
Usage
-
Open your Vue.js or React component file that uses translations.
-
Place the cursor on top of a translation usage, such as
T.global.hello
.
-
VS Code will display a TypeScript hint that shows the translation values for each language. This helps you quickly identify the translation values without navigating to the translation file.
-
To navigate to the translation file, click on the translation key (e.g.,
hello
). VS Code will open the translation file, allowing you to make edits or review the translations.
-
Make any necessary changes to the translations and save the file.
-
Return to your component file, and the updated translation values will automatically be reflected in the TypeScript hint.
-
Repeat the process to navigate to other translation files and make any necessary changes.
Configuration
The TypeScript hints and navigation feature is enabled by default and does not require any additional configuration. If you encounter any issues with the TypeScript hints or navigation, ensure that you have the latest version of the @resourge/translations
library installed and that your VS Code workspace is properly configured.
On This Page