mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-15 17:46:55 +00:00
4.20.22
This release implements a massive change to how link tool-tips and embeds work. They might act up a bit while we get the new back-end installed and tweaked. * Added: Options to use custom formats for dates and times, under `Appearance > Localization`. * Added: Options to change the colors of tool-tips. * Changed: Completely rewrite how link information is formatted together with a complete rewrite of the link information service. * Changed: The FFZ Control Center now remembers you previously open settings if you reload the page. * Fixed: Update chat lines when i18n data loads. * Fixed: i18n not correctly formatting certain numbers. * Fixed: Theater mode automatically enabling on user home pages. (Closes #866) * Fixed: Theater metadata overlapping chat with Swap Sidebars enabled. (Closes #835) * API Added: New icons: `location`, `link`, and `volume-off` * API Fixed: `createElement` not properly handling `<video>` related attributes.
This commit is contained in:
parent
eec65551fb
commit
6310a2ed49
49 changed files with 2432 additions and 884 deletions
81
src/i18n.js
81
src/i18n.js
|
@ -163,7 +163,7 @@ export class TranslationManager extends Module {
|
|||
},
|
||||
|
||||
ui: {
|
||||
path: 'Appearance > Localization >> General',
|
||||
path: 'Appearance > Localization >> General @{"sort":-100}',
|
||||
title: 'Language',
|
||||
description: `FrankerFaceZ is lovingly translated by volunteers from our community. Thank you. If you're interested in helping to translate FrankerFaceZ, please [join our Discord](https://discord.gg/UrAkGhT) and ask about localization.`,
|
||||
|
||||
|
@ -173,6 +173,82 @@ export class TranslationManager extends Module {
|
|||
|
||||
changed: val => this.locale = val
|
||||
});
|
||||
|
||||
|
||||
this.settings.add('i18n.format.date', {
|
||||
default: 'default',
|
||||
ui: {
|
||||
path: 'Appearance > Localization >> Formatting',
|
||||
title: 'Date Format',
|
||||
description: 'The default date format. Custom date formats are formated using the [Day.js](https://github.com/iamkun/dayjs#readme) library.',
|
||||
component: 'setting-combo-box',
|
||||
data: () => {
|
||||
const out = [], now = new Date;
|
||||
for (const [key,fmt] of Object.entries(this._.formats.date)) {
|
||||
out.push({
|
||||
value: key, title: `${this.formatDate(now, key)} (${key})`
|
||||
})
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
},
|
||||
|
||||
changed: val => {
|
||||
this._.defaultDateFormat = val;
|
||||
this.emit(':update')
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('i18n.format.time', {
|
||||
default: 'short',
|
||||
ui: {
|
||||
path: 'Appearance > Localization >> Formatting',
|
||||
title: 'Time Format',
|
||||
description: 'The default time format. Custom time formats are formated using the [Day.js](https://github.com/iamkun/dayjs#readme) library.',
|
||||
component: 'setting-combo-box',
|
||||
data: () => {
|
||||
const out = [], now = new Date;
|
||||
for (const [key,fmt] of Object.entries(this._.formats.time)) {
|
||||
out.push({
|
||||
value: key, title: `${this.formatTime(now, key)} (${key})`
|
||||
})
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
},
|
||||
|
||||
changed: val => {
|
||||
this._.defaultTimeFormat = val;
|
||||
this.emit(':update')
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('i18n.format.datetime', {
|
||||
default: 'medium',
|
||||
ui: {
|
||||
path: 'Appearance > Localization >> Formatting',
|
||||
title: 'Date-Time Format',
|
||||
description: 'The default combined date-time format. Custom time formats are formated using the [Day.js](https://github.com/iamkun/dayjs#readme) library.',
|
||||
component: 'setting-combo-box',
|
||||
data: () => {
|
||||
const out = [], now = new Date;
|
||||
for (const [key,fmt] of Object.entries(this._.formats.datetime)) {
|
||||
out.push({
|
||||
value: key, title: `${this.formatDateTime(now, key)} (${key})`
|
||||
})
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
},
|
||||
|
||||
changed: val => {
|
||||
this._.defaultDateTimeFormat = val;
|
||||
this.emit(':update')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getLocaleOptions(val) {
|
||||
|
@ -244,6 +320,9 @@ export class TranslationManager extends Module {
|
|||
|
||||
this._ = new NewTransCore({ //TranslationCore({
|
||||
warn: (...args) => this.log.warn(...args),
|
||||
defaultDateFormat: this.settings.get('i18n.format.date'),
|
||||
defaultTimeFormat: this.settings.get('i18n.format.time'),
|
||||
defaultDateTimeFormat: this.settings.get('i18n.format.datetime')
|
||||
});
|
||||
|
||||
if ( window.BroadcastChannel ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue