-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial work for l10n - views #1145
Conversation
Signed-off-by: Liam Allan <[email protected]>
@worksofliam @sebjulliand The What about panel texts? Menu items? Command names? Tooltips? |
Great works! And nice cleaning. Not so bad moving to a new version of ES2019.
Yeah.. this is going to be a challenge. It wouldn't be the end of the world if we missed some. A good way to get more contributors I think 😄 |
@worksofliam @sebjulliand |
@sebjulliand In this work all files containing texts will have to be changed, including the JavaScript files. You're planning to convert these into TypeScript - will we collide on this? How do we avoid most collisions? This localization project is a massive task that will take a long time to finish. And I'm off on vacation after next week. What are your thoughts on this? |
@sebjulliand Nice change in b41cc5a - thanks! 😃 |
@worksofliam @sebjulliand All views have now been localized - next up are/would be the webviews. How far should we go with this before merging into master branch? The longer we wait the more likely it is to have collisions for this PR or other PR's in the works. |
src/locale/index.ts
Outdated
|
||
export type Locale = {[id: string]: string}; | ||
|
||
const currentLocale = String(GlobalConfiguration.get(`locale`) || env.language); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really should be letting VS Code decide what the locale is. This will always default to English.
@chrjorgensen I added some code to make the default locale whatever VS Code is using, and then also added a handler so when the config changes it updates our internal locale reference. @sebjulliand Over to you for French! |
@chrjorgensen merge when you feel comfortable… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebjulliand Perfect - approving and merging.
Changes
Shows off a possible way to support l10n. I am using a custom implementation instead of the VS Code l10n API due to the fact the configuration files use the base message as the base text and the id for the locale in other languages. This uses just an ID and then falls back to the default (en) if cannot be found in the target locale.
I made that decision based on this thread: microsoft/vscode-discussions#517
This will not handle the
package.json
and we will have to use the VS Code method to do that (perhaps a separate PR also.)Looking for feedback on:
t
method