Ends in:
2 DAYS
11 HRS
36 MIN
58 SEC
Ends in:
2 D
11 H
36 M
58 S
Open Closed

Could not find localization source: LeptonX #4875


User avatar
0
cangunaydin created
  • ABP Framework version: v7.1.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

Hello, I am trying to understand how the localization works for the leptonx theme since i am getting the warning in my angular app 'Could not find localization source: LeptonX'

if i debug the app here you can see it tries to get the localization value from source LeptonX. But there is no such resource inside the source list.

What i wonder is, how does the angular leptonx module is taking the resource from the backend? If you create a solution from scratch with angular, it doesn't include the leptonx module inside HttpApi.Host project

shouldn't it include the localization resource so it can find it inside resources for angular app?


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

    Hi,

    I can't reproduce the problem (7.1.1).

    shouldn't it include the localization resource so it can find it inside resources for angular app?

    The localization resources are stored in the database.

    Abp will load static localization resources and dynamic localization resources(database), so it does not need to depend on Leptonx modules.

  • User Avatar
    0
    cangunaydin created

    Hello, Thanks for the reply. Is this image from "AbpLocalizationResources" Table. If it is, in my database it is empty. So I was wondering from where is this data seeded? Cause definitely it is not been stored in my database. And i use postgres instead of sql.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    So I was wondering from where is this data seeded? Cause definitely it is not been stored in my database.

    Data is saved to the database on the application startup, did you run the AuthServer project?

    Can you share a project that can reproduce the problem with me if you already did all things but still problem? shiwei.liang@volosoft.com I will check it out.

  • User Avatar
    0
    cangunaydin created

    I think i have found the solution but I couldn't understand why it behaves like it. I use docker container for postgres and redis. If I remove containers and images and compose it again, it writes to database. I still couldn't find where the data is persisted (from which section of the code).
    I was checking ILocalizationResourceContributor implementations inside the source code, can not see any data persistency. Can you post the class or line where abp store the localization resources to db?

    For my problem, I am suspicious that after some time probably i deleted the db manually and recreate it again through dbmigrator. Maybe resources stayed in the cache, but still didn't make sense why it couldn't find the resource if it is still in the cache. Cause endpoint should return to angular app if it was there.

    I can share my project, but i don't think you could reproduce the issue since you are gonna create it from scratch.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I still couldn't find where the data is persisted (from which section of the code). I was checking ILocalizationResourceContributor implementations inside the source code, can not see any data persistency. Can you post the class or line where abp store the localization resources to db?

    The language management module create the IExternalLocalizationSaver interface and uses it internally to save resources to the database.

    You can find it in the .domain project of the language management module:

    I think i have found the solution but I couldn't understand why it behaves like it.

    Yes, that's the problem, When you clear the database, you also need to clear the redis cache.

  • User Avatar
    0
    cangunaydin created

    Hello again, thanks for pointing out the code now it is more clear. What i couldn't understand is if it is in the cache, it shouldn't give any error since it is gonna return it from the cache. Anyway i am gonna close this issue, thanks for your help @liangshiwei

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35