Starts in:
2 DAYS
12 HRS
31 MIN
37 SEC
Starts in:
2 D
12 H
31 M
37 S
Open Closed

Get current language in endpoint #1838


User avatar
0
Denis created

I need to get language which passed via Accept-language header to endpoint. In aspbloilerplate I used Thread.CurrentThread.CurrentUICulture . In abp it does not look working.

What way I need to apply?

  • ABP Framework version: v4.3.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can try use CultureInfo.CurrentUICulture.

  • User Avatar
    0
    Denis created

    Actually both ways work. The reasl reason is ABP comes with not default languages included into supported cultures. You need to add them into AbpLocalization yourself

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06