[Feature Request] Support changing the locale in a initiated Faker instance.
- Dominant language
- Python
- Stars
- 19.4k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
If I wanted to access the italian locale instead of the english US locale, I would have to re-initiate or create a new instance of Faker by passing `it_IT` as the locale parameter.
```python
f = Faker('en_US')
print(f.name())
f = Faker('it_IT')
print(f.name())
```
But why not we just do:
```python
f = Faker('en_US')
print(f.name())
f.set_locale('it_IT)
print(f.name())
```
It's just convenient I believe.
Contributor guide
Research direction
No file or test is named in the issue. Start by locating the Faker instance API that handles the constructor locale and checking how locale state is stored. Add a supported way to change an existing instance from en_US to it_IT, then verify that subsequent provider output uses the selected locale and that existing initialization behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100