diff --git a/README.md b/README.md index 8dfba1b..d1b9f03 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Lightweight GNOME shell extension to set your wallpaper to a random Google Earth ## Requirements -GNOME Shell 3.38+ (Ubuntu Gnome 21.04+), legacy support exists for earlier GNOME Shell versions (3.28+) +GNOME Shell 3.36+ (Ubuntu Gnome 20.04 LTS+), legacy support exists for earlier GNOME Shell versions (3.28+) ## Install diff --git a/buildzip.sh b/buildzip.sh index 7b85fbd..dd97028 100755 --- a/buildzip.sh +++ b/buildzip.sh @@ -9,7 +9,7 @@ npm --version && (npm test; if [ $? -ne 0 ]; then exit 1; fi) glib-compile-schemas schemas/ intltool-extract --type=gettext/glade ui/Settings.ui intltool-extract --type=gettext/glade ui/Settings4.ui -xgettext -k -k_ -kN_ -o locale/GoogleEarthWallpaper.pot ui/Settings.ui.h ui/Settings4.ui.h extension.js prefs.js utils.js --from-code=UTF-8 +xgettext -k -k_ -kN_ --omit-header -o locale/GoogleEarthWallpaper.pot ui/Settings.ui.h ui/Settings4.ui.h extension.js prefs.js utils.js --from-code=UTF-8 for D in locale/*; do if [ -d "${D}" ]; then diff --git a/convenience.js b/convenience.js index 476de46..8388672 100644 --- a/convenience.js +++ b/convenience.js @@ -32,67 +32,6 @@ const Gio = imports.gi.Gio; const Config = imports.misc.config; const ExtensionUtils = imports.misc.extensionUtils; - -/** - * initTranslations: - * @domain: (optional): the gettext domain to use - * - * Initialize Gettext to load translations from extensionsdir/locale. - * If @domain is not provided, it will be taken from metadata['gettext-domain'] - */ -function initTranslations(domain) { - let extension = ExtensionUtils.getCurrentExtension(); - - domain = domain || extension.metadata['gettext-domain']; - - // check if this extension was built with "make zip-file", and thus - // has the locale files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell - let localeDir = extension.dir.get_child('locale'); - if (localeDir.query_exists(null)) - Gettext.bindtextdomain(domain, localeDir.get_path()); - else - Gettext.bindtextdomain(domain, Config.LOCALEDIR); -} - -/** - * getSettings: - * @schema: (optional): the GSettings schema id - * - * Builds and return a GSettings schema for @schema, using schema files - * in extensionsdir/schemas. If @schema is not provided, it is taken from - * metadata['settings-schema']. - */ -function getSettings(schema) { - let extension = ExtensionUtils.getCurrentExtension(); - - schema = schema || extension.metadata['settings-schema']; - - const GioSSS = Gio.SettingsSchemaSource; - - // check if this extension was built with "make zip-file", and thus - // has the schema files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell (and therefore schemas are available - // in the standard folders) - let schemaDir = extension.dir.get_child('schemas'); - let schemaSource; - if (schemaDir.query_exists(null)) - schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), - GioSSS.get_default(), - false); - else - schemaSource = GioSSS.get_default(); - - let schemaObj = schemaSource.lookup(schema, true); - if (!schemaObj) - throw new Error('Schema ' + schema + ' could not be found for extension ' - + extension.metadata.uuid + '. Please check your installation.'); - - return new Gio.Settings({ settings_schema: schemaObj }); -} - const versionArray = (v) => v.split(".").map(Number); const zip = function(a, b, defaultValue) { @@ -150,8 +89,6 @@ function currentVersionSmallerEqual(v) { } var exports = { -initTranslations, -getSettings, currentVersion, currentVersionEqual, currentVersionGreater, diff --git a/extension.js b/extension.js index 75f9019..94f7a9e 100644 --- a/extension.js +++ b/extension.js @@ -58,7 +58,7 @@ class GEWallpaperIndicator extends panelMenu.Button { _init (params = {}) { super._init(0, IndicatorName, false); - this._settings = Utils.getSettings(); + this._settings = ExtensionUtils.getSettings(Utils.schema); let gicon = Gio.icon_new_for_string(Me.dir.get_child('icons').get_path() + "/" + this._settings.get_string('icon') + "-symbolic.svg"); this.icon = new St.Icon({gicon: gicon, style_class: 'system-status-icon'}); this.x_fill = true; @@ -126,7 +126,7 @@ class GEWallpaperIndicator extends panelMenu.Button { } this.menu.addMenuItem(new popupMenu.PopupSeparatorMenuItem()); this.refreshItem.connect('activate', this._refresh.bind(this)); - this.settingsItem.connect('activate', this._open_prefs.bind(this)); + this.settingsItem.connect('activate', this._openPrefs.bind(this)); this.menu.addMenuItem(new popupMenu.PopupMenuItem(_("On refresh:"), {reactive : false} )); this.menu.addMenuItem(this.wallpaperToggle); if (!Convenience.currentVersionGreaterEqual("3.36")) { // lockscreen and desktop wallpaper are the same in GNOME 3.36+ @@ -149,8 +149,8 @@ class GEWallpaperIndicator extends panelMenu.Button { Util.spawn(["xdg-open", this.link]); } - _open_prefs () { - Util.spawn(["gnome-shell-extension-prefs", Me.metadata.uuid]); + _openPrefs() { + ExtensionUtils.openPrefs(); } _restorePreviousState () { @@ -408,7 +408,7 @@ class GEWallpaperIndicator extends panelMenu.Button { }); function init(extensionMeta) { - Convenience.initTranslations("GoogleEarthWallpaper"); + ExtensionUtils.initTranslations("GoogleEarthWallpaper"); } function enable() { diff --git a/locale/GoogleEarthWallpaper.pot b/locale/GoogleEarthWallpaper.pot index 5b0727c..916c43e 100644 --- a/locale/GoogleEarthWallpaper.pot +++ b/locale/GoogleEarthWallpaper.pot @@ -1,22 +1,3 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-19 21:56+1000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - #: ui/Settings.ui.h:1 ui/Settings4.ui.h:1 msgid "Hide the indicator" msgstr "" @@ -92,8 +73,8 @@ msgstr "" #: ui/Settings.ui.h:19 ui/Settings4.ui.h:20 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General Public License, version 3 or later for details." +"See the GNU General " +"Public License, version 3 or later for details." msgstr "" #: ui/Settings.ui.h:21 ui/Settings4.ui.h:22 @@ -190,42 +171,42 @@ msgstr "" msgid "Something went wrong..." msgstr "" -#: prefs.js:24 +#: prefs.js:26 msgid "5 m" msgstr "" -#: prefs.js:24 +#: prefs.js:26 msgid "10 m" msgstr "" -#: prefs.js:24 +#: prefs.js:26 msgid "30 m" msgstr "" -#: prefs.js:24 +#: prefs.js:26 msgid "60 m" msgstr "" -#: prefs.js:24 +#: prefs.js:26 msgid "90 m" msgstr "" -#: prefs.js:24 +#: prefs.js:26 msgid "daily" msgstr "" -#: utils.js:62 utils.js:65 +#: utils.js:33 utils.js:36 msgid "minutes" msgstr "" -#: utils.js:68 +#: utils.js:39 msgid "days" msgstr "" -#: utils.js:71 +#: utils.js:42 msgid "hours" msgstr "" -#: utils.js:98 +#: utils.js:69 msgid "No change log found for this release" msgstr "" diff --git a/locale/ar/LC_MESSAGES/ar.mo b/locale/ar/LC_MESSAGES/ar.mo new file mode 100644 index 0000000..24bd483 Binary files /dev/null and b/locale/ar/LC_MESSAGES/ar.mo differ diff --git a/locale/ar/LC_MESSAGES/ar.po b/locale/ar/LC_MESSAGES/ar.po new file mode 100644 index 0000000..ca04241 --- /dev/null +++ b/locale/ar/LC_MESSAGES/ar.po @@ -0,0 +1,239 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Amro Soliman , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-10-19 21:56+1000\n" +"PO-Revision-Date: 2021-12-20 23:03+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n" +"%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" +"X-Generator: Poedit 3.0.1\n" + +#: ui/Settings.ui.h:1 ui/Settings4.ui.h:1 +msgid "Hide the indicator" +msgstr "اخف المؤشر" + +#: ui/Settings.ui.h:2 ui/Settings4.ui.h:2 +msgid "Indicator brightness" +msgstr "سطوع المؤشر" + +#: ui/Settings.ui.h:3 ui/Settings4.ui.h:3 +msgid "Indicator" +msgstr "المؤشر" + +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:4 +msgid "Indicator icon" +msgstr "رمز المؤشر" + +#: ui/Settings.ui.h:5 ui/Settings4.ui.h:5 +msgid "Refresh interval" +msgstr "حدث كل" + +#: ui/Settings.ui.h:6 ui/Settings4.ui.h:6 +msgid "Change effective from next refresh" +msgstr "التعديل سيكون فعال ابداءا من التحديث القادم" + +#: ui/Settings.ui.h:7 ui/Settings4.ui.h:7 +msgid "Map Provider for external links" +msgstr "منصة الخرائط للروابط الخارجية" + +#: ui/Settings.ui.h:8 ui/Settings4.ui.h:8 +msgid "Provider used to view wallpaper location and context" +msgstr "المنصة المستخدمة لعرض موقع الصورة وسياقها" + +#: ui/Settings.ui.h:9 ui/Settings4.ui.h:9 extension.js:105 +msgid "Set background image" +msgstr "ضبط كخلفية للشاشة" + +#: ui/Settings.ui.h:10 ui/Settings4.ui.h:10 +msgid "Set lock screen image" +msgstr "ضبط كخلفية لواجهة الشاشة المقفلة" + +#: ui/Settings.ui.h:11 ui/Settings4.ui.h:11 +msgid "Set lock screen password prompt image" +msgstr "ضبط كخلفية لواجهة الشاشة المقفلة (صفحة ادخال الرقم السري)" + +#: ui/Settings.ui.h:12 ui/Settings4.ui.h:12 +msgid "Download folder:" +msgstr "مجلد التحميل:" + +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:14 +msgid "Wallpaper pictures folder" +msgstr "مجلد صور الخلفيات" + +#: ui/Settings.ui.h:14 ui/Settings4.ui.h:15 +msgid "Open download folder" +msgstr "فتح مجلد التحميل" + +#: ui/Settings.ui.h:15 ui/Settings4.ui.h:16 +msgid "Delete previously downloaded wallpapers:" +msgstr "حذف صور الخلفية المحملة سابقا:" + +#: ui/Settings.ui.h:16 ui/Settings4.ui.h:17 +msgid "Background" +msgstr "الخلفية" + +#: ui/Settings.ui.h:17 ui/Settings4.ui.h:18 +msgid "Changes since last version" +msgstr "التعديلات عن النسخة الاخيرة" + +#: ui/Settings.ui.h:18 ui/Settings4.ui.h:19 +msgid "Change log" +msgstr "سجل التغييرات" + +#: ui/Settings.ui.h:19 ui/Settings4.ui.h:20 +msgid "" +"This program comes with ABSOLUTELY NO WARRANTY.\n" +"See the GNU General Public License, version 3 or later for details." +msgstr "" +"يقدم هذا البرنامج دون أي ضمان على " +"الإطلاق.\n" +"راجع رخصة جنو العمومية ، الإصدار 3 أو أحدث لمزيد من التفاصيل." + +#: ui/Settings.ui.h:21 ui/Settings4.ui.h:22 +msgid "https://github.com/neffo/earth-view-wallpaper-gnome-extension" +msgstr "https://github.com/neffo/earth-view-wallpaper-gnome-extension" + +#: ui/Settings.ui.h:22 ui/Settings4.ui.h:23 +msgid "Based on NASA APOD Wallpaper extension by Elia Argentieri" +msgstr "يرتكز علي NASA APOD Gnome shell extension ل Elia Argentieri" + +#: ui/Settings.ui.h:23 ui/Settings4.ui.h:24 +msgid "" +"This GNOME shell extension sets your wallpaper to a random Google Earth " +"photo from a selection of curated locations." +msgstr "" +"هذا الامداد ل Gnome shell يقوم بضبط كخلفية بطريقة عشوائية صورة من Google " +"Earth من ضمن قائمة مواقع جغرافية." + +#: ui/Settings.ui.h:24 ui/Settings4.ui.h:25 extension.js:158 extension.js:303 +msgid "Google Earth Wallpaper" +msgstr "صور Google Earth" + +#: ui/Settings.ui.h:25 ui/Settings4.ui.h:26 +msgid "Maintained by Michael Carroll" +msgstr "بتطوير Michael Carroll" + +#: ui/Settings.ui.h:26 ui/Settings4.ui.h:27 +msgid "About" +msgstr "عن" + +#: ui/Settings4.ui.h:13 +msgid "Bing Wallpaper pictures folder" +msgstr "مجلد صور خلفيات Bing" + +#: extension.js:94 +msgid "" +msgstr "<لا يوجد تحديث مجدول>" + +#: extension.js:95 +msgid "Text Location" +msgstr "مكان النص" + +#: extension.js:96 +msgid "Geo Location" +msgstr "مكان الموقع" + +#: extension.js:97 +msgid "External Link" +msgstr "رابط خارجي" + +#: extension.js:98 +msgid "Copyright" +msgstr "حقوق الملكية" + +#: extension.js:99 +msgid "Set background image now" +msgstr "ضبط كخلفية للشاشة الان" + +#: extension.js:100 +msgid "Set lockscreen image now" +msgstr "ضبط كخلفية لواجهة الشاشة المقفلة الان" + +#: extension.js:101 +msgid "Refresh Now" +msgstr "حدث الآن" + +#: extension.js:102 +msgid "Extension settings" +msgstr "الإعدادات" + +#: extension.js:106 +msgid "Set lockscreen image" +msgstr "ضبط كخلفية لواجهة الشاشة المقفلة" + +#: extension.js:130 +msgid "On refresh:" +msgstr "عند التحديث:" + +#: extension.js:187 +msgid "Next refresh" +msgstr "التحديث التالي" + +#: extension.js:214 +msgid "View in " +msgstr "اعرض علي " + +#: extension.js:269 +msgid "Fetching..." +msgstr "تحميل البيانات..." + +#: extension.js:357 +msgid "No wallpaper available" +msgstr "ليست متاحة اي صور للخلفية" + +#: extension.js:358 +msgid "Something went wrong..." +msgstr "حدث خطأ ما..." + +#: prefs.js:24 +msgid "5 m" +msgstr "5 دقائق" + +#: prefs.js:24 +msgid "10 m" +msgstr "10 دقائق" + +#: prefs.js:24 +msgid "30 m" +msgstr "30 دقائق" + +#: prefs.js:24 +msgid "60 m" +msgstr "60 دقائق" + +#: prefs.js:24 +msgid "90 m" +msgstr "90 دقائق" + +#: prefs.js:24 +msgid "daily" +msgstr "يوميا" + +#: utils.js:62 utils.js:65 +msgid "minutes" +msgstr "دقائق" + +#: utils.js:68 +msgid "days" +msgstr "أيام" + +#: utils.js:71 +msgid "hours" +msgstr "ساعات" + +#: utils.js:98 +msgid "No change log found for this release" +msgstr "لم نعثر علي قائمة لتعديلات هذا الاصدار" diff --git a/locale/it/LC_MESSAGES/it.mo b/locale/it/LC_MESSAGES/it.mo new file mode 100644 index 0000000..16d4cb4 Binary files /dev/null and b/locale/it/LC_MESSAGES/it.mo differ diff --git a/locale/it/LC_MESSAGES/it.po b/locale/it/LC_MESSAGES/it.po new file mode 100644 index 0000000..69d42cf --- /dev/null +++ b/locale/it/LC_MESSAGES/it.po @@ -0,0 +1,240 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Amro Soliman , 2021. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-10-19 21:56+1000\n" +"PO-Revision-Date: 2021-12-21 16:41+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: ui/Settings.ui.h:1 ui/Settings4.ui.h:1 +msgid "Hide the indicator" +msgstr "Nascondi l'indicatore" + +#: ui/Settings.ui.h:2 ui/Settings4.ui.h:2 +msgid "Indicator brightness" +msgstr "Luminosità dell'indicatore" + +#: ui/Settings.ui.h:3 ui/Settings4.ui.h:3 +msgid "Indicator" +msgstr "Indicatore" + +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:4 +msgid "Indicator icon" +msgstr "Icona dell'indicatore" + +#: ui/Settings.ui.h:5 ui/Settings4.ui.h:5 +msgid "Refresh interval" +msgstr "Intervallo di aggiornamento" + +#: ui/Settings.ui.h:6 ui/Settings4.ui.h:6 +msgid "Change effective from next refresh" +msgstr "Le modifiche avranno effetto dal prossimo aggiornamento" + +#: ui/Settings.ui.h:7 ui/Settings4.ui.h:7 +msgid "Map Provider for external links" +msgstr "Sito mappe per link esterni" + +#: ui/Settings.ui.h:8 ui/Settings4.ui.h:8 +msgid "Provider used to view wallpaper location and context" +msgstr "Sito usato per mostrare la localizzazione e il contesto della foto" + +#: ui/Settings.ui.h:9 ui/Settings4.ui.h:9 extension.js:105 +msgid "Set background image" +msgstr "Imposta come sfondo" + +#: ui/Settings.ui.h:10 ui/Settings4.ui.h:10 +msgid "Set lock screen image" +msgstr "Imposta come schermata di blocco" + +#: ui/Settings.ui.h:11 ui/Settings4.ui.h:11 +msgid "Set lock screen password prompt image" +msgstr "" +"Imposta come sfondo della schermata inserimento password per l'accesso" + +#: ui/Settings.ui.h:12 ui/Settings4.ui.h:12 +msgid "Download folder:" +msgstr "Cartella di scaricamento:" + +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:14 +msgid "Wallpaper pictures folder" +msgstr "Cartella delle immagini" + +#: ui/Settings.ui.h:14 ui/Settings4.ui.h:15 +msgid "Open download folder" +msgstr "Apri cartella immagini" + +#: ui/Settings.ui.h:15 ui/Settings4.ui.h:16 +msgid "Delete previously downloaded wallpapers:" +msgstr "Elimina sfondi precedentemente scaricati:" + +#: ui/Settings.ui.h:16 ui/Settings4.ui.h:17 +msgid "Background" +msgstr "Sfondo" + +#: ui/Settings.ui.h:17 ui/Settings4.ui.h:18 +msgid "Changes since last version" +msgstr "Modifiche dall'ultima versione" + +#: ui/Settings.ui.h:18 ui/Settings4.ui.h:19 +msgid "Change log" +msgstr "Modifiche" + +#: ui/Settings.ui.h:19 ui/Settings4.ui.h:20 +msgid "" +"This program comes with ABSOLUTELY NO WARRANTY.\n" +"See the GNU General Public License, version 3 or later for details." +msgstr "" +"Questo programma viene fornito ASSOLUTAMENTE SENZA " +"GARANZIA.\n" +"Vedi la Licenza Pubblica Generale GNU, versione 3 o successiva per i " +"dettagli." + +#: ui/Settings.ui.h:21 ui/Settings4.ui.h:22 +msgid "https://github.com/neffo/earth-view-wallpaper-gnome-extension" +msgstr "https://github.com/neffo/earth-view-wallpaper-gnome-extension" + +#: ui/Settings.ui.h:22 ui/Settings4.ui.h:23 +msgid "Based on NASA APOD Wallpaper extension by Elia Argentieri" +msgstr "Basato su NASA APOD Wallpaper extension di Elia Argentieri" + +#: ui/Settings.ui.h:23 ui/Settings4.ui.h:24 +msgid "" +"This GNOME shell extension sets your wallpaper to a random Google Earth " +"photo from a selection of curated locations." +msgstr "" +"Questa estensione di Gnome shell imposta come sfondo, in modo casuale, una " +"delle foto di Google Earth di una curata lista di luoghi." + +#: ui/Settings.ui.h:24 ui/Settings4.ui.h:25 extension.js:158 extension.js:303 +msgid "Google Earth Wallpaper" +msgstr "Sfondi di Google Earth" + +#: ui/Settings.ui.h:25 ui/Settings4.ui.h:26 +msgid "Maintained by Michael Carroll" +msgstr "Mantenuto da Michael Carroll" + +#: ui/Settings.ui.h:26 ui/Settings4.ui.h:27 +msgid "About" +msgstr "Informazioni" + +#: ui/Settings4.ui.h:13 +msgid "Bing Wallpaper pictures folder" +msgstr "Cartella sfondi Bing Wallpaper" + +#: extension.js:94 +msgid "" +msgstr "" + +#: extension.js:95 +msgid "Text Location" +msgstr "Posizione testo" + +#: extension.js:96 +msgid "Geo Location" +msgstr "Geolocalizzazione" + +#: extension.js:97 +msgid "External Link" +msgstr "Link esterno" + +#: extension.js:98 +msgid "Copyright" +msgstr "Diritti d'autore" + +#: extension.js:99 +msgid "Set background image now" +msgstr "Imposta come sfondo ora" + +#: extension.js:100 +msgid "Set lockscreen image now" +msgstr "Imposta come sfondo schermata di blocco ora" + +#: extension.js:101 +msgid "Refresh Now" +msgstr "Aggiorna ora" + +#: extension.js:102 +msgid "Extension settings" +msgstr "Impostazioni estensione" + +#: extension.js:106 +msgid "Set lockscreen image" +msgstr "Imposta come sfondo schermata di blocco" + +#: extension.js:130 +msgid "On refresh:" +msgstr "Al momento di aggiornamento:" + +#: extension.js:187 +msgid "Next refresh" +msgstr "Prossimo aggiornamento" + +#: extension.js:214 +msgid "View in " +msgstr "Mostra su " + +#: extension.js:269 +msgid "Fetching..." +msgstr "Scaricamento dati..." + +#: extension.js:357 +msgid "No wallpaper available" +msgstr "Nessuno sfondo disponibile" + +#: extension.js:358 +msgid "Something went wrong..." +msgstr "Qualcosa è andato storto..." + +#: prefs.js:24 +msgid "5 m" +msgstr "5 m" + +#: prefs.js:24 +msgid "10 m" +msgstr "10 m" + +#: prefs.js:24 +msgid "30 m" +msgstr "30 m" + +#: prefs.js:24 +msgid "60 m" +msgstr "60 m" + +#: prefs.js:24 +msgid "90 m" +msgstr "90 m" + +#: prefs.js:24 +msgid "daily" +msgstr "quotidianamente" + +#: utils.js:62 utils.js:65 +msgid "minutes" +msgstr "minuti" + +#: utils.js:68 +msgid "days" +msgstr "giorni" + +#: utils.js:71 +msgid "hours" +msgstr "ore" + +#: utils.js:98 +msgid "No change log found for this release" +msgstr "Nessuna lista delle modifiche trovata per questa versione" diff --git a/metadata.json b/metadata.json index 751b06d..8f94b9a 100644 --- a/metadata.json +++ b/metadata.json @@ -1,9 +1,10 @@ { "uuid": "GoogleEarthWallpaper@neffo.github.com", - "shell-version": ["3.38", "40", "41"], + "shell-version": ["3.36", "3.38", "40", "41", "42"], "name": "Google Earth Wallpaper", "settings-schema": "org.gnome.shell.extensions.googleearthwallpaper", - "description": "Lightweight GNOME shell extension to set your wallpaper to a random photo from the curated Google Earth collection (1500 photos).\n\n*Disclaimer*: this extension is unofficial and not affiliated with Google in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nSee also my other extension, Bing Wallpaper Changer (https://github.com/neffo/bing-wallpaper-gnome-extension).\n\nFeatures:\n* Fetches a random Google Earth wallpaper and sets as both lock screen and desktop wallpaper\n* User selectable refresh intervals (default is once per day)\n* View location on Google Maps, Bing Maps, Gnome Maps, OpenStreetMaps\n* German, Dutch and Chinese translations\n\nPlease report any bugs or suggestions to extension GitHub page below.", - "version": "13", - "url": "https://github.com/neffo/earth-view-wallpaper-gnome-extension" + "description": "Lightweight GNOME shell extension to set your wallpaper to a random photo from the curated Google Earth collection (2604 photos).\n\n*Disclaimer*: this extension is unofficial and not affiliated with Google in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nSee also my other extension, Bing Wallpaper Changer (https://github.com/neffo/bing-wallpaper-gnome-extension).\n\nFeatures:\n* Fetches a random Google Earth wallpaper and sets as both lock screen and desktop wallpaper\n* User selectable refresh intervals (default is once per day)\n* View location on Google Maps, Bing Maps, Gnome Maps, OpenStreetMaps\n* German, Dutch and Chinese translations\n\nPlease report any bugs or suggestions to extension GitHub page below.", + "version": "14", + "url": "https://github.com/neffo/earth-view-wallpaper-gnome-extension", + "gettext-domain": "GoogleEarthWallpaper" } diff --git a/prefs.js b/prefs.js index 292e679..e73547e 100644 --- a/prefs.js +++ b/prefs.js @@ -10,7 +10,8 @@ imports.gi.versions.Soup = '2.4'; const {Gtk, Gio, GLib, Soup} = imports.gi; -const Me = imports.misc.extensionUtils.getCurrentExtension(); +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); const Utils = Me.imports.utils; const Convenience = Me.imports.convenience; @@ -27,12 +28,12 @@ const interval_names = [ _("5 m"), _("10 m"), _("30 m"), _("60 m"), _("90 m"), _ const providerNames = ['Google Earth', 'Google Maps', 'Bing Maps', 'OpenStreetMap' , 'GNOME Maps']; function init() { - Convenience.initTranslations("GoogleEarthWallpaper"); + ExtensionUtils.initTranslations("GoogleEarthWallpaper"); } function buildPrefsWidget(){ // Prepare labels and controls - settings = Utils.getSettings(Me); + settings = ExtensionUtils.getSettings(Utils.schema); let buildable = new Gtk.Builder(); if (Gtk.get_major_version() == 4) { // GTK4 removes some properties, and builder breaks when it sees them buildable.add_from_file( Me.dir.get_path() + '/ui/Settings4.ui' ); @@ -58,8 +59,7 @@ function buildPrefsWidget(){ let folderButton = buildable.get_object('button_open_download_folder'); let icon_image = buildable.get_object('icon_image'); let change_log = buildable.get_object('change_log'); - - settings = Utils.getSettings(Me); + // enable change log access httpSession = new Soup.SessionAsync(); Soup.Session.prototype.add_feature.call(httpSession, new Soup.ProxyResolverDefault()); diff --git a/ui/Settings.ui b/ui/Settings.ui index 4a3dc5d..3deae54 100644 --- a/ui/Settings.ui +++ b/ui/Settings.ui @@ -725,7 +725,7 @@ Author: Michael Carroll 36 12 <span size="small">This program comes with ABSOLUTELY NO WARRANTY. -See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 3 or later</a> for details.</span> +See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3 or later</a> for details.</span> True center True diff --git a/ui/Settings.ui.h b/ui/Settings.ui.h index 22105d0..2f465ae 100644 --- a/ui/Settings.ui.h +++ b/ui/Settings.ui.h @@ -17,7 +17,7 @@ char *s = N_("Background"); char *s = N_("Changes since last version"); char *s = N_("Change log"); char *s = N_("This program comes with ABSOLUTELY NO WARRANTY.\n" - "See the GNU General Public License, version 3 or later for details."); + "See the GNU General Public License, version 3 or later for details."); char *s = N_("https://github.com/neffo/earth-view-wallpaper-gnome-extension"); char *s = N_("Based on NASA APOD Wallpaper extension by Elia Argentieri"); char *s = N_("This GNOME shell extension sets your wallpaper to a random Google Earth photo from a selection of curated locations."); diff --git a/ui/Settings4.ui b/ui/Settings4.ui index 5db453b..0628d62 100644 --- a/ui/Settings4.ui +++ b/ui/Settings4.ui @@ -595,7 +595,7 @@ 36 12 <span size="small">This program comes with ABSOLUTELY NO WARRANTY. -See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 3 or later</a> for details.</span> +See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3 or later</a> for details.</span> 1 center 1 diff --git a/ui/Settings4.ui.h b/ui/Settings4.ui.h index 836831b..fe12c77 100644 --- a/ui/Settings4.ui.h +++ b/ui/Settings4.ui.h @@ -18,7 +18,7 @@ char *s = N_("Background"); char *s = N_("Changes since last version"); char *s = N_("Change log"); char *s = N_("This program comes with ABSOLUTELY NO WARRANTY.\n" - "See the GNU General Public License, version 3 or later for details."); + "See the GNU General Public License, version 3 or later for details."); char *s = N_("https://github.com/neffo/earth-view-wallpaper-gnome-extension"); char *s = N_("Based on NASA APOD Wallpaper extension by Elia Argentieri"); char *s = N_("This GNOME shell extension sets your wallpaper to a random Google Earth photo from a selection of curated locations."); diff --git a/utils.js b/utils.js index d5ca544..5634ebc 100644 --- a/utils.js +++ b/utils.js @@ -18,36 +18,7 @@ var icon_list = ['pin', 'globe','official']; var icon_list_filename = ['pin-symbolic', 'globe-symbolic', 'official']; var gitreleaseurl = 'https://api.github.com/repos/neffo/earth-view-wallpaper-gnome-extension/releases/tags/'; - -function getSettings() { - let extension = ExtensionUtils.getCurrentExtension(); - let schema = 'org.gnome.shell.extensions.googleearthwallpaper'; - - const GioSSS = Gio.SettingsSchemaSource; - - // check if this extension was built with "make zip-file", and thus - // has the schema files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell (and therefore schemas are available - // in the standard folders) - let schemaDir = extension.dir.get_child('schemas'); - let schemaSource; - if (schemaDir.query_exists(null)) { - schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), - GioSSS.get_default(), - false); - } else { - schemaSource = GioSSS.get_default(); - } - - let schemaObj = schemaSource.lookup(schema, true); - if (!schemaObj) { - throw new Error('Schema ' + schema + ' could not be found for extension ' + - extension.metadata.uuid + '. Please check your installation.'); - } - - return new Gio.Settings({settings_schema: schemaObj}); -} +var schema = 'org.gnome.shell.extensions.googleearthwallpaper'; function friendly_time_diff(time, short = true) { // short we want to keep ~4-5 characters @@ -116,10 +87,14 @@ function validate_icon(settings, icon_image = null) { } // Utility function -function dump(object) { +function dump(object, level = 0) { let output = ''; for (let property in object) { - output += property + ': ' + object[property]+'; '; + output += "-".repeat(level)+property + ': ' + object[property]+'\n '; + if ( typeof property === 'object' ) + output += dump(property, level+1); } - log(output); + if (level == 0) + log(output); + return(output); }