Ah, I see what I did wrong, thank you for the screenshot! I’d set the base language to English and the target to Serbian, so i was trying to translate from English into Serbian instead of the other way around. I’ve now corrected the base to Serbian, and it is working. Thanks for help, Maliming.
hi
The purpose is to have a translation in Serbian for all our users (tenants) for abp resources. For example the Switch button on the login page.
This is two tables in Host:
In AbpLanguages i have this two:
In AbpLanguageTexts I translated them directly in the app as a Host using Language Management
AbpLanguageTexts for tenants are empty.
I understood that MyDynamicResourceLocalizer will translate everything from host to tenants and that when i login as a tenant we have it translated from host AbpLanguageTexts and this works but it doesn't translate everything using MyDynamicResourceLocalizer.
You can test like this:
Create new app in studio Multitenant, separate database, public web to use redis, add two language english and serbian latin
Login as host, translate switch button using Language Management Create two tenants, and check if switch button is translated.
Ok i hope i describe it now good :-)
Thx.
I have already asked a similar question before: #6471
And this is now a continue because I noticed that something is wrong and I need help. I noticed that MyDynamicResourceLocalizer does not translate all the translations for the tenants and that it translates differently for each tenant. The Switch button on the login page is mostly not translated. In the pictures you will see that for Host everything is translated in Language Text, and when I create tenant, MyDynamicResourceLocalizer it doesn't translate everything. This is for Abp framework translation that dosen exist in Srebian language - not lozalization that we create in our app.
Host:
Video Switch button when i change tenant: https://streamable.com/9fa6hw
This is our MyDynamicResourceLocalizer:
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.LanguageManagement;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
namespace Horizont.Web
{
[Dependency(ReplaceServices = true)]
public class MyDynamicResourceLocalizer : DynamicResourceLocalizer
{
public MyDynamicResourceLocalizer(
IServiceScopeFactory serviceScopeFactory,
IDistributedCache<LanguageTextCacheItem> cache)
: base(serviceScopeFactory, cache)
{
}
protected override LanguageTextCacheItem CreateCacheItem(LocalizationResourceBase resource, string cultureName)
{
var cacheItem = new LanguageTextCacheItem();
using (var scope = ServiceScopeFactory.CreateScope())
{
var currentTenant = scope.ServiceProvider.GetRequiredService<ICurrentTenant>();
using (currentTenant.Change(null))
{
var texts = scope.ServiceProvider
.GetRequiredService<ILanguageTextRepository>()
.GetList(resource.ResourceName, cultureName);
foreach (var text in texts)
{
cacheItem.Dictionary[text.Name] = text.Value;
}
}
}
return cacheItem;
}
}
}
"Culture": "sr-Latn",
Did I do it right or do I need to adjust something else? Thank you.
LeptonX Side Menu Does Not Load Collapsed State on Page Load
The left side menu always appears open when a page is loaded, even if the user had previously collapsed it. It seems the value from local storage (lpx:side-menu-state) is not being read and applied during initialization.
Every time the page is opened or refreshed, the side menu is displayed in the expanded state, regardless of the previously saved preference.
I created a new project using:
ABP Framework version: 9.2.1 LeptonX Theme version: 4.2.1 MVC / Razor Pages
The same issue occurs in a clean setup.
Fixed in 9.2.2 thx :-)
Issue with Actions Button Disappearing When Using ColReorder in DataTable
Hi
I’m experiencing an issue where the actions button disappears when the ColReorder extension is included in the DataTable.
I added the following scripts, as they were not initially included:
<script src="https://cdn.datatables.net/colreorder/2.0.4/js/dataTables.colReorder.js"></script> <script src="https://cdn.datatables.net/colreorder/2.0.4/js/colReorder.bootstrap5.js"></script>
Additionally, I enabled ColReorder in the DataTable configuration: colReorder: true,
this happend: video
However, after doing this, the actions button disappears. Could you check what might be causing this issue?
Also, would it be possible to include ColReorder support in future package updates?
Thank you!
Best regards
Hi,
I didn’t think about that option 😊. I’ll definitely give it a try!
Thanks!
Yes thx, just a bit of additional context: I didn’t fully implement Mailming’s approach with filtering at the DbContext level. Instead, I applied the filtering directly on the page where it’s needed. This approach avoids reloading the page every time the user switches the organization. Instead, I dynamically filter the data table and other relevant elements, which works great for our needs.
In terms of business logic, when a new tenant is created, the user needs to create an Organization Unit and assign users or roles to it before they can proceed with their work. Typically, this setup happens only once when the application is first configured and is rarely changed after.
I am having the same issue.
Hi,
Thank you for your response regarding the use of event handlers to refresh the Redis cache during CRUD operations on Organization Units. Your guidance has been helpful, and our backend implementation works perfectly now.
However, I realize that I didn’t fully explain the JavaScript-related part of my initial question. While I briefly mentioned JavaScript alongside C#, I was hoping to also receive some advice on how to handle UI updates dynamically on the front end.
In application, we have a toolbar icon that displays all Organization Units the user has permission to access. Inspired by Maliming's approach (Switching Between Organization Units), we’d like to ensure this UI element is updated dynamically when we add users or roles to Organization Units.
Specifically, we need following:
Is there a way to refresh this toolbar icon using JavaScript without requiring a full page reload?
If the above is not possible, is it possible to trigger a full page reload via JavaScript whenever we add or remove user or roles to Organization Units?
For example, using mechanisms like createModal.onResult() or listening for events such as $("#Form").abpAjaxForm().on('abp-ajax-success').
Any suggestions or recommendations for handling this functionality in line with ABP Framework best practices would be greatly appreciated.
If none of the above approaches are possible, we’ll simply explain to our end users that they need to press F5 to reload the page after adding users or roles. 😊
Thank you once again for your support.
I need guidance on implementing service calls (in either C# or JavaScript) to refresh the Redis cache via a custom service during CRUD operations on Organization Units. Specifically, I want to ensure that the cache is updated whenever:
An Organization Unit is created, updated, or removed. Users or Roles are added to or removed from an Organization Unit.
Additionally, I need a solution that allows me to call this service on submit, ensuring that it is triggered regardless of the specific operation or context (e.g., adding/removing users or roles, modifying organization unit details, etc.).
What would be the best approach to create such service calls?
I would appreciate explanations, examples, or references to relevant resources to implement this solution effectively.
Thanks.