extensionBase: Set up translations automatically
If an extension provides the gettext domain in its metadata, then we can simply set up translations from the constructor, so do that for a bit more convenience. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>
This commit is contained in:
parent
abdd1346da
commit
0483dd31f0
@ -55,6 +55,10 @@ export class ExtensionBase {
|
|||||||
throw new Error(`${this.constructor.name} did not pass metadata to parent`);
|
throw new Error(`${this.constructor.name} did not pass metadata to parent`);
|
||||||
|
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
|
|
||||||
|
const domain = this.metadata['gettext-domain'];
|
||||||
|
if (domain)
|
||||||
|
this.initTranslations(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user