ask for a little help, if appropriate

This commit is contained in:
Paul Franklin 2016-09-17 18:20:30 -07:00
parent e23e40a698
commit 2a5f58bd50
3 changed files with 36 additions and 0 deletions

View File

@ -151,6 +151,7 @@ register('behavior.recent-export-type', 3)
register('behavior.spellcheck', False)
register('behavior.startup', 0)
register('behavior.surname-guessing', 0)
register('behavior.translator-needed', True)
register('behavior.use-tips', False)
register('behavior.welcome', 100)
register('behavior.web-search-url', 'http://google.com/#&q=%(text)s')

View File

@ -110,6 +110,9 @@ _LOCALE_NAMES = {
'zh_TW': ('Chinese_Taiwan', '950', _("Chinese (Traditional)")),
}
# locales with less than 70% currently translated
INCOMPLETE_TRANSLATIONS = ('ar', 'bg', 'he', 'ja', 'sq', 'tr')
def _check_mswin_locale(locale):
msloc = None
try:

View File

@ -192,6 +192,36 @@ def _display_gtk_gettext_message(parent=None):
'bold_end' : '</b>'},
parent=parent)
def _display_translator_message(parent=None):
"""
Display a translator-wanted message to the user.
"""
if config.get('behavior.translator-needed'):
config.set('behavior.translator-needed', False)
from gramps.gen.utils.grampslocale import INCOMPLETE_TRANSLATIONS
language = None
if glocale.lang in INCOMPLETE_TRANSLATIONS:
language = glocale.lang
elif glocale.lang[:2] in INCOMPLETE_TRANSLATIONS:
language = glocale.lang[:2]
if language:
from .dialog import WarningDialog
from gramps.gen.const import URL_MAILINGLIST
# we are looking for a translator so leave this in English
WarningDialog("This Gramps has an incomplete translation",
"The translation for the "
"current language (%(language)s) is incomplete.\n"
"%(bold_start)sGramps%(bold_end)s "
"will start anyway, but if you would like "
"to improve\nGramps by doing some translating, "
"please contact us!\n\n"
"Subscribe to gramps-devel at\n%(mailing_list_url)s"
"\n" % {'language' : language,
'bold_start' : '<b>',
'bold_end' : '</b>',
'mailing_list_url' : URL_MAILINGLIST},
parent=parent)
#-------------------------------------------------------------------------
#
# Main Gramps class
@ -228,6 +258,8 @@ class Gramps:
_display_welcome_message(parent=self._vm.window)
_display_translator_message(parent=self._vm.window)
self._vm.init_interface()
#act based on the given arguments