CVR Translatable
Swaps a text string, TextMeshPro text, audio clip, or a visible GameObject based on the player’s GeneralLanguage setting. Subscribes to MetaPort.Instance.settings.settingStringChanged so changes to the language propagate at runtime.
Fields
Section titled “Fields”Translatables
Section titled “Translatables”List<ObjectTranslatable_t>. Each entry drives one renderable or audio target. Entry fields:
Type—TranslatableTypeenum:AudioClip,Text,TextMeshPro,GameObject. Selects which of the other fields is used.Translations—List<Translation_t>. One per language. Each has:Language— ISO 639-1 language code (e.g.en,ja,fr). Defaulten.Text— string used whenType == TextorTextMeshPro.Clip— audio clip used whenType == AudioClip.Object— GameObject activated whenType == GameObject(others are deactivated).
TmpText—TMP_Texttarget forTextMeshPro.Text—UnityEngine.UI.Texttarget forText.Source—AudioSourcetarget forAudioClip.FallbackLanguage— ISO code used when no translation matches the user’s current language. Defaulten.
Supported languages
Section titled “Supported languages”The component exposes a static Languages dictionary keyed by ISO 639-1 code covering the standard set from ab (Abkhazian) through zu (Zulu). Use any of these codes for the Language field of a translation entry.
Runtime behaviour
Section titled “Runtime behaviour”On Start, the selected language is read from GeneralLanguage in player settings, then every Translatables entry is updated. Whenever the user changes language in-game, the component re-applies:
Text/TextMeshPro— writes the matching translation’sTextto the target.AudioClip— assigns the matching clip to the source (does not callPlay).GameObject— activates the matching entry’s GameObject and deactivates all other entries’ GameObjects in the same translatable.
If no entry matches the current language, the FallbackLanguage lookup is used.
Related
Section titled “Related”Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRTranslatable.cs