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

Inconsistent language flags #825

Closed
lkiesow opened this issue Oct 13, 2022 · 6 comments · Fixed by #860
Closed

Inconsistent language flags #825

lkiesow opened this issue Oct 13, 2022 · 6 comments · Fixed by #860
Labels
hacktoberfest type:bug Something isn't working type:visual-clarity A part of the UI is not visually readable view:subtitle-editor

Comments

@lkiesow
Copy link
Member

lkiesow commented Oct 13, 2022

Given the subtitle configuration

[subtitles.languages]
"captions/vtt+de" = "Deutsch"
"captions/vtt+en" = "English"

you end up with a view like this:

Screenshot from 2022-10-13 16-14-23

  • Where does the German flag come from?
  • Why is there none for English?
  • Can we make this somewhat consistent?
@lkiesow lkiesow added type:bug Something isn't working type:visual-clarity A part of the UI is not visually readable view:subtitle-editor labels Oct 13, 2022
@Arnei
Copy link
Member

Arnei commented Oct 13, 2022

The code at fault is this function here:

const parseCountryCode = (parseString: string) => {

Where does the German flag come from?

It's unicode!

Why is there none for English?

The function extracts a substring from the subflavor in the vague hope that it's a valid unicode flag. "en" is not a valid unicode flag.

Can we make this somewhat consistent?

Probably not (without a lot of effort)! There's no standard way of telling which language a vtt file belongs to (or no language, or multiple languages...), so we would have to come up with one.

@lkiesow
Copy link
Member Author

lkiesow commented Oct 13, 2022

If it's only Unicode icons anyway, I've got an idea.
Why not let users configure them as well?
Something like this:

[subtitles.languages]
"captions/vtt+de" = "Deutsch"
"captions/vtt+en" = "English"

[subtitles.icons]
"captions/vtt+de" = "🇩🇪"
"captions/vtt+en" = "🇺🇸"

What do you think?

@Arnei
Copy link
Member

Arnei commented Oct 14, 2022

Not a bad idea? I guess you can trust a person who sets up the config to set reasonable values for the icons.

@lkiesow
Copy link
Member Author

lkiesow commented Oct 19, 2022

Well… if we can't trust the admin, we have already lost anyway ;-P

@Arnei
Copy link
Member

Arnei commented Oct 19, 2022

Although if we implement #826, your suggestion would not work for some subtitles, as we would then display subtitles that are not set in the config, right?

@lkiesow
Copy link
Member Author

lkiesow commented Oct 19, 2022

That's true. But that's true already, since those wouldn't necessary even have a +lang as part of the flavor. It's also more that I couldn't access a subtitle I knew was in the system and I wouldn't expect that to be common.

lkiesow added a commit to lkiesow/opencast-editor that referenced this issue Oct 28, 2022
This patch allows users to specify icons for languages selectors
displayed in the subtitle editor. Users have to specify the selectable
languages anyway and the algorithm used before guessed wrong for popular
languages like English.

If no icon is specified for a language, the selector will simply omit
the icon and display just the label.

This fixes opencast#825
lkiesow added a commit to lkiesow/opencast-editor that referenced this issue Oct 28, 2022
This patch allows users to specify icons for languages selectors
displayed in the subtitle editor. Users have to specify the selectable
languages anyway and the algorithm used before guessed wrong for popular
languages like English.

If no icon is specified for a language, the selector will simply omit
the icon and display just the label.

This fixes opencast#825
lkiesow added a commit to lkiesow/opencast-editor that referenced this issue Nov 23, 2022
This patch allows users to specify icons for languages selectors
displayed in the subtitle editor. Users have to specify the selectable
languages anyway and the algorithm used before guessed wrong for popular
languages like English.

If no icon is specified for a language, the selector will simply omit
the icon and display just the label.

This fixes opencast#825
lkiesow added a commit to lkiesow/opencast-editor that referenced this issue Nov 23, 2022
This patch allows users to specify icons for languages selectors
displayed in the subtitle editor. Users have to specify the selectable
languages anyway and the algorithm used before guessed wrong for popular
languages like English.

If no icon is specified for a language, the selector will simply omit
the icon and display just the label.

This fixes opencast#825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest type:bug Something isn't working type:visual-clarity A part of the UI is not visually readable view:subtitle-editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants