How to disable Localization (ISyncfusionStringLocalizer error

Hello,
As I'm preparing to implement this great control (a life-saver by the way), I have a problem linked to localization. I haven't specified anything that would call for localization (no formatting specified, locale hardcoded to en-US), but I get the error:

Cannot provide a value for property '_localizer' on type 'Syncfusion.Blazor.Grids.SfGrid`1[[IIQ_blazor.Shared.Models.Job, IIQ_blazor.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'. There is no registered service of type 'Syncfusion.Blazor.ISyncfusionStringLocalizer'.

For now I would just like to disable localization, but can't find a way to. Is there any solution?

This is my first time using syncfusion so there is no upgrade issues, I'm using latest .net 5 for blazor, using latest nuget packages for Syncfusion.

3 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team December 24, 2020 10:09 AM UTC

Hi Davin, 

Greetings from Syncfusion support. 

We suggest you to ensure to add the below code in your application to overcome the reported problem, 

[Startup.cs] 
 
public void ConfigureServices(IServiceCollection services) 
{ 
    ... 
    services.AddSingleton<WeatherForecastService>(); 
    services.AddSyncfusionBlazor(); 
} 


Please configure your application by referring our getting started documentation below, 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer

SH Shravya October 21, 2021 09:17 AM UTC

This didn't resolve my issue. Is it compulsory to create an interface and implement the methods?


My error:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]

      Unhandled exception rendering component: Cannot provide a value for property '_localizer' on type 'Syncfusion.Blazor.Grids.SfGrid`1[[PricingRequestApp.Shared.Quote, PricingRequestApp.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'. There is no registered service of type 'Syncfusion.Blazor.ISyncfusionStringLocalizer'.

System.InvalidOperationException: Cannot provide a value for property '_localizer' on type 'Syncfusion.Blazor.Grids.SfGrid`1[[PricingRequestApp.Shared.Quote, PricingRequestApp.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'. There is no registered service of type 'Syncfusion.Blazor.ISyncfusionStringLocalizer'.

  at Microsoft.AspNetCore.Components.ComponentFactory+<>c__DisplayClass5_0.<CreateInitializer>g__Initialize|2 (System.IServiceProvider serviceProvider, Microsoft.AspNetCore.Components.IComponent component) <0x3c857c0 + 0x000e6> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.ComponentFactory.PerformPropertyInjection (System.IServiceProvider serviceProvider, Microsoft.AspNetCore.Components.IComponent instance) <0x3c67428 + 0x00066> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.ComponentFactory.InstantiateComponent (System.IServiceProvider serviceProvider, System.Type componentType) <0x3c666d0 + 0x00050> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateComponent (System.Type componentType) <0x3c65708 + 0x00014> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.Renderer.InstantiateChildComponentOnFrame (Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame& frame, System.Int32 parentComponentId) <0x3f3d638 + 0x0005c> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewComponentFrame (Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder+DiffContext& diffContext, System.Int32 frameIndex) <0x3f3d4c0 + 0x00054> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InitializeNewSubtree (Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder+DiffContext& diffContext, System.Int32 frameIndex) <0x3f3d238 + 0x0007e> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.InsertNewFrame (Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder+DiffContext& diffContext, System.Int32 newFrameIndex) <0x3f3cf28 + 0x000bc> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange (Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder+DiffContext& diffContext, System.Int32 oldStartIndex, System.Int32 oldEndIndexExcl, System.Int32 newStartIndex, System.Int32 newEndIndexExcl) <0x3f3c398 + 0x0049c> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ComputeDiff (Microsoft.AspNetCore.Components.RenderTree.Renderer renderer, Microsoft.AspNetCore.Components.Rendering.RenderBatchBuilder batchBuilder, System.Int32 componentId, Microsoft.AspNetCore.Components.RenderTree.ArrayRange`1[T] oldTree, Microsoft.AspNetCore.Components.RenderTree.ArrayRange`1[T] newTree) <0x3f32400 + 0x00094> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch (Microsoft.AspNetCore.Components.Rendering.RenderBatchBuilder batchBuilder, Microsoft.AspNetCore.Components.RenderFragment renderFragment) <0x3f2c148 + 0x000aa> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch (Microsoft.AspNetCore.Components.Rendering.RenderQueueEntry renderQueueEntry) <0x3f2bb48 + 0x0004c> in <filename unknown>:0

  at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue () <0x3f29048 + 0x00098> in <filename unknown>:0

mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28



RS Renjith Singh Rajendran Syncfusion Team October 22, 2021 08:47 AM UTC

Hi Shravya, 

We are not clear about the exact scenario your are facing this reported problem. We suggest you to ensure to refer the below documentation for applying localization for Grid. Please refer and follow the procedures in the below documentation for more details on applying localization in Grid. 

We have also prepared a working sample for your convenience, please download and refer the sample from the link below, 
 
If you are still facing difficulties then the following details would be helpful for us to further proceed on this, 

  1. Share the sample which you have tried from your side.
  2. Or if possible reproduce the reported problem with the above attached sample and share with us for further analysis.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

References :  

And also, we suggest you to refer the below github link for the available resx files. We have already listed the available translation text for our controls in below github link. 

Regards, 
Renjith R 


Loader.
Up arrow icon