- 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)
-
0
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.
-
0
-
0
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.
-
0
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.
-
0
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.
-
0
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