-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
when a custom websocket provider is used, not all strings are getting localized #13237
Comments
@msujew any thoughts ? |
@hyddel Do you have the same issue in 1.45 with the new Preload module for ServiceConnectionProvider overrideimport { ConnectionSource } from './messaging/connection-source';
import { LocalConnectionProvider, RemoteConnectionProvider, ServiceConnectionProvider } from './messaging/service-connection-provider';
import { ContainerModule, injectable } from 'inversify';
import { WebSocketConnectionSource } from './messaging/ws-connection-source';
@injectable()
export class CustomWebSocketConnectionProvider extends ServiceConnectionProvider {
constructor() {
super();
console.log('=====================loading custom connection provider===============');
}
}
export default new ContainerModule((bind, _, __, rebind) => {
const backendServiceProvider = Symbol('backendServiceProvider');
bind(CustomWebSocketConnectionProvider).toSelf().inSingletonScope();
bind(backendServiceProvider).toDynamicValue(ctx => {
bind(ServiceConnectionProvider).toSelf().inSingletonScope();
const container = ctx.container.createChild();
container.bind(ConnectionSource).toService(WebSocketConnectionSource);
return container.get(CustomWebSocketConnectionProvider);
}).inSingletonScope();
rebind(LocalConnectionProvider).toService(backendServiceProvider);
rebind(RemoteConnectionProvider).toService(backendServiceProvider);
}); |
@msujew we are actually using 1.42.1 where we are seeing this issue. We have tried 1.43.0 to see if the issue is fixed but facing the same issue. I think we cannot upgrade to 1.45.0 because we might have to adjust our customizations and also the timeline does not permit us to migrate to 1.45.0. Any thoughts on why it is not working in 1.43.0 or 1.42.1 ? |
@hyddel in your code, you're importing by doing this: import { WebSocketConnectionProvider } from "@theia/core/lib/browser"; However, importing from import { WebSocketConnectionProvider } from "@theia/core/lib/browser/messaging/ws-connection-provider"; That way you don't accidentally load files that aren't allowed to be loaded yet. The preload is a very special phase in the frontend application lifecycle and requires special care to work correctly. |
I have tried that but still facing the same issue. |
@hyddel It works for me. I've just replaced both imports of the Please ensure that you have no general If you want to figure out which code calls the localization code too early, you can set a breakpoint in the |
it is working for me too. I have missed to replace the import at one place. |
Bug Description:
when a custom websocket provider is used, not all strings are getting localized
Steps to Reproduce:
yarn
yarn prepare && cd browser-app && yarn download:plugins && yarn local_start
http://localhost:4444/
es
Additional Information
custom-code-editor.zip
The text was updated successfully, but these errors were encountered: