[Solved] Translate components

2 Answers 11 Views
Localization
Román
Top achievements
Rank 1
Iron
Román asked on 12 May 2026, 01:11 PM

Hello,

I'm using Telerik.UI.for.Blazor version 7.1.0 and I'm trying to automatically translate the telerik components (specifically, a TelerikTreeList but there wil be more) following the tutorial on https://www.telerik.com/blazor-ui/documentation/globalization/localization but they are not being translated.

  • I have copied the TelerikMessages files (both the resx and the es-ES.resx) from C:\Program Files (x86)\Telerik\Telerik UI for Blazor 6.2.0\messages into my Properties folder and set them as EmbeddedResource.
  • I have implemented an ITelerikStringLocalizer class as follows:
public class TelerikLocalizer : ITelerikStringLocalizer
{
    public string this[string key] => TelerikMessages.ResourceManager.GetString(key, TelerikMessages.Culture) ?? key;
}
  • I have registered it using the following code:
services.AddSingleton<ITelerikStringLocalizer, TelerikLocalizer>();
services.AddLocalization(options => options.ResourcesPath = "Properties");
services.AddTelerikBlazor();

Finally, in my App.razor.cs class, I have set the default culture to spanish as follows:


        var newCulture = new CultureInfo("es-ES")
        {
            DateTimeFormat =
            {
                ShortDatePattern = DateTimeFormatter.ShortDateFormat,
                ShortTimePattern = DateTimeFormatter.HourFormat
            }
        };
        CultureInfo.DefaultThreadCurrentCulture = newCulture;
        CultureInfo.DefaultThreadCurrentUICulture = newCulture;
        Thread.CurrentThread.CurrentCulture = newCulture;
        Thread.CurrentThread.CurrentUICulture = newCulture;

However, when I go to the TelerikTreeList, the tooltip of pages and the number of items are still in english, as you can see in the attached image. What am I doing wrong?

Thank you for your support.

Román

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Román
Top achievements
Rank 1
Iron
answered on 13 May 2026, 09:37 AM

My fault, I have just discovered the problem. I wasn't correctly following the steps of the tutorial. In step 4, it clearly says "Register your custom Telerik localization service in Program.cs after builder.Services.AddTelerikBlazor();. The order is crucial and the Telerik components will always use the last registered localization service. If you reorder the two lines below, the components will use the default built-in English localization strings."

I was registering them in the opposite order, and after fixing that it worked.

0
Dimo
Telerik team
answered on 12 May 2026, 02:38 PM

Hi Román,

If some Telerik labels are translated, but others are not, this means that the resx files are outdated. Based on your message, they most likely are, because of the version mismatch (6.2.0 vs 7.1.0). The resx files must be updated and maintained together with the Telerik UI for Blazor version.

If no Telerik labels are translated, this suggests a general problem with the localization setup. Compare it with these localized sample apps.

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Román
Top achievements
Rank 1
Iron
commented on 13 May 2026, 09:24 AM

None of the labels are being translated, and I'm following all the steps in the tutorial. However, I cannot follow the sample apps because in the moment I call  blazorCulture javascript methods I receive the error "Could not find 'blazorCulture.get' ('blazorCulture' was undefined)."
Dimo
Telerik team
commented on 13 May 2026, 09:48 AM

blazorCulture is defined in index.html, according to Microsoft guidelines:

https://github.com/telerik/blazor-ui/blob/master/common/localization/ClientLocalizationResx/wwwroot/index.html#L32-L35

Make sure this code exists in your case and there are no other errors. Also, I made a small unrelated fix in the two localization samples, so pull the latest changes.

Tags
Localization
Asked by
Román
Top achievements
Rank 1
Iron
Answers by
Román
Top achievements
Rank 1
Iron
Dimo
Telerik team
Share this question
or