Release Vulpes OS 2.7-preview.24

This commit is contained in:
OverSu 2026-11-04 12:52:20 +01:00
commit 97ef99f827
135 changed files with 7717 additions and 2524 deletions

View file

@ -9,6 +9,23 @@ var debug = require('debug')('view:setting-options');
var attach = require('attach');
var View = require('view');
var optionFallbacks = {
'self-timer-off': ['Off', 'Désactivé'],
'self-timer-2-seconds': ['2 seconds', '2 secondes'],
'self-timer-5-seconds': ['5 seconds', '5 secondes'],
'self-timer-10-seconds': ['10 seconds', '10 secondes'],
'grid-off': ['Off', 'Désactivée'],
'grid-on': ['On', 'Activées']
};
function fallbackTitle(key) {
var values = optionFallbacks[key];
if (!values) { return key; }
var locale = (document.documentElement.lang || navigator.language || 'en')
.toLowerCase();
return values[locale.indexOf('fr') === 0 ? 1 : 0];
}
/**
* Exports
*/
@ -67,7 +84,9 @@ module.exports = View.extend({
if (localizable) {
li.setAttribute('data-l10n-id', option.title);
this.l10n.formatValue(option.title).then((title) => {
li.setAttribute('aria-label', title);
var visibleTitle = title || fallbackTitle(option.title);
li.textContent = visibleTitle;
li.setAttribute('aria-label', visibleTitle);
});
} else {
li.textContent = option.title;

View file

@ -9,6 +9,25 @@ var debug = require('debug')('view:setting');
var bind = require('lib/bind');
var View = require('view');
var settingFallbacks = {
'self-timer': ['Self-Timer', 'Minuteur'],
'self-timer-off': ['Off', 'Désactivé'],
'self-timer-2-seconds': ['2 seconds', '2 secondes'],
'self-timer-5-seconds': ['5 seconds', '5 secondes'],
'self-timer-10-seconds': ['10 seconds', '10 secondes'],
grid: ['Grid Lines', 'Quadrillage'],
'grid-off': ['Off', 'Désactivée'],
'grid-on': ['On', 'Activé']
};
function fallbackText(key) {
var values = settingFallbacks[key];
if (!values) { return key; }
var locale = (document.documentElement.lang || navigator.language || 'en')
.toLowerCase();
return values[locale.indexOf('fr') === 0 ? 1 : 0];
}
/**
* Exports
*/
@ -50,6 +69,7 @@ module.exports = View.extend({
}
localizedValue.then(valueString => {
valueString = valueString || fallbackText(data.value);
this.l10n.setAttributes(
this.el,
'setting-option-' + data.title,
@ -62,6 +82,15 @@ module.exports = View.extend({
valueText: data.optionsLocalizable === false ? data.value : '',
});
var title = this.el.querySelector('.setting_title');
if (title && !title.textContent) {
title.textContent = fallbackText(data.title);
}
var value = this.el.querySelector('.setting_value');
if (value && !value.textContent) {
value.textContent = valueString;
}
// Clean up
delete this.template;