extensionPrefs: Initialize gettext

I misremembered that imports.package.start() would set up the correct
gettext domain, but the module only provides a convenience method
for doing that.

Use it to bring back translations in the Extensions app, whoops.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1108
This commit is contained in:
Florian Müllner 2020-03-19 20:38:16 +01:00 committed by Florian Müllner
parent 3bf0511f1b
commit f8886468ce
2 changed files with 3 additions and 4 deletions

View File

@ -2,12 +2,11 @@
imports.gi.versions.Gdk = '3.0'; imports.gi.versions.Gdk = '3.0';
imports.gi.versions.Gtk = '3.0'; imports.gi.versions.Gtk = '3.0';
imports.package.initFormat();
const Gettext = imports.gettext; const Gettext = imports.gettext;
const Package = imports.package;
const { Gdk, GLib, Gio, GObject, Gtk } = imports.gi; const { Gdk, GLib, Gio, GObject, Gtk } = imports.gi;
const _ = Gettext.gettext; Package.initFormat();
const ExtensionUtils = imports.misc.extensionUtils; const ExtensionUtils = imports.misc.extensionUtils;
@ -782,6 +781,7 @@ function initEnvironment() {
function main(argv) { function main(argv) {
initEnvironment(); initEnvironment();
Package.initGettext();
new Application().run(argv); new Application().run(argv);
} }

View File

@ -17,7 +17,6 @@ rules:
overrides: overrides:
- files: js/** - files: js/**
excludedFiles: excludedFiles:
- js/extensionPrefs/**
- js/portalHelper/* - js/portalHelper/*
globals: globals:
global: readonly global: readonly