arrow-py / arrow-py/arrow

Set default locale globally in app

Open
#331 2 comments 0 reactions 0 assignees View on GitHub
enhancement localization
Dominant language
Python
Stars
9.1k
Forks
784
PR merge metrics
No merged PRs in 30d

Description

It would be awesome if we could set a default locale for arrow globally. Right now it's hardcoded to `en_us` in several places in the code. If we could set a global default then it would be easier to integrate with packages like Babel and Flask-Babel.

I'm imagining an API like this:

``` python
import arrow
from .myapp.i18n import get_locale

# It can be set statically...

arrow.set_locale_default('sv_se')

# ... or dynamically like this:

def get_arrow_locale():
return get_locale().lower()

arrow.set_locale_default(get_arrow_locale)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.