diff --git a/subprojects/extensions-tool/src/templates/indicator/extension.js b/subprojects/extensions-tool/src/templates/indicator/extension.js index 35784d846..d3afaac08 100644 --- a/subprojects/extensions-tool/src/templates/indicator/extension.js +++ b/subprojects/extensions-tool/src/templates/indicator/extension.js @@ -16,18 +16,15 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const GETTEXT_DOMAIN = 'my-indicator-extension'; - import GObject from 'gi://GObject'; import St from 'gi://St'; -const ExtensionUtils = imports.misc.extensionUtils; +import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js'; + const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const _ = ExtensionUtils.gettext; - const Indicator = GObject.registerClass( class Indicator extends PanelMenu.Button { _init() { @@ -46,16 +43,10 @@ class Indicator extends PanelMenu.Button { } }); -export default class Extension { - constructor(metadata) { - this._uuid = metadata.uuid; - - ExtensionUtils.initTranslations(GETTEXT_DOMAIN); - } - +export default class IndicatorExampleExtension extends Extension { enable() { this._indicator = new Indicator(); - Main.panel.addToStatusArea(this._uuid, this._indicator); + Main.panel.addToStatusArea(this.uuid, this._indicator); } disable() { diff --git a/subprojects/extensions-tool/src/templates/plain/extension.js b/subprojects/extensions-tool/src/templates/plain/extension.js index 5abdf6792..7c73f8e58 100644 --- a/subprojects/extensions-tool/src/templates/plain/extension.js +++ b/subprojects/extensions-tool/src/templates/plain/extension.js @@ -15,11 +15,9 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ +import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js'; -export default class Extension { - constructor() { - } - +export default class PlainExampleExtension extends Extension { enable() { }