1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Add Polish localization (from mstefanski1987)

This commit is contained in:
Virgil Dupras
2015-04-12 21:53:45 -04:00
parent dba231cf21
commit 23b29eb5c3
6 changed files with 1222 additions and 25 deletions

View File

@@ -1,9 +1,9 @@
# Created By: Virgil Dupras
# Created On: 2009-05-03
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from PyQt5.QtCore import Qt, QSettings, QRect
@@ -24,6 +24,7 @@ LANGNAMES = {
'ru': tr("Russian"),
'uk': tr("Ukrainian"),
'nl': tr('Dutch'),
'pl_PL': tr("Polish"),
'pt_BR': tr("Brazilian"),
'es': tr("Spanish"),
'vi': tr("Vietnamese"),
@@ -62,17 +63,17 @@ class Preferences:
def __init__(self):
self.reset()
self._settings = QSettings()
def _load_values(self, settings, get):
pass
def get_rect(self, name, default=None):
r = self.get_value(name, default)
if r is not None:
return QRect(*r)
else:
return None
def get_value(self, name, default=None):
if self._settings.contains(name):
result = adjust_after_deserialization(self._settings.value(name))
@@ -84,29 +85,29 @@ class Preferences:
return default
else:
return default
def load(self):
self.reset()
self._load_values(self._settings)
def reset(self):
pass
def _save_values(self, settings, set_):
pass
def save(self):
self._save_values(self._settings)
self._settings.sync()
def set_rect(self, name, r):
if isinstance(r, QRect):
rectAsList = [r.x(), r.y(), r.width(), r.height()]
self.set_value(name, rectAsList)
def set_value(self, name, value):
self._settings.setValue(name, normalize_for_serialization(value))
def saveGeometry(self, name, widget):
# We save geometry under a 5-sized int array: first item is a flag for whether the widget
# is maximized and the other 4 are (x, y, w, h).
@@ -114,7 +115,7 @@ class Preferences:
r = widget.geometry()
rectAsList = [r.x(), r.y(), r.width(), r.height()]
self.set_value(name, [m] + rectAsList)
def restoreGeometry(self, name, widget):
l = self.get_value(name)
if l and len(l) == 5:
@@ -124,4 +125,4 @@ class Preferences:
else:
r = QRect(x, y, w, h)
widget.setGeometry(r)