mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 02:24:12 +01:00
Internationalize questions.py
This commit is contained in:
parent
6b26861c23
commit
da9a1bfb70
@ -5,7 +5,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2010-10-20 18:27+CEST\n"
|
"POT-Creation-Date: 2010-10-20 18:33+CEST\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -1009,3 +1009,23 @@ msgid ""
|
|||||||
" what's breaking or when, but think that it might be logged."
|
" what's breaking or when, but think that it might be logged."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/questions.py:60
|
||||||
|
msgid "Sorry, that response was not an option."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/questions.py:106
|
||||||
|
msgid "Sorry, you must enter a value."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/questions.py:126
|
||||||
|
msgid "Enter password: "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/questions.py:128
|
||||||
|
msgid "Re-enter password: "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: src/questions.py:141
|
||||||
|
msgid "Passwords don't match."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ from getpass import getpass as getPass
|
|||||||
|
|
||||||
import supybot.ansi as ansi
|
import supybot.ansi as ansi
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
|
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
||||||
|
_ = PluginInternationalization()
|
||||||
|
|
||||||
useBold = False
|
useBold = False
|
||||||
|
|
||||||
@ -55,7 +57,7 @@ def expect(prompt, possibilities, recursed=False, default=None,
|
|||||||
prompt = utils.str.normalizeWhitespace(prompt)
|
prompt = utils.str.normalizeWhitespace(prompt)
|
||||||
originalPrompt = prompt
|
originalPrompt = prompt
|
||||||
if recursed:
|
if recursed:
|
||||||
output('Sorry, that response was not an option.')
|
output(_('Sorry, that response was not an option.'))
|
||||||
if useBold:
|
if useBold:
|
||||||
choices = '[%s%%s%s]' % (ansi.RESET, ansi.BOLD)
|
choices = '[%s%%s%s]' % (ansi.RESET, ansi.BOLD)
|
||||||
else:
|
else:
|
||||||
@ -101,7 +103,7 @@ def something(prompt, default=None):
|
|||||||
"""Allow anything *except* nothing from the user."""
|
"""Allow anything *except* nothing from the user."""
|
||||||
s = expect(prompt, [], default=default)
|
s = expect(prompt, [], default=default)
|
||||||
while not s:
|
while not s:
|
||||||
output('Sorry, you must enter a value.')
|
output(_('Sorry, you must enter a value.'))
|
||||||
s = expect(prompt, [], default=default)
|
s = expect(prompt, [], default=default)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
@ -118,8 +120,12 @@ def yn(prompt, default=None):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def getpass(prompt='Enter password: ', secondPrompt='Re-enter password: '):
|
def getpass(prompt=None, secondPrompt=None):
|
||||||
"""Prompt the user for a password."""
|
"""Prompt the user for a password."""
|
||||||
|
if prompt is None:
|
||||||
|
prompt = _('Enter password: ')
|
||||||
|
if secondPrompt is None:
|
||||||
|
secondPrompt = _('Re-enter password: ')
|
||||||
password = ''
|
password = ''
|
||||||
secondPassword = ' ' # Note that this should be different than password.
|
secondPassword = ' ' # Note that this should be different than password.
|
||||||
assert prompt
|
assert prompt
|
||||||
@ -132,7 +138,7 @@ def getpass(prompt='Enter password: ', secondPrompt='Re-enter password: '):
|
|||||||
password = getPass(prompt)
|
password = getPass(prompt)
|
||||||
secondPassword = getPass(secondPrompt)
|
secondPassword = getPass(secondPrompt)
|
||||||
if password != secondPassword:
|
if password != secondPassword:
|
||||||
output('Passwords don\'t match.')
|
output(_('Passwords don\'t match.'))
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
return password
|
return password
|
||||||
|
Loading…
Reference in New Issue
Block a user