From e3a9d387c17cd1e21cd8d8a030db34aadc5e1be3 Mon Sep 17 00:00:00 2001 From: Trigg Date: Thu, 21 Apr 2022 17:39:06 +0000 Subject: [PATCH] - Use gettext for UI and --help - Add Welsh using google. Sorry. --- README.md | 21 + discover_overlay/about_settings.py | 15 +- discover_overlay/discover_overlay.py | 45 +- discover_overlay/general_settings.py | 14 +- discover_overlay/locales/base.pot | 404 +++++++++++++++++ .../locales/cy/LC_MESSAGES/default.mo | Bin 0 -> 6167 bytes .../locales/cy/LC_MESSAGES/default.po | 411 ++++++++++++++++++ .../locales/en/LC_MESSAGES/default.mo | Bin 0 -> 337 bytes .../locales/en/LC_MESSAGES/default.po | 404 +++++++++++++++++ discover_overlay/notification_settings.py | 55 +-- discover_overlay/settings.py | 16 +- discover_overlay/settings_window.py | 18 +- discover_overlay/text_settings.py | 47 +- discover_overlay/voice_settings.py | 94 ++-- setup.py | 3 + 15 files changed, 1422 insertions(+), 125 deletions(-) create mode 100644 discover_overlay/locales/base.pot create mode 100644 discover_overlay/locales/cy/LC_MESSAGES/default.mo create mode 100644 discover_overlay/locales/cy/LC_MESSAGES/default.po create mode 100644 discover_overlay/locales/en/LC_MESSAGES/default.mo create mode 100644 discover_overlay/locales/en/LC_MESSAGES/default.po diff --git a/README.md b/README.md index 5f16e58..6d9e67b 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,27 @@ If you are trying to debug on VS Code you are likely to get the following messag To get around this, copy the main file created by discover-overlay with ``cp $(which discover-overlay) /path/to/Discover/discover_overlay/__main__.py`` +### Translations + +in all cases `XX` should be replaced with the language code, in case of English `en`, Spanish `es` so on as per [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + +#### Adding a new translation + +First, find out what language code is required +Copy discover_overlay/locales/base.pot to discover_overlay/locales/XX/LC_MESSAGES/default.po + +Change all lines starting with `msgstr` to contain the translated message in provided quotes, the line above should be a `msgid` which has the original word, sentence or fragment. + +#### Compiling updates + +`gettext` requires the `.po` files to be compiled into `.mo` before it can be used. Once a `.po` file is changed it can be compiled with + +`msgfmt -o discover_overlay/locales/XX/LC_MESSAGES/default.mo discover_overlay/locales/XX/LC_MESSAGES/default.po` + +#### Incorrect translations and missing translations + +We welcome pull requests and bug reports about missing or wrong translations, but don't have the resources to get it all right. Please be patient with us and alert us if any translations are wildly inaccurate. + ## Why do you keep making Discord Overlays? I feel like I shouldn't have to at all! Until we get an official one I might just create a new one every few months. Look forward to Rust/Vulkan version coming in a few months. /s diff --git a/discover_overlay/about_settings.py b/discover_overlay/about_settings.py index beaf3b3..dcad1e7 100644 --- a/discover_overlay/about_settings.py +++ b/discover_overlay/about_settings.py @@ -11,14 +11,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Overview setting tab on settings window""" +import gettext import json import logging +import pkg_resources from configparser import ConfigParser import gi import sys from .settings import SettingsWindow log = logging.getLogger(__name__) +t = gettext.translation('default', pkg_resources.resource_filename( + 'discover_overlay', 'locales')) +_ = t.gettext gi.require_version("Gtk", "3.0") # pylint: disable=wrong-import-position,wrong-import-order @@ -54,7 +59,13 @@ class AboutSettingsWindow(Gtk.Grid): self.attach(spacing_box_2, 1, 2, 1, 1) blurb = Gtk.Label.new(None) - blurb.set_markup("Welcome to Discover Overlay\n\nDiscover-Overlay is a GTK3 overlay written in Python3. It can be configured to show who is currently talking on discord or it can be set to display text and images from a preconfigured channel. It is fully customisable and can be configured to display anywhere on the screen. We fully support X11 and wlroots based environments. We felt the need to make this project due to the shortcomings in support on Linux by the official discord client.\n\nPlease visit our discord (https://discord.gg/jRKWMuDy5V) for support. Or open an issue on our GitHub (https://github.com/trigg/Discover)\n\n\n\n\n\n") + message = "%s\n\n%s\n\n%s (https://discord.gg/jRKWMuDy5V) %s (https://github.com/trigg/Discover)\n\n\n\n\n\n" % ( + _("Welcome to Discover Overlay"), + _("Discover-Overlay is a GTK3 overlay written in Python3. It can be configured to show who is currently talking on discord or it can be set to display text and images from a preconfigured channel. It is fully customisable and can be configured to display anywhere on the screen. We fully support X11 and wlroots based environments. We felt the need to make this project due to the shortcomings in support on Linux by the official discord client."), + _("Please visit our discord"), + _(" for support. Or open an issue on our GitHub ") + ) + blurb.set_markup(message) blurb.set_line_wrap(True) self.attach(blurb, 1, 3, 1, 1) @@ -63,7 +74,7 @@ class AboutSettingsWindow(Gtk.Grid): self.warning.set_line_wrap(True) self.attach(self.warning, 1, 4, 1, 1) - killapp = Gtk.Button.new_with_label("Close overlay") + killapp = Gtk.Button.new_with_label(_("Close overlay")) killapp.connect("pressed", self.close_app) self.attach(killapp, 1, 5, 1, 1) diff --git a/discover_overlay/discover_overlay.py b/discover_overlay/discover_overlay.py index 7ad0bed..d6a2687 100755 --- a/discover_overlay/discover_overlay.py +++ b/discover_overlay/discover_overlay.py @@ -11,6 +11,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Main application class""" +import gettext import os import time import sys @@ -25,6 +26,7 @@ except: dbus = None pass import logging +import pkg_resources import gi import pidfile from .settings_window import MainSettingsWindow @@ -43,6 +45,9 @@ except ModuleNotFoundError: from xdg import XDG_CONFIG_HOME as xdg_config_home log = logging.getLogger(__name__) +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext class Discover: @@ -155,24 +160,28 @@ class Discover: Read in arg list from command or RPC and act accordingly """ if "--help" in data or "-h" in data: - print("Usage: discover-overlay [OPTIONS]... ") - print("Show an X11 or wlroots overlay with information") - print("from Discord client") + print("%s: discover-overlay [OPTIONS]... " % (_("Usage"))) + print(_("Show an X11 or wlroots overlay with information")) + print(_("from Discord client")) print("") - print(" -c, --configure Open configuration window") - print(" -x, --close Close currently running instance") - print(" -v, --debug Verbose output for aid in debugging") - print(" -h, --help This screen") - print(" --hide Hide overlay") - print(" --show Show overlay") - print(" --rpc Send command, not start new instance. Only needed if running in flatpak") - print(" --mute Set own user to mute") - print(" --unmute Set unmuted") - print(" --deaf Set own user to deafened") - print(" --undeaf Unset user deafened state") - print(" --moveto=XX Move the user into voice room, by Room ID") + print(" -c, --configure ", _("Open configuration window")) + print(" -x, --close ", + _("Close currently running instance")) + print(" -v, --debug ", + _("Verbose output for aid in debugging")) + print(" -h, --help ", _("This screen")) + print(" --hide ", _("Hide overlay")) + print(" --show ", _("Show overlay")) + print(" --rpc ", + _("Send command, not start new instance. Only needed if running in flatpak")) + print(" --mute ", _("Set own user to mute")) + print(" --unmute ", _("Set unmuted")) + print(" --deaf ", _("Set own user to deafened")) + print(" --undeaf ", _("Unset user deafened state")) + print(" --moveto=XX ", + _("Move the user into voice room, by Room ID")) print("") - print("For gamescope compatibility ensure ENV has 'GDK_BACKEND=x11'") + print(_("For gamescope compatibility ensure ENV has 'GDK_BACKEND=x11'")) if normal_close: sys.exit(0) if "--configure" in data or "-c" in data: @@ -276,8 +285,8 @@ class Discover: Create System Menu """ menu = Gtk.Menu() - settings_opt = Gtk.MenuItem.new_with_label("Settings") - close_opt = Gtk.MenuItem.new_with_label("Close") + settings_opt = Gtk.MenuItem.new_with_label(_("Settings")) + close_opt = Gtk.MenuItem.new_with_label(_("Close")) menu.append(settings_opt) menu.append(close_opt) diff --git a/discover_overlay/general_settings.py b/discover_overlay/general_settings.py index 2e9f116..f4afc99 100644 --- a/discover_overlay/general_settings.py +++ b/discover_overlay/general_settings.py @@ -11,14 +11,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Core Settings Tab""" +import gettext from configparser import ConfigParser import gi +import pkg_resources from .settings import SettingsWindow from .autostart import Autostart gi.require_version("Gtk", "3.0") # pylint: disable=wrong-import-position,wrong-import-order from gi.repository import Gtk # nopep8 +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext + class GeneralSettingsWindow(SettingsWindow): """Core Settings Tab""" @@ -78,25 +84,25 @@ class GeneralSettingsWindow(SettingsWindow): box = Gtk.Grid() # Auto start - autostart_label = Gtk.Label.new("Autostart on boot") + autostart_label = Gtk.Label.new(_("Autostart on boot")) autostart = Gtk.CheckButton.new() autostart.set_active(self.autostart_helper.is_auto()) autostart.connect("toggled", self.change_autostart) # Force XShape - xshape_label = Gtk.Label.new("Force XShape") + xshape_label = Gtk.Label.new(_("Force XShape")) xshape = Gtk.CheckButton.new() xshape.set_active(self.xshape) xshape.connect("toggled", self.change_xshape) # Show sys tray - show_sys_tray_icon_label = Gtk.Label.new("Show tray icon") + show_sys_tray_icon_label = Gtk.Label.new(_("Show tray icon")) show_sys_tray_icon = Gtk.CheckButton.new() show_sys_tray_icon.set_active(self.show_sys_tray_icon) show_sys_tray_icon.connect("toggled", self.change_show_sys_tray_icon) # Show taskbar - show_task_label = Gtk.Label.new("Show on taskbar") + show_task_label = Gtk.Label.new(_("Show on taskbar")) show_task = Gtk.CheckButton.new() show_task.set_active(self.show_task) show_task.connect("toggled", self.change_show_task) diff --git a/discover_overlay/locales/base.pot b/discover_overlay/locales/base.pot new file mode 100644 index 0000000..a6d1d9e --- /dev/null +++ b/discover_overlay/locales/base.pot @@ -0,0 +1,404 @@ +# 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: 2022-04-21 13:10+0000\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: discover_overlay/about_settings.py:61 +msgid "Welcome to Discover Overlay" +msgstr "" + +#: discover_overlay/about_settings.py:62 +msgid "" +"Discover-Overlay is a GTK3 overlay written in Python3. It can be configured " +"to show who is currently talking on discord or it can be set to display text " +"and images from a preconfigured channel. It is fully customisable and can be " +"configured to display anywhere on the screen. We fully support X11 and " +"wlroots based environments. We felt the need to make this project due to the " +"shortcomings in support on Linux by the official discord client." +msgstr "" + +#: discover_overlay/about_settings.py:63 +msgid "Please visit our discord" +msgstr "" + +#: discover_overlay/about_settings.py:64 +msgid " for support. Or open an issue on our GitHub " +msgstr "" + +#: discover_overlay/about_settings.py:75 +msgid "Close overlay" +msgstr "" + +#: discover_overlay/discover_overlay.py:161 +msgid "Usage" +msgstr "" + +#: discover_overlay/discover_overlay.py:162 +msgid "Show an X11 or wlroots overlay with information" +msgstr "" + +#: discover_overlay/discover_overlay.py:163 +msgid "from Discord client" +msgstr "" + +#: discover_overlay/discover_overlay.py:165 +msgid "Open configuration window" +msgstr "" + +#: discover_overlay/discover_overlay.py:167 +msgid "Close currently running instance" +msgstr "" + +#: discover_overlay/discover_overlay.py:169 +msgid "Verbose output for aid in debugging" +msgstr "" + +#: discover_overlay/discover_overlay.py:170 +msgid "This screen" +msgstr "" + +#: discover_overlay/discover_overlay.py:171 +msgid "Hide overlay" +msgstr "" + +#: discover_overlay/discover_overlay.py:172 +msgid "Show overlay" +msgstr "" + +#: discover_overlay/discover_overlay.py:174 +msgid "Send command, not start new instance. Only needed if running in flatpak" +msgstr "" + +#: discover_overlay/discover_overlay.py:175 +msgid "Set own user to mute" +msgstr "" + +#: discover_overlay/discover_overlay.py:176 +msgid "Set unmuted" +msgstr "" + +#: discover_overlay/discover_overlay.py:177 +msgid "Set own user to deafened" +msgstr "" + +#: discover_overlay/discover_overlay.py:178 +msgid "Unset user deafened state" +msgstr "" + +#: discover_overlay/discover_overlay.py:180 +msgid "Move the user into voice room, by Room ID" +msgstr "" + +#: discover_overlay/discover_overlay.py:182 +msgid "For gamescope compatibility ensure ENV has 'GDK_BACKEND=x11'" +msgstr "" + +#: discover_overlay/discover_overlay.py:286 +msgid "Settings" +msgstr "" + +#: discover_overlay/discover_overlay.py:287 +msgid "Close" +msgstr "" + +#: discover_overlay/general_settings.py:85 +msgid "Autostart on boot" +msgstr "" + +#: discover_overlay/general_settings.py:91 +msgid "Force XShape" +msgstr "" + +#: discover_overlay/general_settings.py:97 +msgid "Show tray icon" +msgstr "" + +#: discover_overlay/general_settings.py:103 +msgid "Show on taskbar" +msgstr "" + +#: discover_overlay/notification_settings.py:198 +#: discover_overlay/text_settings.py:299 +msgid "Enable" +msgstr "" + +#: discover_overlay/notification_settings.py:204 +msgid "Show test content" +msgstr "" + +#: discover_overlay/notification_settings.py:209 +msgid "Reverse Order" +msgstr "" + +#: discover_overlay/notification_settings.py:215 +#: discover_overlay/text_settings.py:317 +msgid "Popup timer" +msgstr "" + +#: discover_overlay/notification_settings.py:222 +msgid "Limit popup width" +msgstr "" + +#: discover_overlay/notification_settings.py:229 +#: discover_overlay/text_settings.py:324 discover_overlay/voice_settings.py:264 +msgid "Font" +msgstr "" + +#: discover_overlay/notification_settings.py:236 +msgid "Icon position" +msgstr "" + +#: discover_overlay/notification_settings.py:238 +#: discover_overlay/notification_settings.py:285 +#: discover_overlay/text_settings.py:368 discover_overlay/voice_settings.py:365 +#: discover_overlay/voice_settings.py:857 +#: discover_overlay/voice_settings.py:863 +msgid "Left" +msgstr "" + +#: discover_overlay/notification_settings.py:239 +#: discover_overlay/notification_settings.py:286 +#: discover_overlay/text_settings.py:369 discover_overlay/voice_settings.py:366 +#: discover_overlay/voice_settings.py:861 +#: discover_overlay/voice_settings.py:865 +msgid "Right" +msgstr "" + +#: discover_overlay/notification_settings.py:248 +#: discover_overlay/text_settings.py:331 +msgid "Background colour" +msgstr "" + +#: discover_overlay/notification_settings.py:251 +#: discover_overlay/text_settings.py:334 +msgid "Text colour" +msgstr "" + +#: discover_overlay/notification_settings.py:260 +#: discover_overlay/text_settings.py:343 discover_overlay/voice_settings.py:340 +msgid "Overlay Location" +msgstr "" + +#: discover_overlay/notification_settings.py:264 +#: discover_overlay/text_settings.py:347 discover_overlay/voice_settings.py:344 +msgid "Anchor to edge" +msgstr "" + +#: discover_overlay/notification_settings.py:266 +#: discover_overlay/text_settings.py:349 discover_overlay/voice_settings.py:346 +msgid "Floating" +msgstr "" + +#: discover_overlay/notification_settings.py:295 +#: discover_overlay/text_settings.py:378 discover_overlay/voice_settings.py:375 +#: discover_overlay/voice_settings.py:853 +#: discover_overlay/voice_settings.py:867 +msgid "Top" +msgstr "" + +#: discover_overlay/notification_settings.py:296 +#: discover_overlay/text_settings.py:379 discover_overlay/voice_settings.py:376 +#: discover_overlay/voice_settings.py:859 +#: discover_overlay/voice_settings.py:869 +msgid "Middle" +msgstr "" + +#: discover_overlay/notification_settings.py:297 +#: discover_overlay/text_settings.py:380 discover_overlay/voice_settings.py:377 +#: discover_overlay/voice_settings.py:855 +#: discover_overlay/voice_settings.py:871 +msgid "Bottom" +msgstr "" + +#: discover_overlay/notification_settings.py:305 +#: discover_overlay/settings.py:149 discover_overlay/text_settings.py:388 +#: discover_overlay/voice_settings.py:385 +msgid "Place Window" +msgstr "" + +#: discover_overlay/notification_settings.py:312 +msgid "Show Icon" +msgstr "" + +#: discover_overlay/notification_settings.py:318 +msgid "Icon padding" +msgstr "" + +#: discover_overlay/notification_settings.py:325 +msgid "Icon size" +msgstr "" + +#: discover_overlay/notification_settings.py:332 +msgid "Notification padding" +msgstr "" + +#: discover_overlay/notification_settings.py:339 +msgid "Border radius" +msgstr "" + +#: discover_overlay/settings.py:161 +msgid "Place & resize this window then press Green!" +msgstr "" + +#: discover_overlay/settings.py:167 +msgid "Place & resize this window then press Save!" +msgstr "" + +#: discover_overlay/settings.py:169 +msgid "Save this position" +msgstr "" + +#: discover_overlay/settings_window.py:42 +msgid "Discover Overlay Configuration" +msgstr "" + +#: discover_overlay/settings_window.py:54 +msgid "Overview" +msgstr "" + +#: discover_overlay/settings_window.py:59 +msgid "Voice" +msgstr "" + +#: discover_overlay/settings_window.py:64 +#: discover_overlay/voice_settings.py:316 +msgid "Text" +msgstr "" + +#: discover_overlay/settings_window.py:70 +msgid "Notifications" +msgstr "" + +#: discover_overlay/settings_window.py:75 +msgid "Core" +msgstr "" + +#: discover_overlay/text_settings.py:305 +msgid "Hide on mouseover" +msgstr "" + +#: discover_overlay/text_settings.py:311 +msgid "Popup Style" +msgstr "" + +#: discover_overlay/text_settings.py:394 +msgid "Channel" +msgstr "" + +#: discover_overlay/text_settings.py:403 discover_overlay/text_settings.py:415 +msgid "Refresh list" +msgstr "" + +#: discover_overlay/text_settings.py:406 +msgid "Server" +msgstr "" + +#: discover_overlay/text_settings.py:419 +msgid "Show Attachments" +msgstr "" + +#: discover_overlay/voice_settings.py:317 +msgid "Label" +msgstr "" + +#: discover_overlay/voice_settings.py:318 +msgid "Talking" +msgstr "" + +#: discover_overlay/voice_settings.py:319 +msgid "Idle" +msgstr "" + +#: discover_overlay/voice_settings.py:320 +msgid "Border" +msgstr "" + +#: discover_overlay/voice_settings.py:321 +msgid "Mute" +msgstr "" + +#: discover_overlay/voice_settings.py:404 +msgid "Avatar size" +msgstr "" + +#: discover_overlay/voice_settings.py:415 +msgid "Square Avatar" +msgstr "" + +#: discover_overlay/voice_settings.py:425 +msgid "Display Icon Only" +msgstr "" + +#: discover_overlay/voice_settings.py:435 +msgid "Display Speakers Only" +msgstr "" + +#: discover_overlay/voice_settings.py:445 +msgid "Highlight Self" +msgstr "" + +#: discover_overlay/voice_settings.py:455 +msgid "Order Avatars By" +msgstr "" + +#: discover_overlay/voice_settings.py:458 +msgid "Alphabetically" +msgstr "" + +#: discover_overlay/voice_settings.py:459 +msgid "ID" +msgstr "" + +#: discover_overlay/voice_settings.py:460 +msgid "Last Spoken" +msgstr "" + +#: discover_overlay/voice_settings.py:472 +msgid "Icon Spacing" +msgstr "" + +#: discover_overlay/voice_settings.py:483 +msgid "Text Padding" +msgstr "" + +#: discover_overlay/voice_settings.py:494 +msgid "Text Vertical Offset" +msgstr "" + +#: discover_overlay/voice_settings.py:505 +msgid "Vertical Edge Padding" +msgstr "" + +#: discover_overlay/voice_settings.py:517 +msgid "Horizontal Edge Padding" +msgstr "" + +#: discover_overlay/voice_settings.py:529 +msgid "Display Horizontally" +msgstr "" + +#: discover_overlay/voice_settings.py:539 +msgid "Search Servers for User" +msgstr "" + +#: discover_overlay/voice_settings.py:550 +msgid "Guilds" +msgstr "" + +#: discover_overlay/voice_settings.py:572 +msgid "Filter..." +msgstr "" diff --git a/discover_overlay/locales/cy/LC_MESSAGES/default.mo b/discover_overlay/locales/cy/LC_MESSAGES/default.mo new file mode 100644 index 0000000000000000000000000000000000000000..9f743d7a1ff31364527029be5c2a6ef91e4dda37 GIT binary patch literal 6167 zcmb7{S&SS<8GwtMm~bC4AwZcUCd9Lj2?=3|A>-ZgdhzVR&f3O+fST#*o{D?AhCbZx z$Px-q35NvY4#xu$2*CpgAtC`npa231i3g4c1PJ5@4k08C0S`gq`}>$(0}s%ens2JR zy8gfZt7?Avv`2qXah;>xK>P6{m3ljT_hb0ty6 z7x-BEk9oXOPlVS(>0b|dqz*xu`X;F1Q7GfK;iKW3;q%}Ge)SPby#qdj{_z8iydC&V z`T>-A?}69Adm%&ByP(YT0eC0;D7+T_6w3H3Q1t$Nd;ei5>$-+TTn7(AOrUOo^4_g2 z?}DP|1{8U3gd)d6SWeME4*96>@g?*B1d5(l;M3smpse>{xCWoW zAkp(pQ0ALJ(eE;pdEW;`k553+>oZX7@E|-2zXhKR{{)#*Jp!Z3`kw^FzM3x{siRQh z;5Zcf4WNvFEfjg@pva5iqu?bdcDW2i{|~_z!jD6VgKxI?e+r*N|L5>J;^rSv=6MRr zJ{{fwMb0gdN9uUnAGSOXMV}Cgo)@6#SwXSOy-@VI555?_8_N7&YM*}tUQho!@VChS z6%_k^A7jh9ehtO0e}iJjC!>_`AguEO%KC1CEAS{3Ju@is-vPy*_d~Js$Dqvjc_?=H zHk7#i8AP=D1(bFC5z0Idw|oN1h@9(NYRDsXBNREyP~`O6=OcJK{qs=td~f^wBT&}= zIVkeK0-ptc07d>4DC_$xl=uG$Z-Xyqu*`oqlyR4#_~kuN^nCzIe0~;+USES^_aC>H0cR`7xk3y06Nho&v0=yYM2xVPYp!nhMP~!Wakg!pw zX>vW6c028mblU4k_hTRBUAbOGllYf4-9dXLP2xjj$|b&%b&0O$Xs@BYmL@SPm*_6n z^J%x$zm$4uOIb&EiEqUIa!I_24djxXkV|TUTqD}cX+7z1ZP11^S+mq-xn4&*Ok0%> z*Gp)9+Fi6wn)q-3C3zv&%NnS&EssO-)i&)U?F>zPevBqQmH3bvCD#iZs8eu@rfDZ= z>$F$UB-Xl1;^~&I17%+l-*wjxKX99R0d2Xx`D%D8?L}>0AaS!s8_;f~Nj#7a^(C>g zE5CH;Q=Jv_xli*Yy_IS|w~021c3DbRIj=GR58}7AJ3;|Y;!j;aa^f>GMVyv z?zIgftNKOmv)rV)yf*eeSN)5IzRuh|R-G`D3sLHeB+wHdGpjn`)4+DnsR>+>aWl{T zOsz~!lGs?S#6Gjlx1JPfYLh&!bXp{dOCs$Or8r&g`HY$7-GR&!Uc z_#|{uk(%83WbwGyJ$9KkdTsagt-75?m#NEhtl<*9UFB1s+`6RKb3MU2W6L6%>1-ed z$fmy3<J{1e5tNbQ5Rdh3O`-L*$aUt~S>xpSpW|f{}^E?&dnC(p$;C zJEOTpoiuCi4id4EI_cuvrb|mp>SXMRh$K=cnToGeM`mVm)?9o%oAYq&VwYE}J1a2S zVDqe=noJ*FTRr`j6aAIbgU!|BmyR7fEH6*2e*I`_=2op0E)Ftv$_2HZXTHd+L{@vJ z4b@XFn#QzTk8B*Oy(Q@ZDW$hf5QuK;tEyhuXl^ETUsgHq9@ZV7xjL}xadpP62P||* zzQ%lKNSONzHc>+x=4$9>gyG!Ji@7dckWbZy3uOETI@ab#T|za%X&1d?Swz6>i1=oQ z9~y-=irlJApF7-C=hQ->{WmkUB^9L$;AUXylE9a0OY&bgMIzHDD%IuU&^I&IH!eC` zs_odI!;Lz%va}|)nps3yY{7#}uSpyq`X2|6%thOcJ=Z9-9a|z?Uv${AE_`H+WUbn+ z4K>OuEY$qY-3(vu*bu=}9lI>2gHw6EUY6PsuPPDJXglv5G_oe0O!0Rr!|MWk23xC< ztxMx-(*^T@=2C6tM-{U}Aon$RXT z_>TuO@uQ3`68TvVkc7z8NQzoN&&_07Cwp^40<8H(A(RS1%5(){Q94~dMQJvdS?%#= zJTaS_?84ZfolM=1ZaTRoM46h3i`nFHo>CKCE$wZEA@iC@QM*l5RlAhS`fHIUaz~%F zX}v+|tuUm(HY3_CXV=fwnMBHNZI;d^Vrh(UCZp^s-XF8+;QxGHVVDN-RnerES%?~c83 zqE=|r-XNKHDQwI7jObVXoQLEuwP8j)sfL4e0lb6!@Bs+lvKn?zL} zOsgC#)xAB%sTGBe7Ss966Uw~MO(kiELWbauMGVX2G*eqg(|3ojQlXl~hH4wfrd-l2 z5^F`}IM(b$CNlwQnSH{p(tS^4k)+eA)N)cu@r&4i!^ch)R5LL`9G5sg!iPRW(^*u- z6FefC)#s6}*zk(ywyj^vt((PO{Fp>?WYZ<<#-?%r$()=(rqn{usYfD;`+*C?Dk7Og zWYvl@ma>IX%{e5ZzHzjQtsFb{8#t?@GV<|~>MsmgYwlCAp(jQgM_DOfB7v}ox|@yD zWRcy2HI6U^tCh1s?B!H4s%C}Eb25}uNgsPu`QV zl>a=Otobw~=l<<@vQlus@UrH(ihRKFK)lM4U7Vsh^Qzq{NeZGZF15*tNVcwNk(fkr zHsMXlNL;p9I0u6h;xMv62K$5zYesgxkqO6Tg+=QdZTe!2raQ76(c4oCNlJ7}ZlGj| zZ%oJ^gOa^Pk!lsi3(4$*3F%0JCfKXCo4A+o!O^a)s|MvgBn33JDLW!of9T6GM;Lv+ zeV}$z>!R4Vnog^1T;U}`PMzBK`|5zG^P96lpWU2|L7V!|4wa^!UJYaGW3fV;^T;6i z;xbY@Y;IW5Otf)vXsKRKA~%%nIm@X!b;xk;FRM%j5-CA&=>L8#y`g!SIv>jt#3g z4ow|9;;fh;iAq+dnZ!r)Sgww zjn!70Y~ufaJjTl132EWVNwak~J5*5D)&1q66RCzn5|HiF+l+t8iygAtK-Iqh7b{=_ literal 0 HcmV?d00001 diff --git a/discover_overlay/locales/cy/LC_MESSAGES/default.po b/discover_overlay/locales/cy/LC_MESSAGES/default.po new file mode 100644 index 0000000..f0d649d --- /dev/null +++ b/discover_overlay/locales/cy/LC_MESSAGES/default.po @@ -0,0 +1,411 @@ +# 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: 2022-04-21 13:10+0000\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: discover_overlay/about_settings.py:61 +msgid "Welcome to Discover Overlay" +msgstr "Croeso i Discover Overlay" + +#: discover_overlay/about_settings.py:62 +msgid "" +"Discover-Overlay is a GTK3 overlay written in Python3. It can be configured " +"to show who is currently talking on discord or it can be set to display text " +"and images from a preconfigured channel. It is fully customisable and can be " +"configured to display anywhere on the screen. We fully support X11 and " +"wlroots based environments. We felt the need to make this project due to the " +"shortcomings in support on Linux by the official discord client." +msgstr "" +"Mae Discover-Overlay yn troslun GTK3 a ysgrifennwyd yn Python3. Gellir " +"ei ffurfweddu i ddangos pwy sy'n siarad ar anghytgord ar hyn o bryd neu " +"gellir ei osod i arddangos testun a delweddau o sianel wedi'i ffurfweddu " +"ymlaen llaw. Mae'n gwbl addasadwy a gellir ei ffurfweddu i arddangos unrhyw " +"le ar y sgrin. Rydym yn llwyr gefnogi amgylcheddau X11 a wlroots. Roeddem yn " +"teimlo'r angen i wneud y prosiect hwn oherwydd y diffygion yn y gefnogaeth " +"ar Linux gan y cleient anghytgord swyddogol." + +#: discover_overlay/about_settings.py:63 +msgid "Please visit our discord" +msgstr "Ewch i'n Discord" + +#: discover_overlay/about_settings.py:64 +msgid " for support. Or open an issue on our GitHub " +msgstr " am gymorth" + +#: discover_overlay/about_settings.py:75 +msgid "Close overlay" +msgstr "Cau Overlay" + +#: discover_overlay/discover_overlay.py:161 +msgid "Usage" +msgstr "Defnydd" + +#: discover_overlay/discover_overlay.py:162 +msgid "Show an X11 or wlroots overlay with information" +msgstr "Dangos troslun X11 neu Wlroots gyda gwybodaeth" + +#: discover_overlay/discover_overlay.py:163 +msgid "from Discord client" +msgstr "" + +#: discover_overlay/discover_overlay.py:165 +msgid "Open configuration window" +msgstr "gan y cleient Discord" + +#: discover_overlay/discover_overlay.py:167 +msgid "Close currently running instance" +msgstr "Cau'r achos sy'n rhedeg ar hyn o bryd" + +#: discover_overlay/discover_overlay.py:169 +msgid "Verbose output for aid in debugging" +msgstr "Allbwn Verbose ar gyfer cymorth i ddadfygio" + +#: discover_overlay/discover_overlay.py:170 +msgid "This screen" +msgstr "" + +#: discover_overlay/discover_overlay.py:171 +msgid "Hide overlay" +msgstr "Mae'r sgrin hon" + +#: discover_overlay/discover_overlay.py:172 +msgid "Show overlay" +msgstr "Dangos troslun" + +#: discover_overlay/discover_overlay.py:174 +msgid "Send command, not start new instance. Only needed if running in flatpak" +msgstr "Anfon gorchymyn, nid dechrau achos newydd. Dim ond os yw'n rhedeg mewn flatpak" + +#: discover_overlay/discover_overlay.py:175 +msgid "Set own user to mute" +msgstr "Gosod treiglad" + +#: discover_overlay/discover_overlay.py:176 +msgid "Set unmuted" +msgstr "Gosod nid treiglo" + +#: discover_overlay/discover_overlay.py:177 +msgid "Set own user to deafened" +msgstr "Gosod yn fyddar" + +#: discover_overlay/discover_overlay.py:178 +msgid "Unset user deafened state" +msgstr "Gosod nid byddar" + +#: discover_overlay/discover_overlay.py:180 +msgid "Move the user into voice room, by Room ID" +msgstr "Symud y defnyddiwr i ystafell lais, yn ôl ID Ystafell" + +#: discover_overlay/discover_overlay.py:182 +msgid "For gamescope compatibility ensure ENV has 'GDK_BACKEND=x11'" +msgstr "Ar gyfer cydnawsedd gamescope sicrhau bod gan ENV 'GDK_BACKEND=x11'" + +#: discover_overlay/discover_overlay.py:286 +msgid "Settings" +msgstr "Gosodiadau" + +#: discover_overlay/discover_overlay.py:287 +msgid "Close" +msgstr "Cau" + +#: discover_overlay/general_settings.py:85 +msgid "Autostart on boot" +msgstr "Dechrau ar bwt" + +#: discover_overlay/general_settings.py:91 +msgid "Force XShape" +msgstr "Gorfodi XShape" + +#: discover_overlay/general_settings.py:97 +msgid "Show tray icon" +msgstr "Dangos eicon hambwrdd" + +#: discover_overlay/general_settings.py:103 +msgid "Show on taskbar" +msgstr "Dangos ar y bar tasgau" + +#: discover_overlay/notification_settings.py:198 +#: discover_overlay/text_settings.py:299 +msgid "Enable" +msgstr "Galluogi" + +#: discover_overlay/notification_settings.py:204 +msgid "Show test content" +msgstr "Dangos cynnwys y prawf" + +#: discover_overlay/notification_settings.py:209 +msgid "Reverse Order" +msgstr "Gorchymyn Gwrthdroi" + +#: discover_overlay/notification_settings.py:215 +#: discover_overlay/text_settings.py:317 +msgid "Popup timer" +msgstr "Amserydd naid" + +#: discover_overlay/notification_settings.py:222 +msgid "Limit popup width" +msgstr "Cyfyngu lled naid" + +#: discover_overlay/notification_settings.py:229 +#: discover_overlay/text_settings.py:324 discover_overlay/voice_settings.py:264 +msgid "Font" +msgstr "Ffont" + +#: discover_overlay/notification_settings.py:236 +msgid "Icon position" +msgstr "Safbwynt eicon" + +#: discover_overlay/notification_settings.py:238 +#: discover_overlay/notification_settings.py:285 +#: discover_overlay/text_settings.py:368 discover_overlay/voice_settings.py:365 +#: discover_overlay/voice_settings.py:857 +#: discover_overlay/voice_settings.py:863 +msgid "Left" +msgstr "Chwith" + +#: discover_overlay/notification_settings.py:239 +#: discover_overlay/notification_settings.py:286 +#: discover_overlay/text_settings.py:369 discover_overlay/voice_settings.py:366 +#: discover_overlay/voice_settings.py:861 +#: discover_overlay/voice_settings.py:865 +msgid "Right" +msgstr "Dde" + +#: discover_overlay/notification_settings.py:248 +#: discover_overlay/text_settings.py:331 +msgid "Background colour" +msgstr "Lliw cefndir" + +#: discover_overlay/notification_settings.py:251 +#: discover_overlay/text_settings.py:334 +msgid "Text colour" +msgstr "Lliw'r testun" + +#: discover_overlay/notification_settings.py:260 +#: discover_overlay/text_settings.py:343 discover_overlay/voice_settings.py:340 +msgid "Overlay Location" +msgstr "Lleoliad troslun" + +#: discover_overlay/notification_settings.py:264 +#: discover_overlay/text_settings.py:347 discover_overlay/voice_settings.py:344 +msgid "Anchor to edge" +msgstr "Angor i ymyl" + +#: discover_overlay/notification_settings.py:266 +#: discover_overlay/text_settings.py:349 discover_overlay/voice_settings.py:346 +msgid "Floating" +msgstr "Symudol" + +#: discover_overlay/notification_settings.py:295 +#: discover_overlay/text_settings.py:378 discover_overlay/voice_settings.py:375 +#: discover_overlay/voice_settings.py:853 +#: discover_overlay/voice_settings.py:867 +msgid "Top" +msgstr "Brig" + +#: discover_overlay/notification_settings.py:296 +#: discover_overlay/text_settings.py:379 discover_overlay/voice_settings.py:376 +#: discover_overlay/voice_settings.py:859 +#: discover_overlay/voice_settings.py:869 +msgid "Middle" +msgstr "Canol" + +#: discover_overlay/notification_settings.py:297 +#: discover_overlay/text_settings.py:380 discover_overlay/voice_settings.py:377 +#: discover_overlay/voice_settings.py:855 +#: discover_overlay/voice_settings.py:871 +msgid "Bottom" +msgstr "Gwaelod" + +#: discover_overlay/notification_settings.py:305 +#: discover_overlay/settings.py:149 discover_overlay/text_settings.py:388 +#: discover_overlay/voice_settings.py:385 +msgid "Place Window" +msgstr "Rhowch y ffenestr" + +#: discover_overlay/notification_settings.py:312 +msgid "Show Icon" +msgstr "Dangos eicon" + +#: discover_overlay/notification_settings.py:318 +msgid "Icon padding" +msgstr "Padio eiconau" + +#: discover_overlay/notification_settings.py:325 +msgid "Icon size" +msgstr "Maint yr eicon" + +#: discover_overlay/notification_settings.py:332 +msgid "Notification padding" +msgstr "Padio hysbysiadau" + +#: discover_overlay/notification_settings.py:339 +msgid "Border radius" +msgstr "Radiws y ffin" + +#: discover_overlay/settings.py:161 +msgid "Place & resize this window then press Green!" +msgstr "Rhowch ac ailfeintio'r ffenestr hon yna pwyswch wyrdd!" + +#: discover_overlay/settings.py:167 +msgid "Place & resize this window then press Save!" +msgstr "Rhowch ac ailfeintio'r ffenestr hon yna pwyswch save!" + +#: discover_overlay/settings.py:169 +msgid "Save this position" +msgstr "Cadw'r sefyllfa hon" + +#: discover_overlay/settings_window.py:42 +msgid "Discover Overlay Configuration" +msgstr "Discover Overlay Cyfluniad" + +#: discover_overlay/settings_window.py:54 +msgid "Overview" +msgstr "Trosolwg" + +#: discover_overlay/settings_window.py:59 +msgid "Voice" +msgstr "LLais" + +#: discover_overlay/settings_window.py:64 +#: discover_overlay/voice_settings.py:316 +msgid "Text" +msgstr "Testun" + +#: discover_overlay/settings_window.py:70 +msgid "Notifications" +msgstr "Hysbysiadau" + +#: discover_overlay/settings_window.py:75 +msgid "Core" +msgstr "Craidd" + +#: discover_overlay/text_settings.py:305 +msgid "Hide on mouseover" +msgstr "Cuddio ar lygoden" + +#: discover_overlay/text_settings.py:311 +msgid "Popup Style" +msgstr "Arddull naid" + +#: discover_overlay/text_settings.py:394 +msgid "Channel" +msgstr "Sianel" + +#: discover_overlay/text_settings.py:403 discover_overlay/text_settings.py:415 +msgid "Refresh list" +msgstr "Adnewyddu'r rhestr" + +#: discover_overlay/text_settings.py:406 +msgid "Server" +msgstr "Gweinydd" + +#: discover_overlay/text_settings.py:419 +msgid "Show Attachments" +msgstr "Dangos atodiadau" + +#: discover_overlay/voice_settings.py:317 +msgid "Label" +msgstr "Label" + +#: discover_overlay/voice_settings.py:318 +msgid "Talking" +msgstr "Siarad" + +#: discover_overlay/voice_settings.py:319 +msgid "Idle" +msgstr "Segur" + +#: discover_overlay/voice_settings.py:320 +msgid "Border" +msgstr "Ffin" + +#: discover_overlay/voice_settings.py:321 +msgid "Mute" +msgstr "Treiglo" + +#: discover_overlay/voice_settings.py:404 +msgid "Avatar size" +msgstr "Maint Avatar" + +#: discover_overlay/voice_settings.py:415 +msgid "Square Avatar" +msgstr "Avatar Sgwâr" + +#: discover_overlay/voice_settings.py:425 +msgid "Display Icon Only" +msgstr "Dangos eicon yn unig" + +#: discover_overlay/voice_settings.py:435 +msgid "Display Speakers Only" +msgstr "Dangos siaradwyr yn unig" + +#: discover_overlay/voice_settings.py:445 +msgid "Highlight Self" +msgstr "Tynnu sylw at eich hunan" + +#: discover_overlay/voice_settings.py:455 +msgid "Order Avatars By" +msgstr "Archebu avatars yn ôl" + +#: discover_overlay/voice_settings.py:458 +msgid "Alphabetically" +msgstr "Yn nhrefn yr wyddor" + +#: discover_overlay/voice_settings.py:459 +msgid "ID" +msgstr "ID" + +#: discover_overlay/voice_settings.py:460 +msgid "Last Spoken" +msgstr "Siaradwyd ddiwethaf" + +#: discover_overlay/voice_settings.py:472 +msgid "Icon Spacing" +msgstr "Bylchiad eiconau" + +#: discover_overlay/voice_settings.py:483 +msgid "Text Padding" +msgstr "Padio testun" + +#: discover_overlay/voice_settings.py:494 +msgid "Text Vertical Offset" +msgstr "Gwrthbwysiad fertigol testun" + +#: discover_overlay/voice_settings.py:505 +msgid "Vertical Edge Padding" +msgstr "Padio ymyl fertigol" + +#: discover_overlay/voice_settings.py:517 +msgid "Horizontal Edge Padding" +msgstr "Padio ymyl llorweddol" + +#: discover_overlay/voice_settings.py:529 +msgid "Display Horizontally" +msgstr "Arddangos yn llorweddol" + +#: discover_overlay/voice_settings.py:539 +msgid "Search Servers for User" +msgstr "Chwilio gweinyddwyr ar gyfer y defnyddiwr" + +#: discover_overlay/voice_settings.py:550 +msgid "Guilds" +msgstr "Guilds" + +#: discover_overlay/voice_settings.py:572 +msgid "Filter..." +msgstr "Hidlo..." diff --git a/discover_overlay/locales/en/LC_MESSAGES/default.mo b/discover_overlay/locales/en/LC_MESSAGES/default.mo new file mode 100644 index 0000000000000000000000000000000000000000..6c5906d1cd061dff54de8b533942893de34efc9e GIT binary patch literal 337 zcmYL@Jx{|h5Qd9j%E-dP;DHUUz!pqFHI3Uw*h!U-O0b#M1fyU_j*H-j@b~yFTo(FD zk8Zg4bkFbc(a#8TfSe*{$RTop42h8wT;AXuI{#UD_pUbq(k-mD?~SvRtk~?4EjU^8 zqD=EFDs<<30NFQY3lF=dhsseBt#T;zrx|V_Q9)Dk#909{hlG)3PGx%joM$`|st-_k zW&2hI=P8-jLXeC}P9|KkR7_ct6ud0&v1*&0YBW?@eNZA;wx|b_i4fD)jGb@x9W;=s z, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-04-21 13:10+0000\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=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: discover_overlay/about_settings.py:61 +msgid "Welcome to Discover Overlay" +msgstr "" + +#: discover_overlay/about_settings.py:62 +msgid "" +"Discover-Overlay is a GTK3 overlay written in Python3. It can be configured " +"to show who is currently talking on discord or it can be set to display text " +"and images from a preconfigured channel. It is fully customisable and can be " +"configured to display anywhere on the screen. We fully support X11 and " +"wlroots based environments. We felt the need to make this project due to the " +"shortcomings in support on Linux by the official discord client." +msgstr "" + +#: discover_overlay/about_settings.py:63 +msgid "Please visit our discord" +msgstr "" + +#: discover_overlay/about_settings.py:64 +msgid " for support. Or open an issue on our GitHub " +msgstr "" + +#: discover_overlay/about_settings.py:75 +msgid "Close overlay" +msgstr "" + +#: discover_overlay/discover_overlay.py:161 +msgid "Usage" +msgstr "" + +#: discover_overlay/discover_overlay.py:162 +msgid "Show an X11 or wlroots overlay with information" +msgstr "" + +#: discover_overlay/discover_overlay.py:163 +msgid "from Discord client" +msgstr "" + +#: discover_overlay/discover_overlay.py:165 +msgid "Open configuration window" +msgstr "" + +#: discover_overlay/discover_overlay.py:167 +msgid "Close currently running instance" +msgstr "" + +#: discover_overlay/discover_overlay.py:169 +msgid "Verbose output for aid in debugging" +msgstr "" + +#: discover_overlay/discover_overlay.py:170 +msgid "This screen" +msgstr "" + +#: discover_overlay/discover_overlay.py:171 +msgid "Hide overlay" +msgstr "" + +#: discover_overlay/discover_overlay.py:172 +msgid "Show overlay" +msgstr "" + +#: discover_overlay/discover_overlay.py:174 +msgid "Send command, not start new instance. Only needed if running in flatpak" +msgstr "" + +#: discover_overlay/discover_overlay.py:175 +msgid "Set own user to mute" +msgstr "" + +#: discover_overlay/discover_overlay.py:176 +msgid "Set unmuted" +msgstr "" + +#: discover_overlay/discover_overlay.py:177 +msgid "Set own user to deafened" +msgstr "" + +#: discover_overlay/discover_overlay.py:178 +msgid "Unset user deafened state" +msgstr "" + +#: discover_overlay/discover_overlay.py:180 +msgid "Move the user into voice room, by Room ID" +msgstr "" + +#: discover_overlay/discover_overlay.py:182 +msgid "For gamescope compatibility ensure ENV has 'GDK_BACKEND=x11'" +msgstr "" + +#: discover_overlay/discover_overlay.py:286 +msgid "Settings" +msgstr "" + +#: discover_overlay/discover_overlay.py:287 +msgid "Close" +msgstr "" + +#: discover_overlay/general_settings.py:85 +msgid "Autostart on boot" +msgstr "" + +#: discover_overlay/general_settings.py:91 +msgid "Force XShape" +msgstr "" + +#: discover_overlay/general_settings.py:97 +msgid "Show tray icon" +msgstr "" + +#: discover_overlay/general_settings.py:103 +msgid "Show on taskbar" +msgstr "" + +#: discover_overlay/notification_settings.py:198 +#: discover_overlay/text_settings.py:299 +msgid "Enable" +msgstr "" + +#: discover_overlay/notification_settings.py:204 +msgid "Show test content" +msgstr "" + +#: discover_overlay/notification_settings.py:209 +msgid "Reverse Order" +msgstr "" + +#: discover_overlay/notification_settings.py:215 +#: discover_overlay/text_settings.py:317 +msgid "Popup timer" +msgstr "" + +#: discover_overlay/notification_settings.py:222 +msgid "Limit popup width" +msgstr "" + +#: discover_overlay/notification_settings.py:229 +#: discover_overlay/text_settings.py:324 discover_overlay/voice_settings.py:264 +msgid "Font" +msgstr "" + +#: discover_overlay/notification_settings.py:236 +msgid "Icon position" +msgstr "" + +#: discover_overlay/notification_settings.py:238 +#: discover_overlay/notification_settings.py:285 +#: discover_overlay/text_settings.py:368 discover_overlay/voice_settings.py:365 +#: discover_overlay/voice_settings.py:857 +#: discover_overlay/voice_settings.py:863 +msgid "Left" +msgstr "" + +#: discover_overlay/notification_settings.py:239 +#: discover_overlay/notification_settings.py:286 +#: discover_overlay/text_settings.py:369 discover_overlay/voice_settings.py:366 +#: discover_overlay/voice_settings.py:861 +#: discover_overlay/voice_settings.py:865 +msgid "Right" +msgstr "" + +#: discover_overlay/notification_settings.py:248 +#: discover_overlay/text_settings.py:331 +msgid "Background colour" +msgstr "" + +#: discover_overlay/notification_settings.py:251 +#: discover_overlay/text_settings.py:334 +msgid "Text colour" +msgstr "" + +#: discover_overlay/notification_settings.py:260 +#: discover_overlay/text_settings.py:343 discover_overlay/voice_settings.py:340 +msgid "Overlay Location" +msgstr "" + +#: discover_overlay/notification_settings.py:264 +#: discover_overlay/text_settings.py:347 discover_overlay/voice_settings.py:344 +msgid "Anchor to edge" +msgstr "" + +#: discover_overlay/notification_settings.py:266 +#: discover_overlay/text_settings.py:349 discover_overlay/voice_settings.py:346 +msgid "Floating" +msgstr "" + +#: discover_overlay/notification_settings.py:295 +#: discover_overlay/text_settings.py:378 discover_overlay/voice_settings.py:375 +#: discover_overlay/voice_settings.py:853 +#: discover_overlay/voice_settings.py:867 +msgid "Top" +msgstr "" + +#: discover_overlay/notification_settings.py:296 +#: discover_overlay/text_settings.py:379 discover_overlay/voice_settings.py:376 +#: discover_overlay/voice_settings.py:859 +#: discover_overlay/voice_settings.py:869 +msgid "Middle" +msgstr "" + +#: discover_overlay/notification_settings.py:297 +#: discover_overlay/text_settings.py:380 discover_overlay/voice_settings.py:377 +#: discover_overlay/voice_settings.py:855 +#: discover_overlay/voice_settings.py:871 +msgid "Bottom" +msgstr "" + +#: discover_overlay/notification_settings.py:305 +#: discover_overlay/settings.py:149 discover_overlay/text_settings.py:388 +#: discover_overlay/voice_settings.py:385 +msgid "Place Window" +msgstr "" + +#: discover_overlay/notification_settings.py:312 +msgid "Show Icon" +msgstr "" + +#: discover_overlay/notification_settings.py:318 +msgid "Icon padding" +msgstr "" + +#: discover_overlay/notification_settings.py:325 +msgid "Icon size" +msgstr "" + +#: discover_overlay/notification_settings.py:332 +msgid "Notification padding" +msgstr "" + +#: discover_overlay/notification_settings.py:339 +msgid "Border radius" +msgstr "" + +#: discover_overlay/settings.py:161 +msgid "Place & resize this window then press Green!" +msgstr "" + +#: discover_overlay/settings.py:167 +msgid "Place & resize this window then press Save!" +msgstr "" + +#: discover_overlay/settings.py:169 +msgid "Save this position" +msgstr "" + +#: discover_overlay/settings_window.py:42 +msgid "Discover Overlay Configuration" +msgstr "" + +#: discover_overlay/settings_window.py:54 +msgid "Overview" +msgstr "" + +#: discover_overlay/settings_window.py:59 +msgid "Voice" +msgstr "" + +#: discover_overlay/settings_window.py:64 +#: discover_overlay/voice_settings.py:316 +msgid "Text" +msgstr "" + +#: discover_overlay/settings_window.py:70 +msgid "Notifications" +msgstr "" + +#: discover_overlay/settings_window.py:75 +msgid "Core" +msgstr "" + +#: discover_overlay/text_settings.py:305 +msgid "Hide on mouseover" +msgstr "" + +#: discover_overlay/text_settings.py:311 +msgid "Popup Style" +msgstr "" + +#: discover_overlay/text_settings.py:394 +msgid "Channel" +msgstr "" + +#: discover_overlay/text_settings.py:403 discover_overlay/text_settings.py:415 +msgid "Refresh list" +msgstr "" + +#: discover_overlay/text_settings.py:406 +msgid "Server" +msgstr "" + +#: discover_overlay/text_settings.py:419 +msgid "Show Attachments" +msgstr "" + +#: discover_overlay/voice_settings.py:317 +msgid "Label" +msgstr "" + +#: discover_overlay/voice_settings.py:318 +msgid "Talking" +msgstr "" + +#: discover_overlay/voice_settings.py:319 +msgid "Idle" +msgstr "" + +#: discover_overlay/voice_settings.py:320 +msgid "Border" +msgstr "" + +#: discover_overlay/voice_settings.py:321 +msgid "Mute" +msgstr "" + +#: discover_overlay/voice_settings.py:404 +msgid "Avatar size" +msgstr "" + +#: discover_overlay/voice_settings.py:415 +msgid "Square Avatar" +msgstr "" + +#: discover_overlay/voice_settings.py:425 +msgid "Display Icon Only" +msgstr "" + +#: discover_overlay/voice_settings.py:435 +msgid "Display Speakers Only" +msgstr "" + +#: discover_overlay/voice_settings.py:445 +msgid "Highlight Self" +msgstr "" + +#: discover_overlay/voice_settings.py:455 +msgid "Order Avatars By" +msgstr "" + +#: discover_overlay/voice_settings.py:458 +msgid "Alphabetically" +msgstr "" + +#: discover_overlay/voice_settings.py:459 +msgid "ID" +msgstr "" + +#: discover_overlay/voice_settings.py:460 +msgid "Last Spoken" +msgstr "" + +#: discover_overlay/voice_settings.py:472 +msgid "Icon Spacing" +msgstr "" + +#: discover_overlay/voice_settings.py:483 +msgid "Text Padding" +msgstr "" + +#: discover_overlay/voice_settings.py:494 +msgid "Text Vertical Offset" +msgstr "" + +#: discover_overlay/voice_settings.py:505 +msgid "Vertical Edge Padding" +msgstr "" + +#: discover_overlay/voice_settings.py:517 +msgid "Horizontal Edge Padding" +msgstr "" + +#: discover_overlay/voice_settings.py:529 +msgid "Display Horizontally" +msgstr "" + +#: discover_overlay/voice_settings.py:539 +msgid "Search Servers for User" +msgstr "" + +#: discover_overlay/voice_settings.py:550 +msgid "Guilds" +msgstr "" + +#: discover_overlay/voice_settings.py:572 +msgid "Filter..." +msgstr "" diff --git a/discover_overlay/notification_settings.py b/discover_overlay/notification_settings.py index 34461c8..919a926 100644 --- a/discover_overlay/notification_settings.py +++ b/discover_overlay/notification_settings.py @@ -11,7 +11,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Notification setting tab on settings window""" +import gettext import json +import pkg_resources from configparser import ConfigParser import gi from .settings import SettingsWindow @@ -22,6 +24,9 @@ from gi.repository import Gtk, Gdk # nopep8 GUILD_DEFAULT_VALUE = "0" +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext class NotificationSettingsWindow(SettingsWindow): @@ -192,48 +197,48 @@ class NotificationSettingsWindow(SettingsWindow): box = Gtk.Grid() # Enabled - enabled_label = Gtk.Label.new("Enable") + enabled_label = Gtk.Label.new(_("Enable")) enabled = Gtk.CheckButton.new() enabled.set_active(self.enabled) enabled.connect("toggled", self.change_enabled) # Enabled - testing_label = Gtk.Label.new("Show test content") + testing_label = Gtk.Label.new(_("Show test content")) testing = Gtk.CheckButton.new() testing.connect("toggled", self.change_testing) # Order - reverse_label = Gtk.Label.new("Reverse Order") + reverse_label = Gtk.Label.new(_("Reverse Order")) reverse = Gtk.CheckButton.new() reverse.set_active(self.reverse_order) reverse.connect("toggled", self.change_reverse_order) # Popup timer - text_time_label = Gtk.Label.new("Popup timer") + text_time_label = Gtk.Label.new(_("Popup timer")) text_time_adjustment = Gtk.Adjustment.new( self.text_time, 8, 9000, 1, 1, 8) text_time = Gtk.SpinButton.new(text_time_adjustment, 0, 0) text_time.connect("value-changed", self.change_text_time) # Limit width - limit_width_label = Gtk.Label.new("Limit popup width") + limit_width_label = Gtk.Label.new(_("Limit popup width")) limit_width_adjustment = Gtk.Adjustment.new( self.limit_width, 100, 9000, 1, 1, 8) limit_width = Gtk.SpinButton.new(limit_width_adjustment, 0, 0) limit_width.connect("value-changed", self.change_limit_width) # Font chooser - font_label = Gtk.Label.new("Font") + font_label = Gtk.Label.new(_("Font")) font = Gtk.FontButton() if self.font: font.set_font(self.font) font.connect("font-set", self.change_font) # Icon alignment - align_icon_label = Gtk.Label.new("Icon position") + align_icon_label = Gtk.Label.new(_("Icon position")) align_icon_store = Gtk.ListStore(str) - align_icon_store.append(["Left"]) - align_icon_store.append(["Right"]) + align_icon_store.append([_("Left")]) + align_icon_store.append([_("Right")]) align_icon = Gtk.ComboBox.new_with_model(align_icon_store) align_icon.set_active(not self.icon_left) align_icon.connect("changed", self.change_icon_left) @@ -242,10 +247,10 @@ class NotificationSettingsWindow(SettingsWindow): align_icon.add_attribute(renderer_text, "text", 0) # Colours - bg_col_label = Gtk.Label.new("Background colour") + bg_col_label = Gtk.Label.new(_("Background colour")) bg_col = Gtk.ColorButton.new_with_rgba( Gdk.RGBA(self.bg_col[0], self.bg_col[1], self.bg_col[2], self.bg_col[3])) - fg_col_label = Gtk.Label.new("Text colour") + fg_col_label = Gtk.Label.new(_("Text colour")) fg_col = Gtk.ColorButton.new_with_rgba( Gdk.RGBA(self.fg_col[0], self.fg_col[1], self.fg_col[2], self.fg_col[3])) bg_col.set_use_alpha(True) @@ -254,13 +259,13 @@ class NotificationSettingsWindow(SettingsWindow): fg_col.connect("color-set", self.change_fg) # Monitor & Alignment - align_label = Gtk.Label.new("Overlay Location") + align_label = Gtk.Label.new(_("Overlay Location")) align_type_box = Gtk.HBox() align_type_edge = Gtk.RadioButton.new_with_label( - None, "Anchor to edge") + None, _("Anchor to edge")) align_type_floating = Gtk.RadioButton.new_with_label_from_widget( - align_type_edge, "Floating") + align_type_edge, _("Floating")) if self.floating: align_type_floating.set_active(True) align_type_box.add(align_type_edge) @@ -279,8 +284,8 @@ class NotificationSettingsWindow(SettingsWindow): monitor.add_attribute(renderer_text, "text", 0) align_x_store = Gtk.ListStore(str) - align_x_store.append(["Left"]) - align_x_store.append(["Right"]) + align_x_store.append([_("Left")]) + align_x_store.append([_("Right")]) align_x = Gtk.ComboBox.new_with_model(align_x_store) align_x.set_active(True if self.align_x else False) align_x.connect("changed", self.change_align_x) @@ -289,9 +294,9 @@ class NotificationSettingsWindow(SettingsWindow): align_x.add_attribute(renderer_text, "text", 0) align_y_store = Gtk.ListStore(str) - align_y_store.append(["Top"]) - align_y_store.append(["Middle"]) - align_y_store.append(["Bottom"]) + align_y_store.append([_("Top")]) + align_y_store.append([_("Middle")]) + align_y_store.append([_("Bottom")]) align_y = Gtk.ComboBox.new_with_model(align_y_store) align_y.set_active(self.align_y) align_y.connect("changed", self.change_align_y) @@ -299,41 +304,41 @@ class NotificationSettingsWindow(SettingsWindow): align_y.pack_start(renderer_text, True) align_y.add_attribute(renderer_text, "text", 0) - align_placement_button = Gtk.Button.new_with_label("Place Window") + align_placement_button = Gtk.Button.new_with_label(_("Place Window")) align_type_edge.connect("toggled", self.change_align_type_edge) align_type_floating.connect("toggled", self.change_align_type_floating) align_placement_button.connect("pressed", self.change_placement) # Show Icons - show_icon_label = Gtk.Label.new("Show Icon") + show_icon_label = Gtk.Label.new(_("Show Icon")) show_icon = Gtk.CheckButton.new() show_icon.set_active(self.show_icon) show_icon.connect("toggled", self.change_show_icon) # Icon Padding - icon_padding_label = Gtk.Label.new("Icon padding") + icon_padding_label = Gtk.Label.new(_("Icon padding")) icon_padding_adjustment = Gtk.Adjustment.new( self.icon_padding, 0, 150, 1, 1, 8) icon_padding = Gtk.SpinButton.new(icon_padding_adjustment, 0, 0) icon_padding.connect("value-changed", self.change_icon_pad) # Icon Size - icon_size_label = Gtk.Label.new("Icon size") + icon_size_label = Gtk.Label.new(_("Icon size")) icon_size_adjustment = Gtk.Adjustment.new( self.icon_size, 0, 128, 1, 1, 8) icon_size = Gtk.SpinButton.new(icon_size_adjustment, 0, 0) icon_size.connect("value-changed", self.change_icon_size) # Padding - padding_label = Gtk.Label.new("Notification padding") + padding_label = Gtk.Label.new(_("Notification padding")) padding_adjustment = Gtk.Adjustment.new( self.padding, 0, 150, 1, 1, 8) padding = Gtk.SpinButton.new(padding_adjustment, 0, 0) padding.connect("value-changed", self.change_padding) # Border Radius - border_radius_label = Gtk.Label.new("Border radius") + border_radius_label = Gtk.Label.new(_("Border radius")) border_radius_adjustment = Gtk.Adjustment.new( self.border_radius, 0, 50, 1, 1, 8) border_radius = Gtk.SpinButton.new(border_radius_adjustment, 0, 0) diff --git a/discover_overlay/settings.py b/discover_overlay/settings.py index dc93179..b11ac0d 100644 --- a/discover_overlay/settings.py +++ b/discover_overlay/settings.py @@ -14,8 +14,10 @@ Settings tab parent class. Helpful if we need more overlay types without copy-and-pasting too much code """ +import gettext import os import logging +import pkg_resources import gi from .draggable_window import DraggableWindow from .draggable_window_wayland import DraggableWindowWayland @@ -30,6 +32,10 @@ except ModuleNotFoundError: from xdg import XDG_CONFIG_HOME as xdg_config_home log = logging.getLogger(__name__) +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext + class SettingsWindow(Gtk.VBox): """ @@ -138,11 +144,11 @@ class SettingsWindow(Gtk.VBox): self.floating_h = height log.info("Positioned overlay : %s , %s %s x %s", self.floating_x, - self.floating_y, self.floating_w, self.floating_h) + self.floating_y, self.floating_w, self.floating_h) self.overlay.set_floating(True, pos_x, pos_y, width, height) self.save_config() if button: - button.set_label("Place Window") + button.set_label(_("Place Window")) self.placement_window.close() self.placement_window = None if self.discover.steamos: @@ -154,15 +160,15 @@ class SettingsWindow(Gtk.VBox): self.placement_window = DraggableWindowWayland( pos_x=self.floating_x, pos_y=self.floating_y, width=self.floating_w, height=self.floating_h, - message="Place & resize this window then press Green!", settings=self, + message=_("Place & resize this window then press Green!"), settings=self, steamos=self.discover.steamos) else: self.placement_window = DraggableWindow( pos_x=self.floating_x, pos_y=self.floating_y, width=self.floating_w, height=self.floating_h, - message="Place & resize this window then press Save!", settings=self) + message=_("Place & resize this window then press Save!"), settings=self) if button: - button.set_label("Save this position") + button.set_label(_("Save this position")) def change_align_type_edge(self, button): """ diff --git a/discover_overlay/settings_window.py b/discover_overlay/settings_window.py index 0faddd2..50e1db2 100644 --- a/discover_overlay/settings_window.py +++ b/discover_overlay/settings_window.py @@ -11,7 +11,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Settings window holding all settings tab""" +import gettext import gi +import pkg_resources from .voice_settings import VoiceSettingsWindow from .text_settings import TextSettingsWindow from .general_settings import GeneralSettingsWindow @@ -21,6 +23,10 @@ gi.require_version("Gtk", "3.0") # pylint: disable=wrong-import-position,wrong-import-order from gi.repository import Gtk # nopep8 +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext + class MainSettingsWindow(Gtk.Window): """Settings window holding all settings tab""" @@ -35,7 +41,7 @@ class MainSettingsWindow(Gtk.Window): self.text_overlay = discover.text_overlay self.voice_overlay = discover.voice_overlay self.notification_overlay = discover.notification_overlay - self.set_title("Discover Overlay Configuration") + self.set_title(_("Discover Overlay Configuration")) self.set_icon_name("discover-overlay") self.set_default_size(280, 180) @@ -47,28 +53,28 @@ class MainSettingsWindow(Gtk.Window): self.set_default_size(1280, 800) self.about_settings = AboutSettingsWindow(self.discover) - about_label = Gtk.Label.new("Overview") + about_label = Gtk.Label.new(_("Overview")) notebook.append_page(self.about_settings) notebook.set_tab_label(self.about_settings, about_label) self.voice_settings = VoiceSettingsWindow(self.voice_overlay, discover) - voice_label = Gtk.Label.new("Voice") + voice_label = Gtk.Label.new(_("Voice")) notebook.append_page(self.voice_settings) notebook.set_tab_label(self.voice_settings, voice_label) self.text_settings = TextSettingsWindow(self.text_overlay, discover) - text_label = Gtk.Label.new("Text") + text_label = Gtk.Label.new(_("Text")) notebook.append_page(self.text_settings) notebook.set_tab_label(self.text_settings, text_label) self.notification_settings = NotificationSettingsWindow( self.notification_overlay, discover) - notification_label = Gtk.Label.new("Notifications") + notification_label = Gtk.Label.new(_("Notifications")) notebook.append_page(self.notification_settings) notebook.set_tab_label(self.notification_settings, notification_label) self.core_settings = GeneralSettingsWindow(self.discover) - core_label = Gtk.Label.new("Core") + core_label = Gtk.Label.new(_("Core")) notebook.append_page(self.core_settings) notebook.set_tab_label(self.core_settings, core_label) self.add(notebook) diff --git a/discover_overlay/text_settings.py b/discover_overlay/text_settings.py index 4ec290d..6a3f22a 100644 --- a/discover_overlay/text_settings.py +++ b/discover_overlay/text_settings.py @@ -11,8 +11,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Text setting tab on settings window""" +import gettext import json import logging +import pkg_resources from configparser import ConfigParser import gi from .settings import SettingsWindow @@ -24,6 +26,9 @@ from gi.repository import Gtk, Gdk # nopep8 GUILD_DEFAULT_VALUE = "0" log = logging.getLogger(__name__) +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext class TextSettingsWindow(SettingsWindow): @@ -293,42 +298,42 @@ class TextSettingsWindow(SettingsWindow): box = Gtk.Grid() # Enabled - enabled_label = Gtk.Label.new("Enable") + enabled_label = Gtk.Label.new(_("Enable")) enabled = Gtk.CheckButton.new() enabled.set_active(self.enabled) enabled.connect("toggled", self.change_enabled) # Autohide - autohide_label = Gtk.Label.new("Hide on mouseover") + autohide_label = Gtk.Label.new(_("Hide on mouseover")) autohide = Gtk.CheckButton.new() autohide.set_active(self.autohide) autohide.connect("toggled", self.change_hide_on_mouseover) # Popup Style - popup_style_label = Gtk.Label.new("Popup Style") + popup_style_label = Gtk.Label.new(_("Popup Style")) popup_style = Gtk.CheckButton.new() popup_style.set_active(self.popup_style) popup_style.connect("toggled", self.change_popup_style) # Popup timer - text_time_label = Gtk.Label.new("Popup timer") + text_time_label = Gtk.Label.new(_("Popup timer")) text_time_adjustment = Gtk.Adjustment.new( self.text_time, 8, 9000, 1, 1, 8) text_time = Gtk.SpinButton.new(text_time_adjustment, 0, 0) text_time.connect("value-changed", self.change_text_time) # Font chooser - font_label = Gtk.Label.new("Font") + font_label = Gtk.Label.new(_("Font")) font = Gtk.FontButton() if self.font: font.set_font(self.font) font.connect("font-set", self.change_font) # Colours - bg_col_label = Gtk.Label.new("Background colour") + bg_col_label = Gtk.Label.new(_("Background colour")) bg_col = Gtk.ColorButton.new_with_rgba( Gdk.RGBA(self.bg_col[0], self.bg_col[1], self.bg_col[2], self.bg_col[3])) - fg_col_label = Gtk.Label.new("Text colour") + fg_col_label = Gtk.Label.new(_("Text colour")) fg_col = Gtk.ColorButton.new_with_rgba( Gdk.RGBA(self.fg_col[0], self.fg_col[1], self.fg_col[2], self.fg_col[3])) bg_col.set_use_alpha(True) @@ -337,13 +342,13 @@ class TextSettingsWindow(SettingsWindow): fg_col.connect("color-set", self.change_fg) # Monitor & Alignment - align_label = Gtk.Label.new("Overlay Location") + align_label = Gtk.Label.new(_("Overlay Location")) align_type_box = Gtk.HBox() align_type_edge = Gtk.RadioButton.new_with_label( - None, "Anchor to edge") + None, _("Anchor to edge")) align_type_floating = Gtk.RadioButton.new_with_label_from_widget( - align_type_edge, "Floating") + align_type_edge, _("Floating")) if self.floating: align_type_floating.set_active(True) align_type_box.add(align_type_edge) @@ -362,8 +367,8 @@ class TextSettingsWindow(SettingsWindow): monitor.add_attribute(renderer_text, "text", 0) align_x_store = Gtk.ListStore(str) - align_x_store.append(["Left"]) - align_x_store.append(["Right"]) + align_x_store.append([_("Left")]) + align_x_store.append([_("Right")]) align_x = Gtk.ComboBox.new_with_model(align_x_store) align_x.set_active(True if self.align_x else False) align_x.connect("changed", self.change_align_x) @@ -372,9 +377,9 @@ class TextSettingsWindow(SettingsWindow): align_x.add_attribute(renderer_text, "text", 0) align_y_store = Gtk.ListStore(str) - align_y_store.append(["Top"]) - align_y_store.append(["Middle"]) - align_y_store.append(["Bottom"]) + align_y_store.append([_("Top")]) + align_y_store.append([_("Middle")]) + align_y_store.append([_("Bottom")]) align_y = Gtk.ComboBox.new_with_model(align_y_store) align_y.set_active(self.align_y) align_y.connect("changed", self.change_align_y) @@ -382,13 +387,13 @@ class TextSettingsWindow(SettingsWindow): align_y.pack_start(renderer_text, True) align_y.add_attribute(renderer_text, "text", 0) - align_placement_button = Gtk.Button.new_with_label("Place Window") + align_placement_button = Gtk.Button.new_with_label(_("Place Window")) align_type_edge.connect("toggled", self.change_align_type_edge) align_type_floating.connect("toggled", self.change_align_type_floating) align_placement_button.connect("pressed", self.change_placement) - channel_label = Gtk.Label.new("Channel") + channel_label = Gtk.Label.new(_("Channel")) channel = Gtk.ComboBox.new() channel.connect("changed", self.change_channel) @@ -397,10 +402,10 @@ class TextSettingsWindow(SettingsWindow): channel.add_attribute(renderer_text, "text", 0) channel.add_attribute(renderer_text, 'sensitive', 1) - channel_refresh = Gtk.Button.new_with_label("Refresh list") + channel_refresh = Gtk.Button.new_with_label(_("Refresh list")) channel_refresh.connect("pressed", self.refresh_channel_list) - guild_label = Gtk.Label.new("Server") + guild_label = Gtk.Label.new(_("Server")) guild = Gtk.ComboBox.new() guild.connect("changed", self.change_guild) @@ -409,11 +414,11 @@ class TextSettingsWindow(SettingsWindow): guild.add_attribute(renderer_text, "text", 0) guild.add_attribute(renderer_text, 'sensitive', 1) - guild_refresh = Gtk.Button.new_with_label("Refresh list") + guild_refresh = Gtk.Button.new_with_label(_("Refresh list")) guild_refresh.connect("pressed", self.refresh_guild_list) # Show Attachments - show_attach_label = Gtk.Label.new("Show Attachments") + show_attach_label = Gtk.Label.new(_("Show Attachments")) show_attach = Gtk.CheckButton.new() show_attach.set_active(self.show_attach) show_attach.connect("toggled", self.change_show_attach) diff --git a/discover_overlay/voice_settings.py b/discover_overlay/voice_settings.py index cb8c516..9304402 100644 --- a/discover_overlay/voice_settings.py +++ b/discover_overlay/voice_settings.py @@ -11,7 +11,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . """Voice setting tab on settings window""" +import gettext import json +import pkg_resources from configparser import ConfigParser import gi from .settings import SettingsWindow @@ -19,6 +21,10 @@ gi.require_version("Gtk", "3.0") # pylint: disable=wrong-import-position,wrong-import-order from gi.repository import Gtk, Gdk # nopep8 +t = gettext.translation( + 'default', pkg_resources.resource_filename('discover_overlay', 'locales')) +_ = t.gettext + def parse_guild_ids(guild_ids_str): """Parse the guild_ids from a str and return them in a list""" @@ -257,7 +263,7 @@ class VoiceSettingsWindow(SettingsWindow): #autohide.connect("toggled", self.change_hide_on_mouseover) # Font chooser - font_label = Gtk.Label.new("Font") + font_label = Gtk.Label.new(_("Font")) font = Gtk.FontButton() if self.font: font.set_font(self.font) @@ -309,12 +315,12 @@ class VoiceSettingsWindow(SettingsWindow): t_hi_col.connect("color-set", self.change_t_hi) bo_col.connect("color-set", self.change_bo) - text_label = Gtk.Label.new("Text") - background_label = Gtk.Label.new("Label") - talking_label = Gtk.Label.new("Talking") - idle_label = Gtk.Label.new("Idle") - border_label = Gtk.Label.new("Border") - mute_label = Gtk.Label.new("Mute") + text_label = Gtk.Label.new(_("Text")) + background_label = Gtk.Label.new(_("Label")) + talking_label = Gtk.Label.new(_("Talking")) + idle_label = Gtk.Label.new(_("Idle")) + border_label = Gtk.Label.new(_("Border")) + mute_label = Gtk.Label.new(_("Mute")) colour_box.attach(text_label, 1, 0, 1, 1) colour_box.attach(background_label, 2, 0, 1, 1) @@ -333,13 +339,13 @@ class VoiceSettingsWindow(SettingsWindow): colour_box.attach(mt_col, 1, 4, 1, 1) # Monitor & Alignment - align_label = Gtk.Label.new("Overlay Location") + align_label = Gtk.Label.new(_("Overlay Location")) align_type_box = Gtk.HBox() align_type_edge = Gtk.RadioButton.new_with_label( - None, "Anchor to edge") + None, _("Anchor to edge")) align_type_floating = Gtk.RadioButton.new_with_label_from_widget( - align_type_edge, "Floating") + align_type_edge, _("Floating")) if self.floating: align_type_floating.set_active(True) align_type_box.add(align_type_edge) @@ -358,8 +364,8 @@ class VoiceSettingsWindow(SettingsWindow): monitor.add_attribute(renderer_text, "text", 0) self.align_x_store = Gtk.ListStore(str) - self.align_x_store.append(["Left"]) - self.align_x_store.append(["Right"]) + self.align_x_store.append([_("Left")]) + self.align_x_store.append([_("Right")]) align_x = Gtk.ComboBox.new_with_model(self.align_x_store) align_x.set_active(True if self.align_x else False) align_x.connect("changed", self.change_align_x) @@ -368,9 +374,9 @@ class VoiceSettingsWindow(SettingsWindow): align_x.add_attribute(renderer_text, "text", 0) self.align_y_store = Gtk.ListStore(str) - self.align_y_store.append(["Top"]) - self.align_y_store.append(["Middle"]) - self.align_y_store.append(["Bottom"]) + self.align_y_store.append([_("Top")]) + self.align_y_store.append([_("Middle")]) + self.align_y_store.append([_("Bottom")]) align_y = Gtk.ComboBox.new_with_model(self.align_y_store) align_y.set_active(self.align_y) align_y.connect("changed", self.change_align_y) @@ -378,7 +384,7 @@ class VoiceSettingsWindow(SettingsWindow): align_y.pack_start(renderer_text, True) align_y.add_attribute(renderer_text, "text", 0) - align_placement_button = Gtk.Button.new_with_label("Place Window") + align_placement_button = Gtk.Button.new_with_label(_("Place Window")) align_type_edge.connect("toggled", self.change_align_type_edge) align_type_floating.connect("toggled", self.change_align_type_floating) @@ -397,7 +403,7 @@ class VoiceSettingsWindow(SettingsWindow): monitor_box.attach(align_placement_button, 1, 5, 1, 1) # Avatar size - avatar_size_label = Gtk.Label.new("Avatar size") + avatar_size_label = Gtk.Label.new(_("Avatar size")) avatar_size_label.set_xalign(0) avatar_adjustment = Gtk.Adjustment.new( self.avatar_size, 8, 128, 1, 1, 8) @@ -408,7 +414,7 @@ class VoiceSettingsWindow(SettingsWindow): avatar_box.attach(avatar_size, 1, 0, 1, 1) # Avatar shape - square_avatar_label = Gtk.Label.new("Square Avatar") + square_avatar_label = Gtk.Label.new(_("Square Avatar")) square_avatar_label.set_xalign(0) square_avatar = Gtk.CheckButton.new() square_avatar.set_active(self.square_avatar) @@ -418,7 +424,7 @@ class VoiceSettingsWindow(SettingsWindow): avatar_box.attach(square_avatar, 1, 2, 1, 1) # Display icon only - icon_only_label = Gtk.Label.new("Display Icon Only") + icon_only_label = Gtk.Label.new(_("Display Icon Only")) icon_only_label.set_xalign(0) icon_only = Gtk.CheckButton.new() icon_only.set_active(self.icon_only) @@ -428,7 +434,7 @@ class VoiceSettingsWindow(SettingsWindow): avatar_box.attach(icon_only, 1, 1, 1, 1) # Display Speaker only - only_speaking_label = Gtk.Label.new("Display Speakers Only") + only_speaking_label = Gtk.Label.new(_("Display Speakers Only")) only_speaking_label.set_xalign(0) only_speaking = Gtk.CheckButton.new() only_speaking.set_active(self.only_speaking) @@ -438,7 +444,7 @@ class VoiceSettingsWindow(SettingsWindow): avatar_box.attach(only_speaking, 1, 3, 1, 1) # Highlight self - highlight_self_label = Gtk.Label.new("Highlight Self") + highlight_self_label = Gtk.Label.new(_("Highlight Self")) highlight_self_label.set_xalign(0) highlight_self = Gtk.CheckButton.new() highlight_self.set_active(self.highlight_self) @@ -448,12 +454,12 @@ class VoiceSettingsWindow(SettingsWindow): avatar_box.attach(highlight_self, 1, 4, 1, 1) # Order avatars - order_label = Gtk.Label.new("Order Avatars By") + order_label = Gtk.Label.new(_("Order Avatars By")) order_label.set_xalign(0) order_store = Gtk.ListStore(str) - order_store.append(["Alphabetically"]) - order_store.append(["ID"]) - order_store.append(["Last Spoken"]) + order_store.append([_("Alphabetically")]) + order_store.append([_("ID")]) + order_store.append([_("Last Spoken")]) order = Gtk.ComboBox.new_with_model(order_store) order.set_active(self.order) order.connect("changed", self.change_order) @@ -465,7 +471,7 @@ class VoiceSettingsWindow(SettingsWindow): avatar_box.attach(order, 1, 5, 1, 1) # Icon spacing - icon_spacing_label = Gtk.Label.new("Icon Spacing") + icon_spacing_label = Gtk.Label.new(_("Icon Spacing")) icon_spacing_label.set_xalign(0) icon_spacing_adjustment = Gtk.Adjustment.new( self.icon_spacing, 0, 64, 1, 1, 0) @@ -476,7 +482,7 @@ class VoiceSettingsWindow(SettingsWindow): alignment_box.attach(icon_spacing, 1, 1, 1, 1) # Text padding - text_padding_label = Gtk.Label.new("Text Padding") + text_padding_label = Gtk.Label.new(_("Text Padding")) text_padding_label.set_xalign(0) text_padding_adjustment = Gtk.Adjustment.new( self.text_padding, 0, 64, 1, 1, 0) @@ -487,7 +493,7 @@ class VoiceSettingsWindow(SettingsWindow): alignment_box.attach(text_padding, 1, 2, 1, 1) # Text Baseline Adjustment - text_baseline_label = Gtk.Label.new("Text Vertical Offset") + text_baseline_label = Gtk.Label.new(_("Text Vertical Offset")) text_baseline_label.set_xalign(0) text_baseline_adjustment = Gtk.Adjustment.new( self.text_baseline_adj, -32, 32, 1, 1, 0) @@ -498,7 +504,7 @@ class VoiceSettingsWindow(SettingsWindow): alignment_box.attach(text_baseline, 1, 3, 1, 1) # Edge padding - vert_edge_padding_label = Gtk.Label.new("Vertical Edge Padding") + vert_edge_padding_label = Gtk.Label.new(_("Vertical Edge Padding")) vert_edge_padding_label.set_xalign(0) vert_edge_padding_adjustment = Gtk.Adjustment.new( self.vert_edge_padding, 0, 1000, 1, 1, 0) @@ -510,7 +516,7 @@ class VoiceSettingsWindow(SettingsWindow): alignment_box.attach(vert_edge_padding_label, 0, 4, 1, 1) alignment_box.attach(vert_edge_padding, 1, 4, 1, 1) - horz_edge_padding_label = Gtk.Label.new("Horizontal Edge Padding") + horz_edge_padding_label = Gtk.Label.new(_("Horizontal Edge Padding")) horz_edge_padding_adjustment = Gtk.Adjustment.new( self.horz_edge_padding, 0, 1000, 1, 1, 0) horz_edge_padding = Gtk.SpinButton.new( @@ -522,7 +528,7 @@ class VoiceSettingsWindow(SettingsWindow): alignment_box.attach(horz_edge_padding, 1, 5, 1, 1) # Display icon horizontally - horizontal_label = Gtk.Label.new("Display Horizontally") + horizontal_label = Gtk.Label.new(_("Display Horizontally")) horizontal_label.set_xalign(0) horizontal = Gtk.CheckButton.new() horizontal.set_active(self.horizontal) @@ -532,7 +538,7 @@ class VoiceSettingsWindow(SettingsWindow): alignment_box.attach(horizontal, 1, 6, 1, 1) # Guild ids to load: - guild_ids_label = Gtk.Label.new("Search Servers for User") + guild_ids_label = Gtk.Label.new(_("Search Servers for User")) guild_ids_box = Gtk.VBox(homogeneous=False) self.guild_ids_list = Gtk.ListStore(bool, str, str, str) self.guild_ids_filter = self.guild_ids_list.filter_new() @@ -543,7 +549,7 @@ class VoiceSettingsWindow(SettingsWindow): guild_ids_scroll_window.set_size_request(300, 150) guild_ids_tree = Gtk.TreeView(model=self.guild_ids_filter) - guild_column = Gtk.TreeViewColumn("Guilds") + guild_column = Gtk.TreeViewColumn(_("Guilds")) toggle = Gtk.CellRendererToggle() title = Gtk.CellRendererText() @@ -565,7 +571,7 @@ class VoiceSettingsWindow(SettingsWindow): "row-activated", self.on_guild_selection_changed) guild_filter = Gtk.Entry() - guild_filter.set_placeholder_text("Filter...") + guild_filter.set_placeholder_text(_("Filter...")) guild_filter.connect("changed", self.guild_filter_changed) guild_ids_box.pack_start(guild_ids_label, False, False, 0) @@ -846,22 +852,22 @@ class VoiceSettingsWindow(SettingsWindow): i = self.align_x_store.get_iter_first() i2 = self.align_y_store.get_iter_first() if self.horizontal: - self.align_x_store.set_value(i, 0, "Top") + self.align_x_store.set_value(i, 0, _("Top")) i = self.align_x_store.iter_next(i) - self.align_x_store.set_value(i, 0, "Bottom") + self.align_x_store.set_value(i, 0, _("Bottom")) - self.align_y_store.set_value(i2, 0, "Left") + self.align_y_store.set_value(i2, 0, _("Left")) i2 = self.align_y_store.iter_next(i2) - self.align_y_store.set_value(i2, 0, "Middle") + self.align_y_store.set_value(i2, 0, _("Middle")) i2 = self.align_y_store.iter_next(i2) - self.align_y_store.set_value(i2, 0, "Right") + self.align_y_store.set_value(i2, 0, _("Right")) else: - self.align_x_store.set_value(i, 0, "Left") + self.align_x_store.set_value(i, 0, _("Left")) i = self.align_x_store.iter_next(i) - self.align_x_store.set_value(i, 0, "Right") + self.align_x_store.set_value(i, 0, _("Right")) - self.align_y_store.set_value(i2, 0, "Top") + self.align_y_store.set_value(i2, 0, _("Top")) i2 = self.align_y_store.iter_next(i2) - self.align_y_store.set_value(i2, 0, "Middle") + self.align_y_store.set_value(i2, 0, _("Middle")) i2 = self.align_y_store.iter_next(i2) - self.align_y_store.set_value(i2, 0, "Bottom") + self.align_y_store.set_value(i2, 0, _("Bottom")) diff --git a/setup.py b/setup.py index cacd83c..b6ead70 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,9 @@ setup( 'Topic :: Communications :: Chat', 'Topic :: Communications :: Conferencing', ], + package_data={ + 'discover_overlay': ['locales/*/LC_MESSAGES/*.mo'] + }, keywords='discord overlay voice linux', license='GPLv3+', )