Blazor used to not have official Localization support (which can help us for tasks like having an app in several languages), so we used libraries like Toolbelt.Blazor.I18nText to have multi-language support. Although this is no longer necessary, since new versions of Blazor have official Localization support, some applications are already made with Toolbelt.Blazor.I18nText anyway.
A recurring problem that some people may encounter with Toolbelt.Blazor.I18nText is that JSONs that contain special characters, such as the ñ and accent marks, appear with errors.
The error is due to encoding of JSON files. Here is the solution:
– Open the JSON that has the error in Visual Studio
– Go to File> Save {File name} as …
– Click Save with Encoding:
– Say you want to replace the file
– Select the appropriate encoding for your situation. In my case I have solved the problem with “Unicode (UTF-8 with signature)“.
That’s it!
Course
If you want a course where we develop a Blazor project step by step from scratch to production, purchase my course today:
https://www.udemy.com/course/programming-in-blazor-aspnet-core/?referralCode=8EFA9D9FF38E3065DF0C
Regards!