You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your language is not EN or FR (for example: NL), the system falls back to the default About.resx and Global.resx. About.razor assumes a specific formatting for a language in the resource called "cultures":
@foreach (var cultureItem in Localizer["cultures"].ToString().Split(';'))
{
var c = cultureItem.Split(',');
<Panel Color="secondary-300" Flat>
<Button OnClick="@(() => SetCulture(c[0]))">@c[1]</Button>
</Panel>
}
Unfortunately, About.resx contains the following content for "cultures":
cultures
There is no comma, therefore the var c = cultureItem.Split(',') yields a 1-sized array and c[1] fails.
Unhandled exception rendering component: Index was outside the bounds of the array.
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Elia.HappyFlow.Client.Pages.About.<>c__DisplayClass0_0.<BuildRenderTree>b__9(RenderTreeBuilder __builder6) in C:\PRJ\Demo\HappyFlow\FE\Client\HappyFlow.Client\Pages\About.razor:line 34
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Nova.Components.Button.<BuildRenderTree>b__0_0(RenderTreeBuilder __builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at Nova.Components.NovaBaseComponent.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
Two options:
set the value to a properly formatted language like in the other fields
make the code in About.razor more robust.
The text was updated successfully, but these errors were encountered:
If your language is not EN or FR (for example: NL), the system falls back to the default About.resx and Global.resx.
About.razor
assumes a specific formatting for a language in the resource called"cultures"
:Unfortunately,
About.resx
contains the following content for"cultures"
:There is no comma, therefore the
var c = cultureItem.Split(',')
yields a 1-sized array andc[1]
fails.Two options:
About.razor
more robust.The text was updated successfully, but these errors were encountered: