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.
I’m using metadata platform overrides and I wonder if there is now support to override the “localization platform” and how I would do it? I would need this functionality in both, editor and player.
Most recent case I ran into: The “Username” column header in a Leaderboard screen should display “Gamertag” when targeting GameCore (Windows/Xbox) and in other stores/platforms just “Name”.
Hi,
Unfortunatly we still dont have this support. Ill add it to out backlog as a seperate task so we can look at it sooner.
Would this be what we discussed earlier, the ability to override the platform, similiar to LocalizationSettings.Instance.Platform?
This was introduced in version 1.5.5. However, rather than making the API public, we added support through the Device Simulator. Changing the platform in the Device Simulator will also update the localization system accordingly.
The Device Simulator supports only a limited number of platforms. If you still need direct access to the API, you can use reflection or create an assembly reference (asmref) named Unity.Localization to access the internal property:
LocalizationSettings.Instance.Platform
We are also working on some big changes in 6.7. There will be a built-in localization system, this is how the new variants look We will have more info later in the year.
Do you suggest to derive from LocalizationSettings, override the Platform property and use this as “Localization Settings.asset” instead of the one created by Unity?
Can I freely add anything as Platform in the new system or does the system rely on the platforms supported in Unity?
I’m asking because I have different localization requirements for the same platform. For example, different texts on PC for Steam and GOG. Can I define a “PC_Steam” and “PC_GOG” as platform with the new system?