Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Getting error message JsonFileList is required in Client WASM mode #130

@JerseyTechGuy

Description

@JerseyTechGuy

I have a Blazor App already using localization. It is a Wasm app with an API backend.
I already had both French and English resx files in the Resources folder. Was configured in the Program.cs as follows.
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources")

I created a new json file called localization in the Resources folder.
Added the following to the program.cs in place of the above code.

            builder.Services.AddJsonLocalization(options => {
                options.CacheDuration = TimeSpan.FromMinutes(60);
                options.ResourcesPath = "Resources";
                options.SupportedCultureInfos = new HashSet<CultureInfo>()
                {
                    new CultureInfo(GlobalConstants.Localization.Culture.US_English),
                    new CultureInfo(GlobalConstants.Localization.Culture.CA_French)
                };
            });

The error I am getting is JsonFileList is required in Client WASM mode. I assume this is because it is not finding any json files? Any help you could provide diagnosing would be appreciated. I did check the json file and it is marked as an EmbeddedResource as was the Resx files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions