-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conflicting documentation #61
Comments
@deakjahn whether to use the built-in API or If you have access to the built-in API (meaning your code is running in the main extension host process) then you use the built-in API. If you are running code outside of that in a separate process that you would also like to localize, you can use |
With that said,
I don't think I support this form of import. For now, this has to be:
I'm working on catching these edge cases. Note this should work (if you're running in the extension host):
|
Sorry, but there's the rub. That's why I wrote in the first place. :-)
doesn't work (neither does the variation with asterisk and referencing it by name). Red squiggly under I'm in VS Code 1.73.1, it says no update is available, it's fresh. By the way: "I don't think I support this form of import. For now, this has to be:". You do. It compiles and, actually, it's much nicer to only need to type |
As to the other issue, couldn't that be solved so that we can have our cake and eat it, too? Considering that it would also solve the other issue of not yet thinking about people who need something else than English as their neutral, fallback language? Basically, what I would suggest is to make use of
Adding
This second would solve the remaining problems. First, we would be free to use whatever key we like, be it a real key or the original string. Second, it would also solve the fallback language problem, the neutral bundle could contain any language, not only English. Those who want to use a different language and localize to English instead of the other way around would simply provide a Besides, all those current and future users who don't use such a neutral bundle would receive the current treatment without any breaking change. |
What engine version are you using in the package.json? What @types/vscode version are you using in the package.json? |
I know it works at runtime but when you use |
I have:
I never thought that I had to keep track of new versions myself, none of the other platforms I develop on make me do so. Do I really need to? Fair enough, I don't know about extracting |
I checked out a couple of FOSS extensions from the marketplace and they all seem to do the same, tilde notation and 1.52. Now I tried to change it to caret. I went back to 1.52, at least it works now, except for the localization. :-) |
Change to this, then run This is saying "I work with VS Code 1.73.0 and higher and only use API in those versions." If you have 1.53, then you work with VS Code 1.53 and higher. 1.53 doesn't have the localization API so you don't get completions for it. |
I'm going to update the docs to include this engine. |
Yep, that did the trick, thanks. If we could only convice you to support |
PR out to update README... let's talk "default language" in the issue dedicated to it microsoft/vscode#168127 |
Dear me. :-) I know it's not the best place to ask but how do you use it? Documentation seems to be very contradicting, some suggest to use the
vscode/l10n
dependency, others say it's built-in already if you only want to use in the main extension.package.nls.json
gets picked up all right but I simply can't make thebundle.l10n.json
work.Without the dependency, trying to use
vscode.l10n.t()
gives an error of Property 'l10n' does not exist on type 'typeof import("vscode").If I do depend on the package, then I can import:
And it looks like it might work but then comes a very nasty surprise: is it real that, in the bundle files, I have to use the English original as a key? Can't I use a key like in the package level? Eg:
Really? I hope not because this would be rather problematic. After all, the same original won't always be translated to the same localized string. There are homonyms in English. There might be situations when the same expression has to be spelled, cased or translated differently, depending on context. Tell me I misunderstood something...
The text was updated successfully, but these errors were encountered: