mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-10 16:10:55 +00:00
4.5.2
* Added: Setting to hide the "New Settings" badge that displays on the FFZ Control Center button when there are new settings. * Fixed: Incorrect locale detection causing Algolia queries to fail when loading auto-completion for tags.
This commit is contained in:
parent
7c9272e727
commit
567708b7f1
3 changed files with 57 additions and 3 deletions
|
@ -151,7 +151,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
|
||||||
FrankerFaceZ.Logger = Logger;
|
FrankerFaceZ.Logger = Logger;
|
||||||
|
|
||||||
const VER = FrankerFaceZ.version_info = {
|
const VER = FrankerFaceZ.version_info = {
|
||||||
major: 4, minor: 5, revision: 1,
|
major: 4, minor: 5, revision: 2,
|
||||||
commit: __git_commit__,
|
commit: __git_commit__,
|
||||||
build: __webpack_hash__,
|
build: __webpack_hash__,
|
||||||
toString: () =>
|
toString: () =>
|
||||||
|
|
|
@ -13,6 +13,7 @@ export default class MenuButton extends SiteModule {
|
||||||
super(...args);
|
super(...args);
|
||||||
|
|
||||||
this.inject('i18n');
|
this.inject('i18n');
|
||||||
|
this.inject('settings');
|
||||||
this.inject('site.fine');
|
this.inject('site.fine');
|
||||||
|
|
||||||
this.should_enable = true;
|
this.should_enable = true;
|
||||||
|
@ -21,6 +22,16 @@ export default class MenuButton extends SiteModule {
|
||||||
this._important_update = false;
|
this._important_update = false;
|
||||||
this._new_settings = 0;
|
this._new_settings = 0;
|
||||||
|
|
||||||
|
this.settings.add('ffz.show-new-settings', {
|
||||||
|
default: true,
|
||||||
|
ui: {
|
||||||
|
path: 'Appearance > Layout >> Top Navigation',
|
||||||
|
title: 'Display an indicator on the FFZ Control Center button whenever there are new settings added to FrankerFaceZ.',
|
||||||
|
component: 'setting-check-box'
|
||||||
|
},
|
||||||
|
changed: () => this.update()
|
||||||
|
});
|
||||||
|
|
||||||
this.NavBar = this.fine.define(
|
this.NavBar = this.fine.define(
|
||||||
'nav-bar',
|
'nav-bar',
|
||||||
n => n.renderOnsiteNotifications && n.renderTwitchPrimeCrown
|
n => n.renderOnsiteNotifications && n.renderTwitchPrimeCrown
|
||||||
|
@ -40,7 +51,7 @@ export default class MenuButton extends SiteModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
get has_new() {
|
get has_new() {
|
||||||
return this._new_settings > 0
|
return this.settings.get('ffz.show-new-settings') && this._new_settings > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
get important_update() {
|
get important_update() {
|
||||||
|
|
|
@ -10,6 +10,49 @@ import {get, debounce, generateUUID} from 'utilities/object';
|
||||||
|
|
||||||
const LANGUAGE_MATCHER = /^auto___lang_(\w+)$/;
|
const LANGUAGE_MATCHER = /^auto___lang_(\w+)$/;
|
||||||
|
|
||||||
|
const ALGOLIA_LANGUAGES = {
|
||||||
|
bg: 'bg-bg',
|
||||||
|
cs: 'cs-cz',
|
||||||
|
da: 'da-dk',
|
||||||
|
de: 'de-de',
|
||||||
|
el: 'el-gr',
|
||||||
|
en: 'en-us',
|
||||||
|
es: 'es-es',
|
||||||
|
'es-mx': 'es-mx',
|
||||||
|
fi: 'fi-fi',
|
||||||
|
fr: 'fr-fr',
|
||||||
|
hu: 'hu-hu',
|
||||||
|
it: 'it-it',
|
||||||
|
ja: 'ja-jp',
|
||||||
|
ko: 'ko-kr',
|
||||||
|
nl: 'nl-nl',
|
||||||
|
no: 'no-no',
|
||||||
|
pl: 'pl-pl',
|
||||||
|
'pt-br': 'pt-br',
|
||||||
|
pt: 'pt-pt',
|
||||||
|
ro: 'ro-ro',
|
||||||
|
ru: 'ru-ru',
|
||||||
|
sk: 'sk-sk',
|
||||||
|
sv: 'sv-se',
|
||||||
|
th: 'th-th',
|
||||||
|
tr: 'tr-tr',
|
||||||
|
vi: 'vi-vn',
|
||||||
|
'zh-cn': 'zh-cn',
|
||||||
|
'zh-tw': 'zh-tw'
|
||||||
|
};
|
||||||
|
|
||||||
|
function getAlgoliaLanguage(locale) {
|
||||||
|
if ( ! locale )
|
||||||
|
return ALGOLIA_LANGUAGES.en;
|
||||||
|
|
||||||
|
locale = locale.toLowerCase();
|
||||||
|
if ( ALGOLIA_LANGUAGES[locale] )
|
||||||
|
return ALGOLIA_LANGUAGES[locale];
|
||||||
|
|
||||||
|
locale = locale.split('-')[0];
|
||||||
|
return ALGOLIA_LANGUAGES[locale] || ALGOLIA_LANGUAGES.en;
|
||||||
|
}
|
||||||
|
|
||||||
export default class TwitchData extends Module {
|
export default class TwitchData extends Module {
|
||||||
constructor(...args) {
|
constructor(...args) {
|
||||||
super(...args);
|
super(...args);
|
||||||
|
@ -432,7 +475,7 @@ export default class TwitchData extends Module {
|
||||||
if ( ! locale )
|
if ( ! locale )
|
||||||
locale = this.locale;
|
locale = this.locale;
|
||||||
|
|
||||||
locale = locale.toLowerCase();
|
locale = getAlgoliaLanguage(locale);
|
||||||
|
|
||||||
let nodes;
|
let nodes;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue