Skip to content
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

Closed
Akxe opened this issue Jul 12, 2018 · 6 comments
Closed

No translations in subtitle settings window #5316

Akxe opened this issue Jul 12, 2018 · 6 comments
Labels
outdated Things closed automatically by stalebot

Comments

@Akxe
Copy link
Contributor

Akxe commented Jul 12, 2018

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.

  1. Initialise video using videojs(videoElement, options)
  2. Add tranlation using setTimeout(() => videojs.addLangulage('cz', { ... }), 0), this is to simulate import('./lang/cz.json').then(...) of language file.
  3. most of UI is translated, however not the setting of subtitles.

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

@gkatsev
Copy link
Member

gkatsev commented Jul 13, 2018

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.

@Akxe
Copy link
Contributor Author

Akxe commented Jul 13, 2018 via email

@Akxe
Copy link
Contributor Author

Akxe commented Jul 13, 2018

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?

@gkatsev
Copy link
Member

gkatsev commented Jul 13, 2018

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.

@Akxe
Copy link
Contributor Author

Akxe commented Jul 13, 2018

Play button, track, everything on GUI actually, that is why it confused me so much... See the example, it is very interesting behaviour.

@stale
Copy link

stale bot commented Sep 12, 2018

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.

@stale stale bot added the outdated Things closed automatically by stalebot label Sep 12, 2018
@stale stale bot closed this as completed Sep 19, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated Things closed automatically by stalebot
Projects
None yet
Development

No branches or pull requests

2 participants