Release Vulpes OS 2.7-preview.24
This commit is contained in:
parent
49572b6b45
commit
97ef99f827
135 changed files with 7717 additions and 2524 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue