diff --git a/transcriptic.py b/transcriptic.py index ec3796f..f49f975 100644 --- a/transcriptic.py +++ b/transcriptic.py @@ -2,10 +2,16 @@ import json from os.path import expanduser import locale +import os import click import requests +if os.name == 'posix': + loc = 'en_US.UTF-8' +else: + loc = 'usa_usa' + class Config: def __init__(self, api_root, email, token, organization): @@ -147,7 +153,7 @@ def count(thing, things, num): result = response.json() count("instruction", "instructions", len(result['instructions'])) count("container", "containers", len(result['refs'])) - locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') + locale.setlocale(locale.LC_ALL, loc) click.echo(" %s" % locale.currency(float(result['total_cost']), grouping=True)) for w in result['warnings']: