Attn! This post explains a problem with solution, for future self reference. This is not a question nor a bug report.
Using .resx resource files for localizing is a good choice of tool. We’re using it on multiple products in the dependency chain. Works very well.
But some problems in the “young IL2CPP” compilers world. Latest hit off the track: switching CultureInfo.CurrentCulture
does not change the values returned from the resource managers.
Why? To begin the bug hunting, first clue is that the resource manager can not locate the specified value among the different satellite resource assemblies, so it always returns the value from the base assembly, i.e. the “unspecified language” resource value.
With lots of research I found many ugly (and very old) workarounds. Then when I found the solution, I realized it stared me in the eyes from the documentation. Was not obvious (to me ok, cut me s lack), but it was there. Was upon a step back, rubber duck session, that I saw it.
Reason: The satellite assemblies did not even get loaded into the built product when building with IL2CPP, as opposed to when it did when building with Mono. The IL2CPP does a lot more code stripping than Mono.
The resources are not referenced in the code, they’re loaded on request via reflection! Huh! And what do we do with stuff loaded via reflection? Just add them to the linker!
Boom bam. Big phew.
Still experiencing trouble with using multiple extra languages via multiple satellite assemblies. They gotta have correct naming to work such as “baseAssemblyName.resources.dll”, which collides when using multiple languages as the language code can not be added to the name, but they can’t have the same name…
PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Net_Standard_2_0_Project.resources.dll included for the current platform.
OH WELL Cant have everything. Getting one bonus language is enough for me to begin with!
Maybe I should report the assembly name thing as a bug report… Nah maybe after easter