mirror of
https://github.com/anufrievroman/waypaper.git
synced 2024-11-22 07:22:19 +03:00
Refactoring translations and language system
This commit is contained in:
parent
52fef50a0e
commit
85ac593e22
@ -12,33 +12,18 @@ from waypaper.changer import change_wallpaper
|
||||
from waypaper.common import get_random_file
|
||||
from waypaper.config import Config
|
||||
from waypaper.options import BACKEND_OPTIONS, FILL_OPTIONS
|
||||
from waypaper.translations import Chinese, English, French, German, Polish, Russian, Belarusian, Spanish
|
||||
from waypaper.translations import load_language
|
||||
|
||||
|
||||
# Get application metadata.
|
||||
about = AboutData()
|
||||
# Get application settings.
|
||||
|
||||
# Get application settings and language package:
|
||||
cf = Config()
|
||||
cf.read()
|
||||
txt = load_language(cf.lang)
|
||||
|
||||
# Define the text language of the application based on the configuration.
|
||||
if cf.lang == "de":
|
||||
txt = German()
|
||||
elif cf.lang == "fr":
|
||||
txt = French()
|
||||
elif cf.lang == "ru":
|
||||
txt = Russian()
|
||||
elif cf.lang == "by":
|
||||
txt = Belarusian()
|
||||
elif cf.lang == "pl":
|
||||
txt = Polish()
|
||||
elif cf.lang == "zh":
|
||||
txt = Chinese()
|
||||
elif cf.lang == "es":
|
||||
txt = Spanish()
|
||||
else:
|
||||
txt = English()
|
||||
|
||||
|
||||
# Define command line argument parser.
|
||||
# Define command line argument parser and parse user arguments:
|
||||
parser = argparse.ArgumentParser(
|
||||
prog=about.applicationName(), description=txt.msg_desc, epilog=txt.msg_info
|
||||
)
|
||||
@ -55,13 +40,12 @@ args = parser.parse_args()
|
||||
|
||||
|
||||
def run():
|
||||
"""Read user arguments and either run GUI app or just reset the wallpaper"""
|
||||
cf.read()
|
||||
"""Read user arguments and either run GUI app or perform requested action"""
|
||||
cf.read_state() # read default state file, if use_xdg_state is True
|
||||
cf.read_parameters_from_user_arguments(args)
|
||||
if args.state_file:
|
||||
cf.read_state() # read from custom state file if provided
|
||||
cf.read_parameters_from_user_arguments(args) # ensure that user arguments override values from state file
|
||||
cf.read_parameters_from_user_arguments(args) # user arguments override values from state file
|
||||
cf.check_validity()
|
||||
|
||||
# Set the wallpapers and quit:
|
||||
|
@ -120,7 +120,7 @@ class App(Gtk.Window):
|
||||
self.clear_button.connect("clicked", self.on_clear_button)
|
||||
|
||||
# Create the options menu button:
|
||||
self.options_button = Gtk.Button(label="Options")
|
||||
self.options_button = Gtk.Button(label=self.txt.msg_options)
|
||||
self.options_button.connect("clicked", self.on_options_button_clicked)
|
||||
|
||||
# Create a sort option dropdown menu:
|
||||
@ -216,6 +216,7 @@ class App(Gtk.Window):
|
||||
# Create mpv stop button:
|
||||
self.mpv_stop_button = Gtk.Button(label=self.txt.msg_stop)
|
||||
self.mpv_stop_button.connect("clicked", self.on_mpv_stop_button_clicked)
|
||||
self.mpv_stop_button.set_tooltip_text(self.txt.tip_mpv_stop)
|
||||
|
||||
# Create a box to contain the bottom row of buttons with margin:
|
||||
self.bottom_button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=60)
|
||||
@ -361,9 +362,8 @@ class App(Gtk.Window):
|
||||
def mpv_options_display(self) -> None:
|
||||
"""Show mpv options if backend is mpvpaper"""
|
||||
self.options_box.remove(self.mpv_stop_button)
|
||||
if self.cf.backend != "mpvpaper":
|
||||
return
|
||||
self.options_box.pack_end(self.mpv_stop_button, False, False, 0)
|
||||
if self.cf.backend == "mpvpaper":
|
||||
self.options_box.pack_end(self.mpv_stop_button, False, False, 0)
|
||||
|
||||
def fill_option_display(self):
|
||||
"""Display fill option if backend is not hyprpaper"""
|
||||
@ -608,6 +608,7 @@ class App(Gtk.Window):
|
||||
self.cf.backend = self.backend_option_combo.get_active_text()
|
||||
self.cf.selected_monitor = "All"
|
||||
self.monitor_option_display()
|
||||
self.mpv_options_display()
|
||||
self.swww_options_display()
|
||||
self.fill_option_display()
|
||||
self.color_picker_display()
|
||||
|
@ -6,10 +6,10 @@ from pathlib import Path
|
||||
|
||||
from waypaper.config import Config
|
||||
from waypaper.common import get_monitor_names
|
||||
from waypaper.translations import Chinese, English, French, German, Polish, Russian, Belarusian
|
||||
from waypaper.translations import Chinese, English, French, German, Polish, Russian, Belarusian, Spanish
|
||||
|
||||
def change_wallpaper(image_path: Path, cf: Config, monitor: str,
|
||||
txt: Chinese|English|French|German|Polish|Russian|Belarusian):
|
||||
txt: Chinese|English|French|German|Polish|Russian|Belarusian|Spanish):
|
||||
"""Run system commands to change the wallpaper depending on the backend"""
|
||||
|
||||
try:
|
||||
|
@ -85,6 +85,7 @@ class Config:
|
||||
self.swww_transition_duration = config.get("Settings", "swww_transition_duration", fallback=self.swww_transition_duration)
|
||||
self.swww_transition_fps = config.get("Settings", "swww_transition_fps", fallback=self.swww_transition_fps)
|
||||
self.lang = config.get("Settings", "language", fallback=self.lang)
|
||||
print(f"We got: {self.lang}")
|
||||
self.include_subfolders = config.getboolean("Settings", "subfolders", fallback=self.include_subfolders)
|
||||
self.show_transition_options = config.getboolean("Settings", "show_transition_options", fallback=self.show_transition_options)
|
||||
self.show_hidden = config.getboolean("Settings", "show_hidden", fallback=self.show_hidden)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
class English:
|
||||
def __init__(self):
|
||||
self.msg_desc = "GUI wallpaper setter for Wayland and X11. It works as a frontend for feh, swaybg, wallutils, hyprpaper, and swww."
|
||||
self.msg_desc = "GUI wallpaper setter for Wayland and X11. It works as a frontend for feh, swaybg, wallutils, hyprpaper, mpvpaper, and swww."
|
||||
self.msg_info = "For more information, visit:\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "print version of the program"
|
||||
@ -24,6 +24,7 @@ class English:
|
||||
self.msg_search = "Search"
|
||||
self.msg_random = "Random"
|
||||
self.msg_exit = "Exit"
|
||||
self.msg_options = "Options"
|
||||
self.msg_subfolders = "Show subfolders"
|
||||
self.msg_hidden = "Show hidden"
|
||||
self.msg_gifs = "Show gifs only"
|
||||
@ -41,8 +42,9 @@ class English:
|
||||
self.err_cache = "Error deleting cache"
|
||||
self.err_backend = "Looks like none of the wallpaper backends is installed in the system.\n"
|
||||
self.err_backend += "Use your package manager to install at least one of these backends:\n\n"
|
||||
self.err_backend += "- swaybg (for Wayland)\n- swww (for Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (for Wayland)\n- feh (for Xorg)\n- wallutils (for Xorg & Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Error changing wallpaper:"
|
||||
self.err_disp = "Error determining monitor names:"
|
||||
@ -56,11 +58,12 @@ class English:
|
||||
self.tip_random = "Set random wallpaper"
|
||||
self.tip_exit = "Exit the application"
|
||||
self.tip_transition = "Choose transition type"
|
||||
self.tip_mpv_stop = "Stop all mpv processes"
|
||||
|
||||
|
||||
class German:
|
||||
def __init__(self):
|
||||
self.msg_desc = "Grafisches Hintergrundbild-Auswahlwerkzeug für Wayland und X11. Es dient als Frontend für feh, swaybg, wallutils, hyprpaper und swww."
|
||||
self.msg_desc = "Grafisches Hintergrundbild-Auswahlwerkzeug für Wayland und X11. Es dient als Frontend für feh, swaybg, wallutils, hyprpaper, mpvpaper, und swww."
|
||||
self.msg_info = "Weitere Informationen finden Sie unter:\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "gibt die Programmversion aus"
|
||||
@ -77,14 +80,15 @@ class German:
|
||||
self.msg_select = "Auswählen"
|
||||
self.msg_refresh = "Aktualisieren"
|
||||
self.msg_random = "Zufällig"
|
||||
self.msg_clear = "Clear"
|
||||
self.msg_stop = "Stop"
|
||||
self.msg_search = "Search"
|
||||
self.msg_clear = "Löschen"
|
||||
self.msg_stop = "Stopp"
|
||||
self.msg_search = "Suchen"
|
||||
self.msg_options = "Optionen"
|
||||
self.msg_exit = "Beenden"
|
||||
self.msg_subfolders = "Unterordner"
|
||||
self.msg_hidden = "Hidden"
|
||||
self.msg_gifs = "Show only gifs"
|
||||
self.msg_transitions = "Show transition options"
|
||||
self.msg_hidden = "Zeige versteckte"
|
||||
self.msg_gifs = "Nur GIFs anzeigen"
|
||||
self.msg_transitions = "Übergangsoptionen anzeigen"
|
||||
self.msg_changefolder = "Ordner"
|
||||
self.msg_choosefolder = "Bitte wählen Sie einen Ordner aus"
|
||||
self.msg_caching = "Hintergrundbilder werden zwischengespeichert..."
|
||||
@ -98,8 +102,9 @@ class German:
|
||||
self.err_cache = "Fehler beim Löschen des Zwischenspeichers"
|
||||
self.err_backend = "Es konnte kein Hintergrundbild-Backend gefunden werden.\n"
|
||||
self.err_backend += "Installieren Sie mindestens eines der folgenden Backends:\n\n"
|
||||
self.err_backend += "- swaybg (für Wayland)\n- swww (für Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (fur Wayland)\n- feh (für Xorg)\n- wallutils (für Xorg & Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Fehler beim Ändern des Hintergrundbildes:"
|
||||
self.err_disp = "Fehler beim Ermitteln der Monitor-Namen:"
|
||||
@ -113,11 +118,12 @@ class German:
|
||||
self.tip_random = "Ein zufälliges Hintergrundbild auswählen"
|
||||
self.tip_exit = "Das Programm beenden"
|
||||
self.tip_transition = "Übergangstyp auswählen"
|
||||
self.tip_mpv_stop = "Stoppe alle mpv-Prozesse"
|
||||
|
||||
|
||||
class French:
|
||||
def __init__(self):
|
||||
self.msg_desc = "Sélecteur de papier peint graphique pour Wayland et X11. Il fonctionne comme une interface pour feh, swaybg, wallutils, hyprpaper, et swww."
|
||||
self.msg_desc = "Sélecteur de papier peint graphique pour Wayland et X11. Il fonctionne comme une interface pour feh, swaybg, wallutils, hyprpaper, mpvpaper, et swww."
|
||||
self.msg_info = "Pour plus d'informations, visitez :\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "afficher la version du programme"
|
||||
@ -135,8 +141,9 @@ class French:
|
||||
self.msg_refresh = "Actualiser"
|
||||
self.msg_random = "Aléatoire"
|
||||
self.msg_clear = "Effacer"
|
||||
self.msg_stop = "Stop"
|
||||
self.msg_search = "Chercher"
|
||||
self.msg_stop = "Arrêter"
|
||||
self.msg_search = "Rechercher"
|
||||
self.msg_options = "Options"
|
||||
self.msg_exit = "Quitter"
|
||||
self.msg_subfolders = "Sous-dossiers"
|
||||
self.msg_hidden = "Afficher caché"
|
||||
@ -155,8 +162,9 @@ class French:
|
||||
self.err_cache = "Erreur lors de la suppression du cache"
|
||||
self.err_backend = "Il semble qu'aucun des backends de papier peint ne soit installé sur le système.\n"
|
||||
self.err_backend += "Utilisez votre gestionnaire de paquets pour installer au moins l'un de ces backends :\n\n"
|
||||
self.err_backend += "- swaybg (pour Wayland)\n- swww (pour Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (pour Wayland)\n- feh (pour Xorg)\n- wallutils (pour Xorg & Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Erreur lors du changement de papier peint :"
|
||||
self.err_disp = "Erreur lors de la détermination des noms des moniteurs :"
|
||||
@ -170,11 +178,11 @@ class French:
|
||||
self.tip_random = "Définir un papier peint aléatoire"
|
||||
self.tip_exit = "Quitter l'application"
|
||||
self.tip_transition = "Choisissez le type de transition"
|
||||
|
||||
self.tip_mpv_stop = "Arrêter tous les processus mpv"
|
||||
|
||||
class Polish:
|
||||
def __init__(self):
|
||||
self.msg_desc = "Graficzne ustawiacz tapet dla Wayland i X11. Działa jako interfejs dla feh, swaybg, wallutils, hyprpaper, i swww."
|
||||
self.msg_desc = "Graficzne ustawiacz tapet dla Wayland i X11. Działa jako interfejs dla feh, swaybg, wallutils, hyprpaper, mpvpaper i swww."
|
||||
self.msg_info = "Aby uzyskać więcej informacji, odwiedź:\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "wyświetl wersję programu"
|
||||
@ -191,14 +199,15 @@ class Polish:
|
||||
self.msg_select = "Wybierz"
|
||||
self.msg_refresh = "Odśwież"
|
||||
self.msg_random = "Losowo"
|
||||
self.msg_clear = "Clear"
|
||||
self.msg_stop = "Stop"
|
||||
self.msg_search = "Search"
|
||||
self.msg_clear = "Wyczyść"
|
||||
self.msg_stop = "Zatrzymaj"
|
||||
self.msg_search = "Szukaj"
|
||||
self.msg_options = "Opcje"
|
||||
self.msg_exit = "Wyjście"
|
||||
self.msg_subfolders = "Podkatalogi"
|
||||
self.msg_hidden = "Hidden"
|
||||
self.msg_gifs = "Show only gifs"
|
||||
self.msg_transitions = "Show transition options"
|
||||
self.msg_hidden = "Pokaż ukryte"
|
||||
self.msg_gifs = "Pokaż tylko GIF-y"
|
||||
self.msg_transitions = "Pokaż opcje przejść"
|
||||
self.msg_changefolder = "Folder"
|
||||
self.msg_choosefolder = "Proszę wybrać folder"
|
||||
self.msg_caching = "Kasowanie tapet..."
|
||||
@ -212,8 +221,9 @@ class Polish:
|
||||
self.err_cache = "Błąd podczas usuwania pamięci podręcznej"
|
||||
self.err_backend = "Wygląda na to, że żaden z backendów tapet nie jest zainstalowany w systemie.\n"
|
||||
self.err_backend += "Użyj menedżera pakietów, aby zainstalować co najmniej jeden z tych backendów:\n\n"
|
||||
self.err_backend += "- swaybg (dla Wayland)\n- swww (dla Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (dla Wayland)\n- feh (dla Xorg)\n- wallutils (dla Xorg i Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Błąd podczas zmiany tapety:"
|
||||
self.err_disp = "Błąd podczas określania nazw monitorów:"
|
||||
@ -227,11 +237,11 @@ class Polish:
|
||||
self.tip_random = "Ustaw losową tapetę"
|
||||
self.tip_exit = "Wyjdź z aplikacji"
|
||||
self.tip_transition = "Wybierz typ przejścia"
|
||||
|
||||
self.tip_mpv_stop = "Zatrzymaj wszystkie procesy mpv"
|
||||
|
||||
class Russian:
|
||||
def __init__(self):
|
||||
self.msg_desc = "Графический интерфейс для установки обоев на Wayland и X11. Работает как фронтенд для feh, swaybg, wallutils, hyprpaper, и swww."
|
||||
self.msg_desc = "Графический интерфейс для установки обоев на Wayland и X11. Работает как фронтенд для feh, swaybg, wallutils, hyprpaper, mpvpaper и swww."
|
||||
self.msg_info = "Для получения дополнительной информации посетите:\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "вывести версию программы"
|
||||
@ -251,6 +261,7 @@ class Russian:
|
||||
self.msg_clear = "Очистить"
|
||||
self.msg_stop = "Остановить"
|
||||
self.msg_search = "Поиск"
|
||||
self.msg_options = "Опции"
|
||||
self.msg_exit = "Выход"
|
||||
self.msg_subfolders = "Показать подпапки"
|
||||
self.msg_hidden = "Показать скрытые"
|
||||
@ -269,8 +280,9 @@ class Russian:
|
||||
self.err_cache = "Ошибка при удалении кэша"
|
||||
self.err_backend = "Похоже, что ни один из бэкендов для установки обоев не установлен в системе.\n"
|
||||
self.err_backend += "Используйте менеджер пакетов для установки хотя бы одного из следующих бэкендов:\n\n"
|
||||
self.err_backend += "- swaybg (для Wayland)\n- swww (для Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (для Wayland)\n- feh (для Xorg)\n- wallutils (для Xorg и Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Ошибка при смене обоев:"
|
||||
self.err_disp = "Ошибка определения названий мониторов:"
|
||||
@ -284,11 +296,12 @@ class Russian:
|
||||
self.tip_random = "Установить случайные обои"
|
||||
self.tip_exit = "Выйти из приложения"
|
||||
self.tip_transition = "Выберите тип перехода"
|
||||
self.tip_mpv_stop = "Остановить все mpv процессы"
|
||||
|
||||
|
||||
class Belarusian:
|
||||
def __init__(self):
|
||||
self.msg_desc = "Графічны інтэрфейс для ўстаноўкі шпалер на Wayland і X11. Працуе як фронтэнд для feh, swaybg, wallutils, hyprpaper, і swww."
|
||||
self.msg_desc = "Графічны інтэрфейс для ўстаноўкі шпалер на Wayland і X11. Працуе як фронтэнд для feh, swaybg, wallutils, hyprpaper, mpvpaper і swww."
|
||||
self.msg_info = "Для атрымання дадатковай інфармацыі наведайце:\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "вывесці версію праграмы"
|
||||
@ -298,16 +311,17 @@ class Belarusian:
|
||||
self.msg_arg_rand = "ўсталяваць выпадковыя шпалеры"
|
||||
self.msg_arg_list = "вывесці шпалеры і матыноры ў фармаце json"
|
||||
self.msg_arg_wall = "пазначыць шлях да выявы"
|
||||
self.msg_arg_folder = "specify which folder to scan for wallpapers"
|
||||
self.msg_arg_statefile = "specify a custom file to store the application state"
|
||||
self.msg_arg_folder = "ўкажыце, які тэчку сканаваць для выявы"
|
||||
self.msg_arg_statefile = "ўкажыце карыстацкі файл для захавання стану прыкладання"
|
||||
|
||||
self.msg_path = "Абраны шлях да выявы:"
|
||||
self.msg_select = "Выбраць"
|
||||
self.msg_refresh = "Абнавіць"
|
||||
self.msg_random = "Выпадкова"
|
||||
self.msg_clear = "Clear"
|
||||
self.msg_stop = "Stop"
|
||||
self.msg_search = "Search"
|
||||
self.msg_clear = "Ачысціць"
|
||||
self.msg_stop = "Стоп"
|
||||
self.msg_search = "Шукаць"
|
||||
self.msg_options = "Опцыі"
|
||||
self.msg_exit = "Вынахад"
|
||||
self.msg_subfolders = "Паказаць падтэчкі"
|
||||
self.msg_hidden = "Паказаць схаваныя"
|
||||
@ -326,8 +340,9 @@ class Belarusian:
|
||||
self.err_cache = "Памылка пры выдаленні кэша"
|
||||
self.err_backend = "Падобна, што ніводны з бэкэндаў для ўсталёўкі шпалер не ўсталяваны ў сістэме.\n"
|
||||
self.err_backend += "Выкарыстоўвайце менеджэр пакетаў для ўстаноўкі хаця б аднаго з наступных бэкендаў:\n\n"
|
||||
self.err_backend += "- swaybg (для Wayland)\n- swww (для Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (для Wayland)\n- feh (для Xorg)\n- wallutils (для Xorg і Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Памылка пры змене шпалер:"
|
||||
self.err_disp = "Памылка вызначэння назваў манітораў:"
|
||||
@ -341,11 +356,12 @@ class Belarusian:
|
||||
self.tip_random = "Усталяваць выпадковыя шпалеры"
|
||||
self.tip_exit = "Выйсці з прыкладання"
|
||||
self.tip_transition = "Выберыце тып пераходу"
|
||||
self.tip_mpv_stop = "Спыніць усе працэсы mpv"
|
||||
|
||||
|
||||
class Chinese:
|
||||
def __init__(self):
|
||||
self.msg_desc = "Wayland 和 X11 的 GUI 壁纸设置器。它用作 feh、swaybg、hyprpaper、wallutils 和 swww 的前端。"
|
||||
self.msg_desc = "Wayland 和 X11 的 GUI 壁纸设置器。它用作 feh、swaybg、hyprpaper、mpvpaper、wallutils 和 swww 的前端。"
|
||||
self.msg_info = "欲了解更多信息,请访问:\nhttps://github.com/anufrievroman/waypaper"
|
||||
|
||||
self.msg_arg_help = "版本信息"
|
||||
@ -353,23 +369,24 @@ class Chinese:
|
||||
self.msg_arg_rest = "恢复上个壁纸"
|
||||
self.msg_arg_back = "指定使用哪个后端来设置壁纸"
|
||||
self.msg_arg_rand = "设置随机壁纸"
|
||||
self.msg_arg_list = "list wallpapers in json to standard out"
|
||||
self.msg_arg_wall = "set the specified wallpaper"
|
||||
self.msg_arg_folder = "specify which folder to scan for wallpapers"
|
||||
self.msg_arg_statefile = "specify a custom file to store the application state"
|
||||
self.msg_arg_list = "以 JSON 格式列出壁纸并输出到标准输出"
|
||||
self.msg_arg_wall = "设置指定的壁纸"
|
||||
self.msg_arg_folder = "指定扫描壁纸的文件夹"
|
||||
self.msg_arg_statefile = "指定用于存储应用程序状态的自定义文件"
|
||||
|
||||
self.msg_path = "选择的图像路径:"
|
||||
self.msg_select = "选择"
|
||||
self.msg_refresh = "刷新"
|
||||
self.msg_random = "随机"
|
||||
self.msg_clear = "Clear"
|
||||
self.msg_stop = "Stop"
|
||||
self.msg_search = "Search"
|
||||
self.msg_clear = "清除"
|
||||
self.msg_stop = "停止"
|
||||
self.msg_search = "搜索"
|
||||
self.msg_options = "选项"
|
||||
self.msg_exit = "退出"
|
||||
self.msg_subfolders = "子文件夹"
|
||||
self.msg_hidden = "Show hidden"
|
||||
self.msg_gifs = "Show only gifs"
|
||||
self.msg_transitions = "Show transition options"
|
||||
self.msg_hidden = "显示隐藏项"
|
||||
self.msg_gifs = "仅显示GIF"
|
||||
self.msg_transitions = "显示过渡选项"
|
||||
self.msg_changefolder = "文件夹"
|
||||
self.msg_choosefolder = "请选择一个文件夹"
|
||||
self.msg_caching = "缓存壁纸..."
|
||||
@ -383,8 +400,9 @@ class Chinese:
|
||||
self.err_cache = "删除缓存时出错"
|
||||
self.err_backend = "系统中似乎没有安装壁纸后端。\n"
|
||||
self.err_backend += "使用包管理器安装至少以下后端之一:\n\n"
|
||||
self.err_backend += "-swaybg (用于 Wayland)\n-swww (用于 Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (对于 Wayland)\n-feh (对于 Xorg)\n-wallutils (对于 Xorg 和 Wayland)\n\n"
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "更改壁纸时出错:"
|
||||
self.err_disp = "确定监视器名称时出错:"
|
||||
@ -398,6 +416,7 @@ class Chinese:
|
||||
self.tip_random = "设置随机壁纸"
|
||||
self.tip_exit = "退出应用程序"
|
||||
self.tip_transition = "选择过渡类型"
|
||||
self.tip_mpv_stop = "停止所有 mpv 进程"
|
||||
|
||||
class Spanish:
|
||||
def __init__(self):
|
||||
@ -418,9 +437,10 @@ class Spanish:
|
||||
self.msg_select = "Selecciona"
|
||||
self.msg_refresh = "Actualizar"
|
||||
self.msg_random = "Aleatorio"
|
||||
self.msg_clear = "Clear"
|
||||
self.msg_stop = "Stop"
|
||||
self.msg_search = "Search"
|
||||
self.msg_clear = "Borrar"
|
||||
self.msg_stop = "Detener"
|
||||
self.msg_search = "Buscar"
|
||||
self.msg_options = "Opciones"
|
||||
self.msg_exit = "Salir"
|
||||
self.msg_subfolders = "Ver subcarpetas"
|
||||
self.msg_hidden = "Ver archivos ocultos"
|
||||
@ -439,8 +459,9 @@ class Spanish:
|
||||
self.err_cache = "Error borrando el caché"
|
||||
self.err_backend = "Parece ser que ningún programa para actualizar la imagen de fondo está instalado en su sistema.\n"
|
||||
self.err_backend += "Por favor, instala uno de los siguientes programas para poder cambiar la imagen de fondo:\n\n"
|
||||
self.err_backend += '- swaybg (para "Wayland")\n- swww (para "Wayland"")\n- hyprpaper (para "Wayland")\n'
|
||||
self.err_backend += '- hyprpaper (para "Wayland")\n- feh (para "Xorg")\n- wallutils (para "Xorg" y "Wayland")\n\n'
|
||||
self.err_backend += "- swaybg (Wayland)\n- swww (Wayland)\n"
|
||||
self.err_backend += "- hyprpaper (Wayland)\n- feh (Xorg)\n"
|
||||
self.err_backend += "- wallutils (Xorg & Wayland)\n- mpvpaper (Xorg & Wayland)\n\n"
|
||||
self.err_backend += self.msg_info
|
||||
self.err_wall = "Error cambiando imagen de fondo:"
|
||||
self.err_disp = "Error buscando nombres de monitores"
|
||||
@ -454,3 +475,26 @@ class Spanish:
|
||||
self.tip_random = "Actualizar la imagen de fondo a una imagen aleatoria"
|
||||
self.tip_exit = "Cerrar la aplicación"
|
||||
self.tip_transition = "Elige el tipo de transición"
|
||||
self.tip_mpv_stop = "Detener todos los procesos de mpv"
|
||||
|
||||
|
||||
def load_language(lang):
|
||||
"""Load the language package according to selected language"""
|
||||
if lang == "de":
|
||||
txt = German()
|
||||
elif lang == "fr":
|
||||
txt = French()
|
||||
elif lang == "ru":
|
||||
txt = Russian()
|
||||
elif lang == "by":
|
||||
txt = Belarusian()
|
||||
elif lang == "pl":
|
||||
txt = Polish()
|
||||
elif lang == "zh":
|
||||
txt = Chinese()
|
||||
elif lang == "es":
|
||||
txt = Spanish()
|
||||
else:
|
||||
txt = English()
|
||||
return txt
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user