Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect language with only core #1521

Open
Martin12350 opened this issue Jun 24, 2024 · 3 comments
Open

Incorrect language with only core #1521

Martin12350 opened this issue Jun 24, 2024 · 3 comments

Comments

@Martin12350
Copy link

I have installed NuGet Humanizer.Core, I would expect that all the results will be in English (as said in the readme).
Yet, when I call this:

DateOnly now = DateOnly.FromDateTime(DateTime.Today);
string myText = now.ToOrdinalWords();

I will get it in my native language.

image

First of all things, I am not sure where it is taking the language, but more importantly, there is no overload to specify culture info or language.

Any suggestions would be appreciated.

@hangy
Copy link
Contributor

hangy commented Jul 29, 2024

If there's no overload that takes a culture (it's not super consistent right now), then the current culture CultureInfo.CurrentCulture is used. If you need a specific language, and there's no overload for a culture, then you probably have to (temporarily) change the current culture of the Thread

@Martin12350
Copy link
Author

Good to know. It would be nice if it would be consistent and accept the culture, or at least mention it in the doc.
But I am still surprised it found the words when only the core is installed.
If I had set my PC to, e.g., Korean language, would it find the date in Korean format? ;)

@hangy
Copy link
Contributor

hangy commented Aug 6, 2024

It would probably be better if support for passing a culture parameter was more consistent. 😄 #1269 also, correctly, requests something along that line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants