Open 2br-2b opened 3 weeks ago
Would something like this work for you?
diff --git a/src/humanize/i18n.py b/src/humanize/i18n.py
index 42447b0..c4ca274 100644
--- a/src/humanize/i18n.py
+++ b/src/humanize/i18n.py
@@ -71,6 +71,9 @@ def activate(
Raises:
Exception: If humanize cannot find the locale folder.
"""
+ if locale and locale.startswith("en"):
+ locale = None
+
if path is None:
path = _get_default_locale_path()
Yes, this seems to fix the issue for me! Thank you so much!
Great, would you like to put together a PR?
Sure thing! I'll have to do that after the weekend though - I've been working on this while procrastinating on my Ludum Dare game 😅
No rush at all :) Have fun with Ludum Dare!
What did you do?
Hello! Thank you so much for making this library!!!
I'm using this to bot to translate some strings for my python discord bot. To do that, I am mapping discord locales to Humanize strings, like so:
I wish I could also map British English and American English to
en_US
anden_GB
instead of setting them toNone
, then doing a None check whenever I get the locale.Especially since
en_GB
is listed as an example locale at the bottom of the Readme, I wish this was an optionPlease include code that reproduces the issue.