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

How can we check if provided culture is supported? #1257

Open
mastef opened this issue Mar 7, 2023 · 0 comments
Open

How can we check if provided culture is supported? #1257

mastef opened this issue Mar 7, 2023 · 0 comments

Comments

@mastef
Copy link

mastef commented Mar 7, 2023

Currently it seems that if we provide an unsupported culture to someDate.Humanize(culture: someCulture), we may get back the UI culture - which could be english instead of e.g. hindi. How can we instead check if Humanize supports the provided culture, so we could fallback to another solution - like showing the date in the unsupported culture.

LocaliserRegistry.FindLocaliser seems to be private, and also returns _defaultLocaliser if not found.
LocalizerRegistry.ResolveForCulture falls back to CultureInfo.CurrentUICulture.

Maybe a bool isSupported(culture) method would be nice.

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

1 participant