locked
EF default internationalization RRS feed

  • Question

  • User1830143703 posted

    Hi guys, sorry for boddering but after few hours of serching the internet for a loggical solution I've finnaly surrenderd and thought that you could help me.

    The problem is that when I run my app locally filds are translated (the default asp .net EF model translation), as shown below on the image are corrent depending on my culture info pl-PL. But after pasting my project on production serwer languge of the text is always in English... shown below. Other texts that are not auto but using resuorces files work fine. When I change the culture info the language changes - only the default translation are not correct...

    Oh and meybe thats important too: locally when I change to EN texts are also correct (in English). I've copied all files that are in my bin folder to the production server.

    Image link

    Tuesday, January 9, 2018 12:45 PM

All replies

  • User-832373396 posted

    Hi Lacrim,

    But after pasting my project on production serwer language of the text is always in English<g class="gr_ gr_82 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation multiReplace" id="82" data-gr-id="82">..</g>

    Sir, I guess that your production server 's languge is English.  So you hope people who in Japan view the site could get the default language( "pl-PL", not English).

    I am not sure your code looks like, but please add this code, it will fix your current question, to set default client language  when custom view your site the first time;

    For example: 

    You want  pl-PL as default language :

    Then add it in <g class="gr_ gr_986 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="986" data-gr-id="986">RouteConfig,</g> or  global file; 

    public class RouteConfig
        {
            public static void RegisterRoutes(RouteCollection routes)
            {
                routes.IgnoreRoute("{resource}.axd/{*pathInfo}");    
                Thread.CurrentThread.CurrentCulture = new CultureInfo("pl-PL");
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("pl-PL");   

    Reference:

    Thread https://forums.asp.net/post/6178375.aspx 

    With regards, Angelina Jolie

    Wednesday, January 10, 2018 6:09 AM
  • User1830143703 posted

    I'm doing what You wrote above... the languge which the user is using is viewed on screen but regarding the correct languge and manual language change only the translations being in my resources file are used. I'm writing only about default translations like 'required' filed. 

    Wednesday, January 10, 2018 10:19 AM
  • User-832373396 posted

    Hi Lacrim,

    but regarding the correct <g class="gr_ gr_14 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="14" data-gr-id="14">languge</g> and manual language <g class="gr_ gr_15 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="15" data-gr-id="15">change</g> only the translations being in my resources file are used. I'm writing only about default translations like 'required' filed. 

    Sorry, but I can't imagine your real requirement, could you tell me your current code, or what steps I can do for you.

    I'm writing only about default translations like 'required' filed.

    and I guess that you mean that to select the default translation. 

    if so, I recommend this <g class="gr_ gr_578 gr-alert gr_gramm gr_hide gr_inline_cards gr_run_anim Style multiReplace replaceWithoutSep" id="578" data-gr-id="578">http://afana.me/archive/2011/01/14/aspnet-mvc-internationalization.aspx/</g><g class="gr_ gr_578 gr-alert gr_gramm gr_hide gr_inline_cards gr_disable_anim_appear Style multiReplace replaceWithoutSep replaceWithoutSep" id="578" data-gr-id="578"> ,</g> it tells full steps.

    Bests, 

    Jolie

    Monday, January 15, 2018 2:16 AM