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 to set the default language? #723

Closed
Nokecy opened this issue Jan 9, 2019 · 5 comments
Closed

How to set the default language? #723

Nokecy opened this issue Jan 9, 2019 · 5 comments

Comments

@Nokecy
Copy link
Contributor

Nokecy commented Jan 9, 2019

No description provided.

@maliming
Copy link
Member

My current practice:

var defaultLanguage = app.ApplicationServices.GetService<ISettingDefinitionManager>().Get(LocalizationSettingNames.DefaultLanguage);
app.ApplicationServices.GetService<DefaultValueSettingValueProvider>().SetAsync(defaultLanguage, "zh-Hans", null);

@Nokecy
Copy link
Contributor Author

Nokecy commented Jan 11, 2019

@maliming 谢谢

@Nokecy Nokecy closed this as completed Jan 11, 2019
@maliming
Copy link
Member

For the 0.14.0 version you can use a code similar to the following to modify.
app.ApplicationServices.GetService<ISettingDefinitionManager>(). Get(LocalizationSettingNames.DefaultLanguage).DefaultValue = "zh-Hans";

@wakuflair
Copy link
Contributor

wakuflair commented Feb 28, 2019

Note: do not forget to clear browser cookie after setting the default language.

@yimogit
Copy link
Contributor

yimogit commented Mar 23, 2019

Get master branch(0.15.0) samples/Acme. BookStore and set the default language to zh-Hans. I didn't find the right way.
Now should be how to set up?
I hope I can get help.

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

4 participants