Support extension specific default language#178
Open
wdhongtw wants to merge 1 commit intomicrosoft:mainfrom
Open
Support extension specific default language#178wdhongtw wants to merge 1 commit intomicrosoft:mainfrom
wdhongtw wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Allow extension owner to choose the language of untranslated string when using the builtin l10n API. Update CLI tool to support additional schema for l10n in package.json.
62fc2d1 to
70ba035
Compare
Author
|
I'm afraid that I can not came out a good sentence for the argument description in The description should be changed, but need some suggestion from people with fluent English. :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow extension owner to choose the language of untranslated string when using the builtin l10n API.
Update CLI tool to support additional schema for l10n in package.json.
For motivation of this PR, please refer to microsoft/vscode#168127.
Proposed Solution
To support additional format, a format that specify default-lang and l10n string bundle path
at the same time, that is:
{ "l10n": { "location": "./l10n", "defaultLocale": "en" } }We introduce two change
@vscode/l10n-dev exportcommand)@vscode/l10n-dev generate-xlfcommand)And to be backward compatible the change still cover the original format.
The
--languageflag forgenerate-xlfstill have a default valueen, but the semantic nowbecomes the fallback language when there is no default-lang in package.json.
How to Verify
Prepare Extension
Write a extension that
vscode.l10n.tto translate a string.en(I prepare a sample extension at https://github.com/wdhongtw/try-plugin, where the default-lang is
jaJapanese.)Verify CLI Tool
Compile and run the tool (installed or not) in the root folder of sample extension.
<tool> export: The command do success, and a filel10n/bundle.l10n.jsonbe generated.<tool> generate-xlf: The command do success, thesource-languagein xlf file be consistent with the setting in package.json.