Bugfixes, translation
This commit is contained in:
@@ -17,7 +17,8 @@ const Gio = imports.gi.Gio;
|
|||||||
const MessageTray = imports.ui.messageTray;
|
const MessageTray = imports.ui.messageTray;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
|
const Gettext = imports.gettext;
|
||||||
|
const GLib = imports.gi.GLib;
|
||||||
|
|
||||||
|
|
||||||
/******************** Constants ********************/
|
/******************** Constants ********************/
|
||||||
@@ -44,6 +45,15 @@ function CinnamonDynamicWallpaperExtension(uuid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _(str) {
|
||||||
|
let customTranslation = Gettext.dgettext(UUID, str);
|
||||||
|
if (customTranslation !== str) {
|
||||||
|
return customTranslation;
|
||||||
|
}
|
||||||
|
return Gettext.gettext(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CinnamonDynamicWallpaperExtension.prototype = {
|
CinnamonDynamicWallpaperExtension.prototype = {
|
||||||
|
|
||||||
/******************** Lifecycle ********************/
|
/******************** Lifecycle ********************/
|
||||||
@@ -56,12 +66,14 @@ CinnamonDynamicWallpaperExtension.prototype = {
|
|||||||
_init: function(uuid) {
|
_init: function(uuid) {
|
||||||
this.settings = new Settings.ExtensionSettings(this, uuid);
|
this.settings = new Settings.ExtensionSettings(this, uuid);
|
||||||
|
|
||||||
|
Gettext.bindtextdomain(UUID, GLib.get_home_dir() + '/.local/share/locale');
|
||||||
|
|
||||||
// Check for the first startup
|
// Check for the first startup
|
||||||
if (this.settings.getValue("first_start")) {
|
if (!this.settings.getValue("first_start")) {
|
||||||
|
|
||||||
// Welcome notification
|
// Welcome notification
|
||||||
this.showNotification("Welcome to Cinnamon Dynamic Wallpaper",
|
this.showNotification(_("Welcome to Cinnamon Dynamic Wallpaper"),
|
||||||
"Check the preferences to choose a dynamic wallpaper", true)
|
_("Check the preferences to choose a dynamic wallpaper"), true)
|
||||||
|
|
||||||
// Hide the notification on system restart
|
// Hide the notification on system restart
|
||||||
this.settings.setValue("first_start", false)
|
this.settings.setValue("first_start", false)
|
||||||
@@ -98,8 +110,8 @@ CinnamonDynamicWallpaperExtension.prototype = {
|
|||||||
try {
|
try {
|
||||||
Util.spawnCommandLine("/usr/bin/env python3 " + DIRECTORY.path + "/src/main.py loop")
|
Util.spawnCommandLine("/usr/bin/env python3 " + DIRECTORY.path + "/src/main.py loop")
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
this.showNotification("Error!",
|
this.showNotification(_("Error!"),
|
||||||
"Cinnamon Dynamic Wallpaper got an error while running the loop script. Please create an issue on GitHub.")
|
_("Cinnamon Dynamic Wallpaper got an error while running the loop script. Please create an issue on GitHub."))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh every 60 seconds
|
// Refresh every 60 seconds
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import sys, datetime
|
import sys
|
||||||
from view.main_window import *
|
from view.main_window import *
|
||||||
from model.main_view_model import *
|
from model.main_view_model import *
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
import os, time
|
# GTK
|
||||||
from PIL import Image
|
|
||||||
from gi.repository import Gio, Gdk
|
from gi.repository import Gio, Gdk
|
||||||
|
|
||||||
|
# Packages
|
||||||
|
import os, time, gi, locale
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
# Local scripts
|
||||||
from service.cinnamon_pref_handler import *
|
from service.cinnamon_pref_handler import *
|
||||||
from service.suntimes import *
|
from service.suntimes import *
|
||||||
from service.time_bar_chart import *
|
from service.time_bar_chart import *
|
||||||
from service.location import *
|
from service.location import *
|
||||||
from enums.PeriodSourceEnum import *
|
from enums.PeriodSourceEnum import *
|
||||||
|
|
||||||
|
|
||||||
class Main_View_Model:
|
class Main_View_Model:
|
||||||
""" The main ViewModel for the application
|
""" The main ViewModel for the application
|
||||||
"""
|
"""
|
||||||
@@ -38,6 +43,13 @@ class Main_View_Model:
|
|||||||
|
|
||||||
self.background_settings = Gio.Settings.new("org.cinnamon.desktop.background")
|
self.background_settings = Gio.Settings.new("org.cinnamon.desktop.background")
|
||||||
|
|
||||||
|
|
||||||
|
# Language support
|
||||||
|
self.UUID = "cinnamon-dynamic-wallpaper@TobiZog"
|
||||||
|
self.localeDir = os.path.expanduser("~") + "/.local/share/locale"
|
||||||
|
locale.bindtextdomain(self.UUID, self.localeDir)
|
||||||
|
|
||||||
|
|
||||||
# Other Variables
|
# Other Variables
|
||||||
self.display = Gdk.Display.get_default()
|
self.display = Gdk.Display.get_default()
|
||||||
self.screen_height = self.display.get_monitor(0).get_geometry().height
|
self.screen_height = self.display.get_monitor(0).get_geometry().height
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class Cinnamon_Pref_Handler:
|
|||||||
with open(self.pref_location, "r") as pref_file:
|
with open(self.pref_location, "r") as pref_file:
|
||||||
self.pref_data = json.load(pref_file)
|
self.pref_data = json.load(pref_file)
|
||||||
|
|
||||||
|
self.first_start = self.extract_json('first_start')
|
||||||
self.picture_aspect = self.extract_json('picture_aspect')
|
self.picture_aspect = self.extract_json('picture_aspect')
|
||||||
self.dynamic_background_color = self.extract_json('dynamic_background_color')
|
self.dynamic_background_color = self.extract_json('dynamic_background_color')
|
||||||
self.image_source = self.extract_json('image_source')
|
self.image_source = self.extract_json('image_source')
|
||||||
@@ -93,6 +94,7 @@ class Cinnamon_Pref_Handler:
|
|||||||
def store_preferences(self):
|
def store_preferences(self):
|
||||||
""" Store the values of the Preference object to the JSON file
|
""" Store the values of the Preference object to the JSON file
|
||||||
"""
|
"""
|
||||||
|
self.value_to_json('first_start', self.first_start)
|
||||||
self.value_to_json('picture_aspect', self.picture_aspect)
|
self.value_to_json('picture_aspect', self.picture_aspect)
|
||||||
self.value_to_json('dynamic_background_color', self.dynamic_background_color)
|
self.value_to_json('dynamic_background_color', self.dynamic_background_color)
|
||||||
self.value_to_json('image_source', self.image_source)
|
self.value_to_json('image_source', self.image_source)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ gi.require_version("Gtk", "3.0")
|
|||||||
from gi.repository import Gtk, GdkPixbuf
|
from gi.repository import Gtk, GdkPixbuf
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
import subprocess, threading, time, locale
|
import subprocess, threading, time
|
||||||
from datetime import timedelta, datetime, date
|
from datetime import timedelta, datetime
|
||||||
|
|
||||||
# Local scripts
|
# Local scripts
|
||||||
from model.main_view_model import *
|
from model.main_view_model import *
|
||||||
@@ -17,11 +17,6 @@ from view.dialogs import *
|
|||||||
from enums.ImageSourceEnum import *
|
from enums.ImageSourceEnum import *
|
||||||
from enums.PeriodSourceEnum import *
|
from enums.PeriodSourceEnum import *
|
||||||
|
|
||||||
UUID = "cinnamon-dynamic-wallpaper@TobiZog"
|
|
||||||
|
|
||||||
localeDir = os.path.expanduser("~") + "/.local/share/locale"
|
|
||||||
locale.bindtextdomain(UUID, localeDir)
|
|
||||||
|
|
||||||
|
|
||||||
class Main_Window:
|
class Main_Window:
|
||||||
############################################################
|
############################################################
|
||||||
@@ -39,7 +34,7 @@ class Main_Window:
|
|||||||
|
|
||||||
# Glade
|
# Glade
|
||||||
self.builder = Gtk.Builder()
|
self.builder = Gtk.Builder()
|
||||||
self.builder.set_translation_domain(UUID)
|
self.builder.set_translation_domain(self.view_model.UUID)
|
||||||
self.builder.add_from_file(self.view_model.GLADE_URI)
|
self.builder.add_from_file(self.view_model.GLADE_URI)
|
||||||
self.builder.connect_signals(self)
|
self.builder.connect_signals(self)
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: cinnamon-dynamic-wallpaper@TobiZog 2.2\n"
|
"Project-Id-Version: cinnamon-dynamic-wallpaper@TobiZog 2.3\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
||||||
"extensions/issues\n"
|
"extensions/issues\n"
|
||||||
"POT-Creation-Date: 2024-02-11 19:14+0100\n"
|
"POT-Creation-Date: 2024-02-12 12:12+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -17,7 +17,25 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: 5.4/extension.js:127
|
#: 5.4/extension.js:75
|
||||||
|
msgid "Welcome to Cinnamon Dynamic Wallpaper"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:76
|
||||||
|
msgid "Check the preferences to choose a dynamic wallpaper"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:113
|
||||||
|
msgid "Error!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:114
|
||||||
|
msgid ""
|
||||||
|
"Cinnamon Dynamic Wallpaper got an error while running the loop script. "
|
||||||
|
"Please create an issue on GitHub."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:139
|
||||||
msgid "Open settings"
|
msgid "Open settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ msgstr ""
|
|||||||
"Project-Id-Version: cinnamon-dynamic-wallpaper@TobiZog 2.2\n"
|
"Project-Id-Version: cinnamon-dynamic-wallpaper@TobiZog 2.2\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
||||||
"extensions/issues\n"
|
"extensions/issues\n"
|
||||||
"POT-Creation-Date: 2024-02-11 19:14+0100\n"
|
"POT-Creation-Date: 2024-02-12 12:12+0100\n"
|
||||||
"PO-Revision-Date: 2024-02-11 19:08+0100\n"
|
"PO-Revision-Date: 2024-02-12 12:08+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: de\n"
|
"Language: de\n"
|
||||||
@@ -18,7 +18,27 @@ msgstr ""
|
|||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
"X-Generator: Poedit 3.0.1\n"
|
"X-Generator: Poedit 3.0.1\n"
|
||||||
|
|
||||||
#: 5.4/extension.js:127
|
#: 5.4/extension.js:75
|
||||||
|
msgid "Welcome to Cinnamon Dynamic Wallpaper"
|
||||||
|
msgstr "Willkommen zu Cinnamon Dynamic Wallpaper"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:76
|
||||||
|
msgid "Check the preferences to choose a dynamic wallpaper"
|
||||||
|
msgstr "Öffne die Einstellungen und konfiguriere die Erweiterung"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:113
|
||||||
|
msgid "Error!"
|
||||||
|
msgstr "Fehler!"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:114
|
||||||
|
msgid ""
|
||||||
|
"Cinnamon Dynamic Wallpaper got an error while running the loop script. "
|
||||||
|
"Please create an issue on GitHub."
|
||||||
|
msgstr ""
|
||||||
|
"Cinnamon Dynamic Wallpaper hat ein Problem beim Aufruf des loop-Skripts "
|
||||||
|
"festgestellt. Bitte wende dich an den Entwickler via GitHub."
|
||||||
|
|
||||||
|
#: 5.4/extension.js:139
|
||||||
msgid "Open settings"
|
msgid "Open settings"
|
||||||
msgstr "Einstellungen öffnen"
|
msgstr "Einstellungen öffnen"
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ msgstr ""
|
|||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
||||||
"extensions/issues\n"
|
"extensions/issues\n"
|
||||||
"POT-Creation-Date: 2024-02-11 19:14+0100\n"
|
"POT-Creation-Date: 2024-02-12 12:12+0100\n"
|
||||||
"PO-Revision-Date: 2024-02-11 19:28+0100\n"
|
"PO-Revision-Date: 2024-02-11 19:51+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
@@ -18,7 +18,26 @@ msgstr ""
|
|||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"X-Generator: Poedit 3.0.1\n"
|
"X-Generator: Poedit 3.0.1\n"
|
||||||
|
|
||||||
#: 5.4/extension.js:127
|
#: 5.4/extension.js:75
|
||||||
|
#, fuzzy
|
||||||
|
msgid "Welcome to Cinnamon Dynamic Wallpaper"
|
||||||
|
msgstr "Fondo de pantalla dinámico de Cinnamon"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:76
|
||||||
|
msgid "Check the preferences to choose a dynamic wallpaper"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:113
|
||||||
|
msgid "Error!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:114
|
||||||
|
msgid ""
|
||||||
|
"Cinnamon Dynamic Wallpaper got an error while running the loop script. "
|
||||||
|
"Please create an issue on GitHub."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: 5.4/extension.js:139
|
||||||
msgid "Open settings"
|
msgid "Open settings"
|
||||||
msgstr "Abrir configuración"
|
msgstr "Abrir configuración"
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ msgstr ""
|
|||||||
"Project-Id-Version: cinnamon-dynamic-wallpaper@TobiZog 2.2\n"
|
"Project-Id-Version: cinnamon-dynamic-wallpaper@TobiZog 2.2\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
|
||||||
"extensions/issues\n"
|
"extensions/issues\n"
|
||||||
"POT-Creation-Date: 2024-02-11 19:08+0100\n"
|
"POT-Creation-Date: 2024-02-12 12:12+0100\n"
|
||||||
"PO-Revision-Date: 2024-02-11 19:27+0100\n"
|
"PO-Revision-Date: 2024-02-12 12:12+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: nl\n"
|
"Language: nl\n"
|
||||||
@@ -18,7 +18,27 @@ msgstr ""
|
|||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
"X-Generator: Poedit 3.0.1\n"
|
"X-Generator: Poedit 3.0.1\n"
|
||||||
|
|
||||||
#: 5.4/extension.js:127
|
#: 5.4/extension.js:75
|
||||||
|
msgid "Welcome to Cinnamon Dynamic Wallpaper"
|
||||||
|
msgstr "Welkom op Cinnamon Dynamic Wallpaper"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:76
|
||||||
|
msgid "Check the preferences to choose a dynamic wallpaper"
|
||||||
|
msgstr "Controleer de voorkeuren om een dynamische achtergrond te kiezen"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:113
|
||||||
|
msgid "Error!"
|
||||||
|
msgstr "Fout!"
|
||||||
|
|
||||||
|
#: 5.4/extension.js:114
|
||||||
|
msgid ""
|
||||||
|
"Cinnamon Dynamic Wallpaper got an error while running the loop script. "
|
||||||
|
"Please create an issue on GitHub."
|
||||||
|
msgstr ""
|
||||||
|
"Cinnamon Dynamic Wallpaper kreeg een fout tijdens het uitvoeren van het loop-"
|
||||||
|
"script. Maak een ticket aan op GitHub."
|
||||||
|
|
||||||
|
#: 5.4/extension.js:139
|
||||||
msgid "Open settings"
|
msgid "Open settings"
|
||||||
msgstr "Instellingen openen"
|
msgstr "Instellingen openen"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user