UI Components
All localized components update automatically when the locale changes — both in play mode and in the editor. They work by subscribing to Localization.OnLocaleChanged.
Text Components
LocalizedTMP
Auto-updates TextMeshPro text components. Supports RTL, locale-specific fonts, and dynamic arguments.
Setup: Add Component → Localized TMP
public class LocalizedTMP : MonoBehaviour
{
LocalizedString LocalizedString { get; set; }
TMP_Text TextComponent { get; }
bool UseLocaleFont { get; set; }
RtlMode RtlMode { get; set; }
void SetArguments(params object[] args);
void ClearArguments();
void Refresh();
}Runtime Usage:
[SerializeField] private LocalizedTMP scoreText;
void UpdateScore(int score)
{
// For strings like "Score: {0}"
scoreText.SetArguments(score);
}LocalizedText (Legacy)
Auto-updates UnityEngine.UI.Text components. Use LocalizedTMP for new projects.
Requires: Text component
public class LocalizedText : MonoBehaviour
{
LocalizedString LocalizedString { get; set; }
Text TextComponent { get; }
RtlMode RtlMode { get; set; }
void SetArguments(params object[] args);
void ClearArguments();
void Refresh();
}Image & Sprite Components
LocalizedImage
Auto-updates Image sprites per locale using inline locale overrides.
Requires: Image component
public class LocalizedImage : MonoBehaviour
{
Sprite DefaultSprite { get; set; }
Image ImageComponent { get; }
IReadOnlyList<LocaleSprite> LocaleOverrides { get; }
void SetSpriteForLocale(string localeCode, Sprite sprite);
bool RemoveSpriteForLocale(string localeCode);
Sprite GetSpriteForLocale(string localeCode);
void Refresh();
}LocalizedSpriteComponent
Localizes an Image sprite using an Asset Table reference.
Requires: Image component
public class LocalizedSpriteComponent : MonoBehaviour
{
LocalizedSprite LocalizedSprite { get; set; }
Sprite FallbackSprite { get; set; }
Image ImageComponent { get; }
void SetSpriteReference(string tableId, string entryKey);
void SetSpriteReference(string entryKey);
void Refresh();
}LocalizedTextureComponent
Localizes a RawImage texture using an Asset Table reference.
Requires: RawImage component
public class LocalizedTextureComponent : MonoBehaviour
{
LocalizedTexture LocalizedTexture { get; set; }
Texture FallbackTexture { get; set; }
RawImage RawImageComponent { get; }
void SetTextureReference(string tableId, string entryKey);
void SetTextureReference(string entryKey);
void Refresh();
}Audio Component
LocalizedAudioComponent
Localizes an AudioSource clip with per-locale overrides and playback control.
Requires: AudioSource component
public class LocalizedAudioComponent : MonoBehaviour
{
AudioClip DefaultClip { get; set; }
bool PlayOnLocaleChange { get; set; }
AudioSource AudioSource { get; }
AudioClip CurrentClip { get; }
void SetClipForLocale(string localeCode, AudioClip clip);
bool RemoveClipForLocale(string localeCode);
AudioClip GetClipForLocale(string localeCode);
void Play();
void PlayOneShot();
void Stop();
void Refresh();
}Font Components
LocalizedFontComponent
Localizes a TMP_Text font using an Asset Table reference. Requires TextMeshPro.
Requires: TMP_Text component
public class LocalizedFontComponent : MonoBehaviour
{
LocalizedFont LocalizedFont { get; set; }
bool RestoreOriginalOnDisable { get; set; }
TMP_Text TextComponent { get; }
TMP_FontAsset OriginalFont { get; }
void SetFontReference(string tableId, string entryKey);
void SetFontReference(string entryKey);
void RestoreOriginalFont();
void Refresh();
}LocalizedLegacyFontComponent
Localizes a legacy Text font using an Asset Table reference.
Requires: Text component
public class LocalizedLegacyFontComponent : MonoBehaviour
{
LocalizedLegacyFont LocalizedFont { get; set; }
bool RestoreOriginalOnDisable { get; set; }
Text TextComponent { get; }
Font OriginalFont { get; }
void SetFontReference(string tableId, string entryKey);
void SetFontReference(string entryKey);
void RestoreOriginalFont();
void Refresh();
}Prefab Component
LocalizedPrefabComponent
Instantiates a locale-specific prefab from an Asset Table. Optionally destroys the previous instance on locale change.
public class LocalizedPrefabComponent : MonoBehaviour
{
LocalizedPrefab LocalizedPrefab { get; set; }
Transform SpawnParent { get; set; }
bool AutoInstantiate { get; set; }
bool DestroyPreviousInstance { get; set; }
GameObject CurrentInstance { get; }
void SetPrefabReference(string tableId, string entryKey);
void SetPrefabReference(string entryKey);
GameObject SpawnInstance();
GameObject SpawnInstance(Vector3 position, Quaternion rotation);
void DestroyCurrentInstance();
void Refresh();
}Layout Component
RtlLayoutGroup
Automatically flips child order and alignment for RTL locales. Attach to a HorizontalLayoutGroup.
Requires: HorizontalLayoutGroup component
public class RtlLayoutGroup : MonoBehaviour
{
bool AutoFlip { get; set; }
bool ForceRtl { get; set; }
bool FlipAlignment { get; set; }
bool FlipPadding { get; set; }
bool IsRtl { get; }
HorizontalLayoutGroup LayoutGroup { get; }
void UpdateLayout();
void Refresh();
}Addressable Components
These components load assets asynchronously via the Addressables system. They require the com.unity.addressables package.
AddressableLocalizedSpriteComponent
Requires: Image component
public class AddressableLocalizedSpriteComponent : MonoBehaviour
{
AddressableLocalizedSprite LocalizedSprite { get; set; }
bool IsLoading { get; }
bool IsLoaded { get; }
Image ImageComponent { get; }
event Action<Sprite> OnSpriteLoaded;
event Action<Exception> OnLoadError;
void LoadSprite(Action<Sprite> onComplete = null);
void ReleaseCurrentAsset();
void Refresh();
}AddressableLocalizedTextureComponent
Requires: RawImage component
public class AddressableLocalizedTextureComponent : MonoBehaviour
{
AddressableLocalizedTexture LocalizedTexture { get; set; }
bool IsLoading { get; }
bool IsLoaded { get; }
RawImage RawImageComponent { get; }
event Action<Texture> OnTextureLoaded;
event Action<Exception> OnLoadError;
void LoadTexture(Action<Texture> onComplete = null);
void ReleaseCurrentAsset();
void Refresh();
}AddressableLocalizedAudioComponent
Requires: AudioSource component
public class AddressableLocalizedAudioComponent : MonoBehaviour
{
AddressableLocalizedAudioClip LocalizedAudioClip { get; set; }
bool IsLoading { get; }
bool IsLoaded { get; }
AudioSource AudioSourceComponent { get; }
event Action<AudioClip> OnClipLoaded;
event Action<Exception> OnLoadError;
void LoadClip(Action<AudioClip> onComplete = null);
void Play();
void Stop();
void ReleaseCurrentAsset();
void Refresh();
}AddressableLocalizedPrefabComponent
public class AddressableLocalizedPrefabComponent : MonoBehaviour
{
AddressableLocalizedPrefab LocalizedPrefab { get; set; }
bool IsLoading { get; }
bool IsLoaded { get; }
GameObject CurrentInstance { get; }
event Action<GameObject> OnPrefabInstantiated;
event Action<Exception> OnLoadError;
void LoadAndInstantiate(Action<GameObject> onComplete = null);
void DestroyCurrentInstance();
void ReleaseCurrentAsset();
void Refresh();
}