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

fix(text-track-settings): localization not correctly applied #8904

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/tracks/text-track-fieldset.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class TextTrackFieldset extends Component {
const label = Dom.createEl('label', {
id,
className: 'vjs-label',
textContent: selectConfig.label
textContent: this.localize(selectConfig.label)
});

label.setAttribute('for', guid);
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/text-track-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class TextTrackSelect extends Component {
{
id: optionId,
value: this.localize(optionText[0]),
textContent: optionText[1]
textContent: this.localize(optionText[1])
}
);

Expand Down
8 changes: 7 additions & 1 deletion test/unit/tracks/text-track-settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,16 @@ QUnit.test('should update on languagechange', function(assert) {
tracks
});

videojs.addLanguage('test', {'Font Size': 'FONTSIZE'});
videojs.addLanguage('test', {
'Font Size': 'FONTSIZE',
'Color': 'COLOR',
'White': 'WHITE'
});
player.language('test');

assert.equal(player.$('.vjs-font-percent legend').textContent, 'FONTSIZE', 'settings dialog updates on languagechange');
assert.equal(player.$('.vjs-text-color label').textContent, 'COLOR', 'settings dialog label updates on languagechange');
assert.equal(player.$('.vjs-text-color select option').textContent, 'WHITE', 'settings dialog select updates on languagechange');

player.dispose();
});
Expand Down