What is system.globalization And what's the difference between it and localization

后端 未结 3 1917
眼角桃花
眼角桃花 2021-01-02 18:45

and to spice things a bit , what is the best approach for globalization in Asp.net Mvc App

3条回答
  •  自闭症患者
    2021-01-02 19:21

    The System.Globalization namespace contains classes that define culture-related information, including the language, the country/region, the calendars in use, the format patterns for dates, currency, and numbers, and the sort order for strings.

    As for what's the difference between it and localization? I guess that can be explained as the difference between a car and a city. One is a destination and the other is how you get there.

    I haven't used ASP.NET MVC, but I have used Monorail which is similar. If I wanted to localize a MR app, I would probably use a separate tree of view files. So while, for english-only, I'd have:

    \Views\Home\*.asp
    \Views\Admin\*.asp
    \Views\Products\*.asp
    

    for an internationalized app, I'd have something like:

    \en\Views\Home\*.asp
    \en\Views\Admin\*.asp
    \en\Views\Products\*.asp
    \de\Views\Home\*.asp
    \de\Views\Admin\*.asp
    \de\Views\Products\*.asp
    \es\Views\Home\*.asp
    \es\Views\Admin\*.asp
    \es\Views\Products\*.asp
    

提交回复
热议问题