Console vendors are picky when it comes to terminology. For example, for some it’s called “Rumble” and for others “Vibration”. Now I would like to avoid that the game code has to deal with a different localization string for each supported platform.
In previous projects, pre-Unity time, our localization system supported to suffix a localization string with “xbox360” or “ps3” for example and if such localization string existed, the system would pick the platform specific one. Otherwise fallback to the localization string without suffix. This allowed that a non-programmer was able to add localization strings where needed.
I’m wondering whether the localization package is providing similar functionality?
We have PlatformOverrides. They kind of work in a similar way. If an entry has a platform override metadata attached and it contains an override for that particular platform it will redirect to the alternative value instead of using the default.
You can also create your own custom overrides by implementing IEntryOverride. Platform Overrides | Localization | 1.3.2
You have the ability to override the table, entry or both.
I can’t find the Platform Override. According to the documentation, I presume I would add a new shared metadata entry, but I can’t find “Platform Override” in the list.
How can I add a platform override? I’m using Localization 1.3.2 and Unity 2021.3.11f1.
Sorry, I was away last week so missed some messages.
It looks like you are editing the table metadata, you need to edit the entry metadata. Platform overrides are done per entry, not table.
How can I “simulate” a platform in the editor? The problem for me is that in order to see the platform override texts, I have to deploy a target player. This is very very inconvenient and takes a significant amount of time.
How can I tell the Localization system that it should display texts for a particular platform? I’d prefer some kind of such API:
The Localization system should then use the specified platformOverride instead of the actual platform it’s currently running on. This would allow me to easily test all platform texts in the editor.
We do have support for this in Editor but it’s internal at the moment, used for our tests.
LocalizationSettings.Instance.Platform =
You could give yourself internal access by using an Assembly definition reference file asmref.
The plan is to provide a platform option in the scene controls in the future.
Thank you for the reply, I’ll take a look at LocalizationSettings.Instance.Platform on Monday
Regarding “scene controls”. This can still be controlled via code, I assume? Because we have various systems that depend on a simulated platform and we usually specify the simulated platform via CommandLine. Therefore it would be most useful for me to have an API for the Localization platform too.