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

Localization support .NET 5 PiranhaCMS #1953

Open
hainguyen0011 opened this issue Nov 4, 2022 · 0 comments
Open

Localization support .NET 5 PiranhaCMS #1953

hainguyen0011 opened this issue Nov 4, 2022 · 0 comments

Comments

@hainguyen0011
Copy link

I'm new to this CMS library. I'm using .NET 5 and doing the localization. I write some code to change the culture like:

            CultureInfo ci = new(culture);
            CultureInfo.DefaultThreadCurrentCulture = ci;
            CultureInfo.DefaultThreadCurrentUICulture = ci;

It worked when I use my resources files "resources.en-US.resx" or "resources.vi-VN.resx" (I set new supported CultureInfo "en-US" and "vi-VN") but when I change resources files in Piranha.Manager.Localization from "General.vi.resx" to "General.vi-VN.resx"(for matching the culture format) it did not work anymore.
And if I set new supported CultureInfo to "en" and "vi" (for matching with resources files in Piranha.Manager.Localization) it still not works.

services.Configure<RequestLocalizationOptions>(
                opt =>
                {
                    var supportedCultres = new List<CultureInfo>
                    {
                        new CultureInfo("en"),
                        new CultureInfo("vi")
                    };
                    opt.DefaultRequestCulture = new RequestCulture("en");
                    opt.SupportedCultures = supportedCultres;
                    opt.SupportedUICultures = supportedCultres;
                });

I don't know what I'm doing is right way to setup localization for piranha or not? I can't find any tutorial for that.
Can you help me for localization for PiranhaCMS?
I really appreciate that.
Best Regard

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