I recently delved into localization with .NET. Essentially, I learned how to set up a form (using the Language and Localizable property), and then change the culture accordingly.
However, I found that when transferring my hard-coded English strings to files of automatically generated files and using .GetString ("Key") - well, just say that it was not enough: P.
I decided to create a separate set of resx files designed exclusively for lowercase encoded strings. They complied with the agreement / requirement [name]. [Code-Culture] .resx. I did this for each appropriate language; e.g. appstrings.de.resx (for German) and appstrings.resx (as the invariant baseline).
To use these new resources, I created an instance of ResourceManager and Resource Set
Dim resManager As New ResourceManager("LanguageTest.appstrings", Assembly.GetExecutingAssembly) Dim resSet As ResourceSet = resManager.GetResourceSet(My.Application.UICulture, True, True)
The current UI culture has been set (e.g. to German) using
My.Application.ChangeUICulture("de")
Original issue
If resSet.GetString ("Key") is explicitly defined in appstrings.de.resx , it will return an empty string. In any case, can I make this a backup appstrings.resx application (where "Key" really exists), which I assumed would be the default base base?
Update
Rhapsody made the suggestion below, while the actual tip itself did not work, it did trigger an interesting point using resManager.GetString ("Key") rather than resSet.GetString ("Key"). At the moment, it works without errors. That is, the values ββpresented in the specialized language file are returned, and the "missing" values ββare returned to the default culture when accessing one key.
Subsequent problem
The only remaining issue is whether the performance impact of using the ResourceManger, unlike the cached ResourceSet, will be so harmful?