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

How to get the current selected language from Server-Side ? #398


User avatar
0
mrvithan created

How to get the current selected language from Server-Side ?


3 Answer(s)
  • User Avatar
    0
    mrvithan created

    Solved. After running thru all source code, i found this LanguageManager !!!.

  • User Avatar
    0
    ddnils created

    Hey, I have tested

    System.Threading.Thread.CurrentThread.CurrentUICulture
    

    and LanguageManager through injection:

    private readonly Abp.Localization.LanguageManager _lanManager;
    _lanManager.CurrentLanguage
    

    both work pretty much the same for me.

  • User Avatar
    0
    hikalkan created
    Support Team

    I sugges to use LanguageManager. Say that you defined 2 languages:

    "tr-TR" "en"

    And your current thread's language is "en-US". Then LanguageManager returns "en" (because we have no en-US defined for the application). So, it may be different in this case.