js: Don't use templates in files with translations
xgettext gained some support for template strings, and no longer fails when encountering '/' somewhere between backticks. Unfortunately its support is still buggy as hell, and it is now silently dropping translatable strings, yay. I hate making the code worse, but until xgettext really gets its shit together, the only viable way forward seems to be to not use template strings in any files listed in POTFILES. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1014
This commit is contained in:
@ -64,7 +64,7 @@ var InputSource = class {
|
||||
return this.id;
|
||||
|
||||
if (engineDesc.variant && engineDesc.variant.length > 0)
|
||||
return `${engineDesc.layout}+${engineDesc.variant}`;
|
||||
return '%s+%s'.format(engineDesc.layout, engineDesc.variant);
|
||||
else
|
||||
return engineDesc.layout;
|
||||
}
|
||||
@ -138,7 +138,7 @@ class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
|
||||
var InputSourceSettings = class {
|
||||
constructor() {
|
||||
if (this.constructor === InputSourceSettings)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
throw new TypeError('Cannot instantiate abstract class %s'.format(this.constructor.name));
|
||||
}
|
||||
|
||||
_emitInputSourcesChanged() {
|
||||
@ -211,7 +211,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
|
||||
try {
|
||||
props = conn.call_finish(result).deep_unpack()[0];
|
||||
} catch (e) {
|
||||
log(`Could not get properties from ${this._BUS_NAME}`);
|
||||
log('Could not get properties from %s'.format(this._BUS_NAME));
|
||||
return;
|
||||
}
|
||||
let layouts = props['X11Layout'].unpack();
|
||||
@ -239,7 +239,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
|
||||
for (let i = 0; i < layouts.length && !!layouts[i]; i++) {
|
||||
let id = layouts[i];
|
||||
if (variants[i])
|
||||
id += `+${variants[i]}`;
|
||||
id += '+%s'.format(variants[i]);
|
||||
sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id });
|
||||
}
|
||||
return sourcesList;
|
||||
@ -261,9 +261,9 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
|
||||
this._KEY_PER_WINDOW = 'per-window';
|
||||
|
||||
this._settings = new Gio.Settings({ schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA });
|
||||
this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this));
|
||||
this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this));
|
||||
this._settings.connect(`changed::${this._KEY_PER_WINDOW}`, this._emitPerWindowChanged.bind(this));
|
||||
this._settings.connect('changed::%s'.format(this._KEY_INPUT_SOURCES), this._emitInputSourcesChanged.bind(this));
|
||||
this._settings.connect('changed::%s'.format(this._KEY_KEYBOARD_OPTIONS), this._emitKeyboardOptionsChanged.bind(this));
|
||||
this._settings.connect('changed::%s'.format(this._KEY_PER_WINDOW), this._emitPerWindowChanged.bind(this));
|
||||
}
|
||||
|
||||
_getSourcesList(key) {
|
||||
@ -1071,7 +1071,7 @@ class InputSourceIndicator extends PanelMenu.Button {
|
||||
|
||||
let description = xkbLayout;
|
||||
if (xkbVariant.length > 0)
|
||||
description = `${description}\t${xkbVariant}`;
|
||||
description = '%s\t%s'.format(description, xkbVariant);
|
||||
|
||||
Util.spawn(['gkbd-keyboard-display', '-l', description]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user