1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-10 00:00:53 +00:00
* Fixed: Some settings strings not being assigned a localization key.
* Fixed: The right-click profile selector not using description localization keys for the default profiles.
This commit is contained in:
SirStendec 2019-10-14 17:25:59 -04:00
parent c77d2bdd10
commit 29414beaa0
3 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.14.4", "version": "4.14.5",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"license": "Apache-2.0", "license": "Apache-2.0",
"scripts": { "scripts": {

View file

@ -524,10 +524,10 @@ export default class SettingsManager extends Module {
if ( ! ui.key && ui.title ) if ( ! ui.key && ui.title )
ui.key = ui.title.toSnakeCase(); ui.key = ui.title.toSnakeCase();
if ( ui.component === 'setting-select-box' && Array.isArray(ui.data) ) { if ( (ui.component === 'setting-select-box' || ui.component === 'setting-combo-box') && Array.isArray(ui.data) ) {
const i18n_base = `${ui.i18n_key || `setting.entry.${key}`}.values`; const i18n_base = `${ui.i18n_key || `setting.entry.${key}`}.values`;
for(const value of ui.data) { for(const value of ui.data) {
if ( value.i18n_key === undefined && value.value ) if ( value.i18n_key === undefined && value.value !== undefined )
value.i18n_key = `${i18n_base}.${value.value}`; value.i18n_key = `${i18n_base}.${value.value}`;
} }
} }

View file

@ -350,12 +350,14 @@ export default class MenuButton extends SiteModule {
{ this.renderButtonIcon(profile) } { this.renderButtonIcon(profile) }
</button>) </button>)
const desc_key = profile.desc_i18n_key || profile.i18n_key && `${profile.i18n_key}.description`;
profiles.push(<div class="tw-relative tw-border-b tw-pd-y-05 tw-pd-l-1 tw-flex"> profiles.push(<div class="tw-relative tw-border-b tw-pd-y-05 tw-pd-l-1 tw-flex">
{toggle} {toggle}
<div> <div>
<h4>{ profile.i18n_key ? this.i18n.t(profile.i18n_key, profile.name, profile) : profile.name }</h4> <h4>{ profile.i18n_key ? this.i18n.t(profile.i18n_key, profile.name, profile) : profile.name }</h4>
{profile.description && (<div class="description"> {profile.description && (<div class="description">
{ profile.desc_i18n_key ? this.i18n.t(profile.desc_i18n_key, profile.description, profile) : profile.description } { desc_key ? this.i18n.t(desc_key, profile.description, profile) : profile.description }
</div>)} </div>)}
</div> </div>
</div>); </div>);