After opening a project folder, create a translation-settings.json file.
The following is an example of the translation-settings.json file.
"translationApiUrl":"https://translationapiurl-comes-here", // Required. Translation API Url
"applicationId":-1, // Required. Application Id of your project
"sourceLanguageId":-1 // Required. Source Language Id (English)
Load all existing keys and values for the given application id and source langauge id from the database
(View > Command Palette > Select "Translation: Load Translation")
After the transaltion-settings.json file is created/updated with the required data,
all the keys and values for the given application id and source language id must be loaded from the database
If application Id or source language id are changed in the translation-settings.json file, keys and values should be reloaded.
When opening a project folder in VS Code, translations will be loaded automatically.
** To use this extension, Step 1 and 2 should be done first
Find existing keys or strings. This can be done in two ways.
Open a file in VS Code, when typing a key in the editor, IntelliSense will suggest keys
Go to View > Command Palette > Select "Translation: Load Translation" (Ctrl + Alt + F) and type a key or a value.
Find a value of a key
a. Open a file in VS Code, hover a mouse cursor over the key text in the editor, the value of the key will show up
a. Select a text (Key or Value) in the editor, right mouse click and select "Traslation: Add/Update Translation"
Type a text (Key or value) and click Enter
Key: A word with no blank space
Value: A string with a blank space
b. If the selected text is a key and the key doesn't exist in the database, then type a value in the field provided and click Enter. The key and the value will be added to the database.
c. If the selected text is a key and the key already exists in the databae, then the value of the key will be displayed in the text field so update the value and click Enter. The value of the key will be updated in the database.
d. If the selected text is a value (The selected text contains a blank space), then type a key in the field and click Enter.
The key and the value will be added to the database.
Get Translation Languages (View > Command Palette > Select "Translation: Get Translation Languages")
a. Show all the langauges of the application
Get Translations To Submit (View > Command Palette > Select "Translation: Get Translations To Submit")
a. Gets translations for an application and language where the status is untranslated. The return object gives us the properties file to submit for translation as well as the data used to update statuses once translation acknowledges they received the file.
b. This creates two files
- A file with everything (KeyIds, LangaugeIds, and PropertiesFile)
- A file with only PropertiesFile
Upload Translations (View > Command Palette > Select "Translation: Upload Translations")
a. Upload translations to database
Users appreciate release notes as you update your extension.