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: 2010-06-23
# 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
# Doing i18n with GNU gettext for the core text gets complicated, so what I do is that I make the
@@ -44,12 +44,34 @@ def set_tr(new_tr, new_trget=None):
def get_locale_name(lang):
if ISWINDOWS:
# http://msdn.microsoft.com/en-us/library/39cwe7zf(vs.71).aspx
LANG2LOCALENAME = {'fr': 'fra', 'de': 'deu', 'it': 'ita', 'zh_CN': 'chs', 'cs': 'czy',
'nl': 'nld', 'ru': 'rus', 'pt_BR': 'ptb', 'es': 'esn'}
LANG2LOCALENAME = {
'cs': 'czy',
'de': 'deu',
'es': 'esn',
'fr': 'fra',
'it': 'ita',
'nl': 'nld',
'pl_PL': 'polish_poland',
'pt_BR': 'ptb',
'ru': 'rus',
'zh_CN': 'chs',
}
else:
LANG2LOCALENAME = {'fr': 'fr_FR', 'de': 'de_DE', 'it': 'it_IT', 'zh_CN': 'zh_CN',
'cs': 'cs_CZ', 'nl': 'nl_NL', 'hy': 'hy_AM', 'ru': 'ru_RU', 'uk': 'uk_UA',
'pt_BR': 'pt_BR', 'es': 'es_ES', 'vi': 'vi_VN'}
LANG2LOCALENAME = {
'fr': 'fr_FR',
'de': 'de_DE',
'it': 'it_IT',
'zh_CN': 'zh_CN',
'cs': 'cs_CZ',
'nl': 'nl_NL',
'hy': 'hy_AM',
'ru': 'ru_RU',
'uk': 'uk_UA',
'pl_PL': 'pl_PL',
'pt_BR': 'pt_BR',
'es': 'es_ES',
'vi': 'vi_VN',
}
if lang not in LANG2LOCALENAME:
return None
result = LANG2LOCALENAME[lang]
@@ -90,7 +112,7 @@ def install_gettext_trans(base_folder, lang):
return gettext.translation(domain, localedir=base_folder, languages=[lang]).gettext
except IOError:
return lambda s: s
default_gettext = gettext_trget('core')
def gettext_tr(s, context=None):
if not context: