Skip to content

Commit

Permalink
Move locales to extension folder
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeJoeTV committed Dec 17, 2021
1 parent 2eb7e5c commit be06657
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# nemo-extension-kdeconnect
Extension for the Nemo filemanager that add the ability to send files to devices connected using KDEConnect
16 changes: 12 additions & 4 deletions src/nemo-kdeconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

import gettext, locale

locale_dir = "./nemo-kdeconnect/locale" # GLib.get_home_dir() + "/.local/share/locale"
locale_domain = "nemo-kdeconnect"

# Get correct icon name from device type string
def get_device_icon(device_type):
if device_type == "dektop":
Expand All @@ -39,8 +42,8 @@ def __init__(self):
def send_files(self, menu, files, device):
# Setup translation
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain("nemo-kdeconnect", GLib.get_home_dir() + "/.local/share/locale")
gettext.textdomain("nemo-kdeconnect")
gettext.bindtextdomain(locale_domain, locale_dir)
gettext.textdomain(locale_domain)
_ = gettext.gettext

# Add all file URIs to a list
Expand Down Expand Up @@ -111,8 +114,8 @@ def get_file_items(self, window, files):

# Setup translation
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain("nemo-kdeconnect", GLib.get_home_dir() + "/.local/share/locale")
gettext.textdomain("nemo-kdeconnect")
gettext.bindtextdomain(locale_domain, locale_dir)
gettext.textdomain(locale_domain)
_ = gettext.gettext

# Main Menu Item
Expand All @@ -137,4 +140,9 @@ def get_file_items(self, window, files):
return [main_menuitem]

def get_name_and_desc(self):
# Setup translation
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain(locale_domain, locale_dir)
gettext.textdomain(locale_domain)
_ = gettext.gettext
return [("Nemo KDE Connect:::"+_("Share files to connected devices via KDE Connect directly from within Nemo."))]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit be06657

Please sign in to comment.