-
Notifications
You must be signed in to change notification settings - Fork 7.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
No translations in subtitle settings window #5316
Comments
This is because the components get translated when they are initialized. If the translations aren't available then, it'll use the default language (english). |
I get that, but why the main UI get correct translation anyway?
…---------- Původní zpráva ----------
Od: Gary Katsevman
Datum: 13. 7. 2018 v 08:05:46
Předmět: Re: [videojs/video.js] No translations in subtitle settings window
(#5316)
This is because the components get translated when they are initialized. If
the translations aren't available then, it'll use the default language
(english).
I'm not sure there's a reasonable way to fix this in Video.js. I would
recommend to make sure to only create the player after the language has been
loaded.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
(#5316 (comment)), or
mute the thread
(https://github.com/notifications/unsubscribe-auth/AB6LhiptEuASWz-8iE6GnfHNN9hlbIlqks5uGDi2gaJpZM4VMmcI)
.
|
It would mean that then settings window is initialised before main UI, so my options are, either re-create the component or delay initialisation after languages? |
Do you have a specific component in mind that you see is being translated? Could it be a component that updates it's state and thus could be translated during that transition? I think the best scenario is to wait until the languages have loaded before loading the player. Though, it may be possible to notify components that a new language became available and they may want to re-render themselves to get the new translations. However, I'm not sure it's really useful to do. |
Play button, track, everything on GUI actually, that is why it confused me so much... See the example, it is very interesting behaviour. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
If you delay
addLanguage
function just to next tick, you won't get everything translated correctly.Minimal test case on JSBin you can use.
Side note:
Delay more than 25ms and none of the UI will get translated
Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
videojs(videoElement, options)
setTimeout(() => videojs.addLangulage('cz', { ... }), 0)
, this is to simulateimport('./lang/cz.json').then(...)
of language file.Results
Expected
Translations will appear instead of original texts.
Actual
Text are in english
versions
videojs
6.x.x possibly 7.x.x too
browsers
all
OSes
all
plugins
none
The text was updated successfully, but these errors were encountered: