Hello there
The LanguageAppService gives us a possibility to edit a language text:
public async Task UpdateLanguageText(UpdateLanguageTextInput input)
But why is there no Create?
public async Task CreateLanguageText(CreateLanguageTextInput input)
I guess there is a very good reason for that that I missed, so please hit me in the head with that explenation!
I'm asking because we need to dynamically create translatable language texts from the GUI to be used in the application. We are creating forms with 1..N inputs with labels, and these labels must be translatable. I thought I would be able to use the language DB in Zero and just create then through API but am I right that I need to implement a separate DB for this?
Solution: Asp.Net Zero angular+webapi
6 Answer(s)
-
0
Related https://github.com/aspnetzero/aspnet-zero-core/issues/1827
-
0
If there is no dynamic situation here, you don't need to have the CreateLanguageText function.
You can use abp's Language Text database, Refresh the cache after you create a new Language Text.
-
0
We need to dynamically create the language texts.
@maliming: Do you mean to work directly to the database and insert string that way?
-
0
Use
IRepository<ApplicationLanguageText, long>
to dynamically add new text, remember to refresh the cache. -
0
Hi maliming,
We also need to add new text dynamically. Could you please let us know how to refresh the Cache in the Code.
**"Use IRepository<ApplicationLanguageText, long> to dynamically add new text, remember to refresh the cache. **"
-
0
hi mahendra
But I think the framework will automatically update the cache, you can try it.
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/552c0240c44d9899c1209fb20eb48d35b17d5e54/src/Abp.Zero.Common/Localization/MultiTenantLocalizationDictionaryCacheHelper.cs#L16
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/552c0240c44d9899c1209fb20eb48d35b17d5e54/src/Abp.Zero.Common/Localization/MultiTenantLocalizationDictionaryCacheCleaner.cs#L11