Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Changing default Culture/Language #6299


User avatar
0
martin created

I read through https://aspnetboilerplate.com/Pages/Documents/Localization which gives some insight to how languages/culture are handled in ASP.NET Zero

At ..Migrations.Seed.Host.DefaultLanguagesCreator I changed new ApplicationLanguage(tenantId, "en", "English", "famfamfam-flags us"), to new ApplicationLanguage(tenantId, "en-AU", "English", "famfamfam-flags au"),

At ..Migrations.Seed.Host.DefaultSettingsCreator I changed AddSettingIfNotExists(LocalizationSettingNames.DefaultLanguage, "en"); to AddSettingIfNotExists(LocalizationSettingNames.DefaultLanguage, "en-AU");

Finally I changed the default Localization XML file <localizationDictionary culture="en"> to <localizationDictionary culture="en-AU">

These changes ensure that all localized tags now display correctly and not with the [] characters. Is this enough to ensure when I migrate the solution to Azure or similar it will work correctly ? The rationale behind this is the US date format will cause a LOT of grief for our customers and since this will be a domesitic product initially it is better if I remove the US option at least for now.

If these changes are correct I could someone who works for ASP.NET Zero please consider adding chaning the default language as a tutorial ? Also it might be a good idea to also add a section on how to add a new language. As ASP.NET Zero becomes more popular I think there will be more non-American developers who will need to want to do this. That or at least add a en-UK language since most Commonwealth nations use the UK date format.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    You can also add an en-AU language instead of modifying en. Then set en-AU to the default language.

    This document may also be helpful to you. https://aspnetboilerplate.com/Pages/Documents/Zero/Language-Management

  • User Avatar
    0
    martin created

    Thanks for the prompt response.