Fix gettext invocation, and set text domain (fixes #7800)
This commit is contained in:
parent
c563543dea
commit
4114ef699d
@ -22,7 +22,9 @@ import random
|
|||||||
import binascii
|
import binascii
|
||||||
import gettext
|
import gettext
|
||||||
|
|
||||||
_ = gettext.gettext
|
_ = lambda msg: gettext.dgettext('sugar-toolkit', msg)
|
||||||
|
_ngettext = lambda msg1, msg2, n: gettext.dngettext('sugar-toolkit', msg1, msg2, n)
|
||||||
|
|
||||||
|
|
||||||
def printable_hash(in_hash):
|
def printable_hash(in_hash):
|
||||||
"""Convert binary hash data into printable characters."""
|
"""Convert binary hash data into printable characters."""
|
||||||
@ -228,8 +230,8 @@ def timestamp_to_elapsed_string(timestamp, max_levels=2):
|
|||||||
if levels > 0:
|
if levels > 0:
|
||||||
time_period += COMMA
|
time_period += COMMA
|
||||||
|
|
||||||
time_period += gettext.ngettext(name_singular, name_plural,
|
time_period += _ngettext(name_singular, name_plural,
|
||||||
elapsed_units) % elapsed_units
|
elapsed_units) % elapsed_units
|
||||||
|
|
||||||
elapsed_seconds -= elapsed_units * factor
|
elapsed_seconds -= elapsed_units * factor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user