Locale overrider support
See original GitHub issueFeature request
Thesis
So, the idea is very simple - use context manager to temporarily override current locale for provider’s instance, just like that:
>>> from mimesis import Person
>>> from mimesis import locales
>>> person = Person(locales.EN)
>>> person.full_name()
'Ozie Melton'
>>> with locales.override(person, locales.RU):
... person.full_name()
'Симона Богданова'
>>> person.full_name()
'Waldo Foster'
Reasoning
Sometimes we need only some data from other provider and creating an instance each time is not really good, so it’s better just override locale.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Locale Override | Drupal.org
The Locale Override module provides a very simple user interface to store translated user interface strings as config entities.
Read more >Locale - ArchWiki
Overriding system locale per user session. The system-wide locale can be overridden in each user session by creating or editing ...
Read more >Is Rider overriding how the culture is being determined?
When running a dotnet app (.NET 5 on the Mac) via Rider's terminal, it appears to be overriding how the culture is determined....
Read more >JDK 11 Supported Locales - Oracle
Language (ISO 639) Coun (ISO 3166) Script (ISO 15924) Language Tag
Albanian (sq) Albania (AL) (Latn) sq‑AL
Arabic (ar) Algeria (DZ) (Arab) ar‑DZ
Arabic (ar) Bahrain...
Read more >Add support for locale override for special languages · Issue #53 ...
First case is Sardinian ("sc") locale which we got fully translated for Telegram, but it cannot be used since Ubuntu does not allow...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agree 👍
Why not? Seems like an easy feature.