Browse Source

Solving locale problems

pull/3/head
Louis 11 years ago
parent
commit
4e1b6d30dd
  1. 4
      songbook.py
  2. 1
      songbook/plastex.py

4
songbook.py

@ -36,7 +36,11 @@ def argument_parser(args):
def main(): def main():
# set script locale to match user's # set script locale to match user's
try:
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
except locale.Error as error:
# Locale is not installed on user's system, or wrongly configured.
sys.stderr.write("Locale error: {}\n".format(error.message))
options = argument_parser(sys.argv[1:]) options = argument_parser(sys.argv[1:])

1
songbook/plastex.py

@ -80,6 +80,7 @@ def parsetex(filename):
doc = SongParser.parse(filename) doc = SongParser.parse(filename)
# /* BEGIN plasTeX patch # /* BEGIN plasTeX patch
if oldlocale[0] and oldlocale[1]:
locale.setlocale(locale.LC_TIME, "%s.%s" % oldlocale) locale.setlocale(locale.LC_TIME, "%s.%s" % oldlocale)
# plasTeX patch END */ # plasTeX patch END */

Loading…
Cancel
Save