Comments (16)
@SounD120 I just released 1.1.27
from vscode-extension-vscode.
Adding @dbaeumer, I think the --locale
switch should work even in extension tests if I am not mistaken.
from vscode-extension-vscode.
The --locale
switch will work for VS Code and if a Russian language pack is installed it should respect this. It might be different for your extension. The JS code needs to be compiled for production (the JS rewriting needs to have taken place). Otherwise the JS code you are executing during test will not respect the locale setting.
from vscode-extension-vscode.
@bpasero , @dbaeumer Let me describe our full workflow in Azure DevOps for better understanding from both sides.
- We have build pipeline in Azure DevOps CI that transpiles our source TypeScript code with
PROD
preprocessor context, and after build we test our JS code withnode ./node_modules/vscode/bin/test
script, and if the tests are passed, we are packing JS code onto vsix. There are no processes that we are executing after build sequence to make any rewrites in the JS code. @dbaeumer could you please clarify what JS rewriting do you mean in this context? test
script doesn't provide locale switching neither as startup argument nor as environment variable for this moment, so we cannot run tests with different locale in CI. Also, we tried to workaround it by replacing./node_modules/vscode/bin/test
with modified version which is explicitly set--locale
: code and even after that our tests failed due to locale hasn't been switched.
Let me know if need any additional information.
from vscode-extension-vscode.
The JS rewriting happens via the gulp tasks provided from vscode-nls-dev
. I looked at your reprository and the build
gulp tasks seems to do this. So all necessary translation files will be created.
When you start VS Code in the tests with a --locale param and an installed language pack for that locale will it come up in that locale?
from vscode-extension-vscode.
@bpasero , @dbaeumer As we understand the VS Code localization mechanism, it doesn't matter if we have installed language pack for the extensions localized with vscode-nls
or not. Localization works if we run code --locale=ru
locally, but if we try to apply --locale
parameter in CI it is not, so we actually don't know how to switch VS Code language with test script. Also, test script doesn't provide extra parameter for running it with another locale and we had to switch it with our patched version during CI builds. With respect to JS rewriting, at the moment of testing all the localization bundles are already built, and the localize
calls are rewrited, so it should not affect the language switching.
from vscode-extension-vscode.
@SounD120 how about a PR to fix the issue for everyone if it works for you?
from vscode-extension-vscode.
@bpasero The problem is that it is not work for us.
from vscode-extension-vscode.
Oh ok, your wording made it sound as if it was working.
from vscode-extension-vscode.
@bpasero summarizing all things:
- test script doesn't provide an option to run extension tests under the VS Code instance with another locale
- possible fix for it doesn't work for us for some reason
So we are asking for help to get it work for us.
from vscode-extension-vscode.
@ruslan-bikkinin I still think the change to the test
file would be valuable so that the --locale
is passed to the instance. For example with the following steps I am able to bring up a test instance in german locale (for VSCode at least):
- install the german language pack in the instance of VSCode that the test script is downloading
- add
--locale=de
to the arguments in thetest
file - run
npm run test
from the command line
Now, I am not the right person to help you with how translations are installed for extensions. Waiting for @dbaeumer to comment on what you need to do to install localizations for an extension.
from vscode-extension-vscode.
In @SounD120 case the localization are bundled with the extension since the are not part of the core VS drop and therefore not part of the language packs. So IMO if the test instance starts in German locale and the extension is compiled for productions (produces localization files) and has a German translation the strings should show up in German.
from vscode-extension-vscode.
@SounD120 is that true?
from vscode-extension-vscode.
@bpasero , @dbaeumer I sent you a direct email with the details.
from vscode-extension-vscode.
@bpasero , @dbaeumer Thanks a lot for your help, guys. We found the way to solve our issue, so I proposed a PR that adds locale switching functionality to test
script
from vscode-extension-vscode.
@bpasero Could you please clarify when the new version of the package will be released?
from vscode-extension-vscode.
Related Issues (20)
- Failed to get code binary when testing in environment that needs to use strictSSL:false HOT 1
- Missing error messages for bad setup HOT 1
- Servers(child processes) are cashing HOT 1
- vscode-install failed for vscode module HOT 11
- `node ./node_modules/vscode/bin/install` won't detect VSCode engine in ubuntu docker container HOT 5
- Error installing vscode.d.ts: Error: Request returned status code: 500 HOT 3
- Split module into @types/vscode and vscode-test HOT 8
- Can this module point to microsoft/vscode? HOT 3
- Switch to yarn instead of npm HOT 2
- Pass mocha options for easier CI test reports HOT 2
- Remove lib/shared and update install script
- Move test runner to `vscode-test` HOT 1
- Unable to use local URIs with vscode-resource HOT 1
- Local VSCode No Longer Installed as `stable`... HOT 6
- diff security vulnerability HOT 3
- Wrong node version for extension HOT 1
- [JS] eslint complains: "Unable to resolve path to module 'vscode'" HOT 1
- Can extensions have control for hiding context menus like Add Logpoint.. HOT 1
- Failed to execute fetch TypeError: Cannot read property '0' of undefined HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-extension-vscode.