Using Python locale or equivalent in web applications?

前端 未结 4 577
天命终不由人
天命终不由人 2021-02-02 03:36

Python\'s locale implementation seems to want to either read the locale from system settings or have it be set via a setlocale call. Neither of these work for me since I\'d like

4条回答
  •  别那么骄傲
    2021-02-02 04:01

    Your best approach will be to setlocale on the locale that the browser passes you, if you're doing currencies, dates, and numbers. There's a lot of zomgz warnings in the Python documentation for really off-color platforms; most of these can be ignored.

    "Frequent locale changes" shouldn't matter, unless I'm missing something.

    You're not doing message catalogs or anything fancy, so stick with what Python gives you.

提交回复
热议问题