Open Closed

language is always fixed in browser language #7647


User avatar
0
abp1@feelaware.com created
  • ABP Framework version: v8.2.0
  • UI Type: MVC
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hello. We're using Microservice framework, .net core We have a trouble in changing language. language is always fixed in browser language. this issue occurs only in a deployment environment. In localhost, changing language works correctly.

  1. Select Fr Language in login page

  2. Log in

  3. Redirect Home with En Language

Here is web-gateway logs. I selected French and logged in, but the API is always called with English http://administration-service/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I think the 1 and 2 are the same website. but 3 is a separate website.

    1. Select Fr Language in login page
    2. Log in
    3. Redirect Home with En Language

    If you want to use the same culture on all websites, you can consider sharing the AspNetCore.Culture cookies.

    https://abp.io/community/articles/how-to-share-the-cookies-between-subdomains-jfrzggc2

  • User Avatar
    0
    abp1@feelaware.com created

    hi

    I think the 1 and 2 are the same website. but 3 is a separate website.

    1. Select Fr Language in login page
    2. Log in
    3. Redirect Home with En Language

    If you want to use the same culture on all websites, you can consider sharing the AspNetCore.Culture cookies.

    https://abp.io/community/articles/how-to-share-the-cookies-between-subdomains-jfrzggc2

    we're using microservice template. So there is separated service in each container.

    [image from https://abp.io/docs/commercial/8.1/startup-templates/microservice/index]

    1 is Auth server 2 is Web Application 3 is Web-gateway

    And they call Administration Microservice API to get language info through WEB-GATEWAY.

    I think if i change language in login page and login, it will apply in all web site and service because they call always Administration service API.

    Do I have to set cookies every time I change the language?

    Is there any other way?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will find a way, wait a sec.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have checked. There is no way to do that.

    You can share the cookies if you use sub-domain for these websites.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I'll keep working on it. If there is news, I will reply to you. : )

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/pull/20428

Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13