Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

UnityEngine.LocalizationRuntimeModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The Localization Runtime module provides the runtime foundation for localizing an application: locales, string and asset tables, and the settings, database, and asset providers that resolve localized content for the active locale.

Use the Localization Runtime to declare the locales an application supports, store localized strings and assets in tables, and resolve the right value for the active locale at runtime through localized references and components.

This module is enabled by default in all new projects. To enable it in an older project, do the following in the Unity Editor:

  1. Select Window > Package Management > Package Manager to open the Package Manager.
  2. Select the Built-in section.
  3. Select the Localization Runtime module and click Enable.

Alternatively, you can add this line to the Packages/manifest.json file to enable the module: "com.unity.modules.localizationruntime": "1.0.0",

Classes

Class Description
AssetEntry Represents a localized asset stored as a direct object reference that ships and loads with the table.
AssetEntryBase<T0> Serves as the base class for asset entries that own a stored reference and load and release the asset themselves.
AssetProvider An ordered chain of asset providers used to load localized assets. Providers are tried in order and the first one to resolve an asset wins.
CommandLineLocaleSelector Selects the locale from a command line argument, such as -language=fr.
Comment Stores a free-text author comment that can be attached to any localization target.
DistributedUIDGenerator The default key generator. It produces a distributed unique id, Snowflake-style, that combines a timestamp, a machine id, and a per-millisecond sequence.
EntryData One row of a snapshot: a key's shared data plus this locale's value, either a string or a serialized entry.
ExcludeEntryFromEditorExport Marks a key or entry so that editor exporters skip it.
ExcludeEntryFromPlayerExport Marks a key or entry so that it is left out of the files generated for a built player.
FileTableProvider An asset provider that serves a table by reading a data file and reconstructing the table in memory.
JsonResourceProvider A file table provider that reads tables from JSON, the default player format.
JsonTableReader The default table file reader, reading table snapshots from JSON.
LanguageDropdown A dropdown that lets the player pick a language.
LanguageRadioButtonGroup A radio button group that lets the player pick a language.
Locale Represents a selectable language or region in a localized project. A locale carries a culture code, an optional display name, a formatting culture, and an optional fallback.
LocalizationSettings The runtime settings for localization: the available locales, the selected locale, and the resource database.
LocalizeAssetEvent<T0> Serves as the base component that resolves a localized asset and forwards it through a UnityEvent whenever the value or the selected locale changes.
LocalizedAsset<T0> A serializable reference to a localized asset that updates as the selected locale changes.
LocalizedEntry<T0> A serializable reference to a single localization table entry that resolves to a typed entry value.
LocalizedFont A serializable reference to a localized font asset.
LocalizedGameObject A serializable reference to a localized GameObject asset.
LocalizedMaterial A serializable reference to a localized material asset.
LocalizedObject A serializable reference to a localized asset of any Object-derived type.
LocalizedReference The serializable base for a reference into a localization table, pairing a table collection with an optional locale override.
LocalizedSprite A serializable reference to a localized sprite asset.
LocalizedString A serializable reference that resolves and formats a localized text value.
LocalizedTable A serializable reference to an entire localization table resolved for a locale.
LocalizedTexture A serializable reference to a localized texture asset.
LocalizeStringEvent Component that resolves a localized string and forwards it through a UnityEvent whenever the value or the selected locale changes.
LocalizeTextureEvent Component that resolves a localized texture and forwards it through a UnityEvent whenever the value or the selected locale changes.
LocalVariablesGroup A named collection of Smart String variables owned by a localized string.
MetadataAttribute Declares where a metadata kind may be attached and how it appears in the editor's "Add Metadata" menu.
MetadataCollection Holds the metadata items attached to a single localization target.
PlayerPrefLocaleSelector Stores the last selected locale in PlayerPrefs and restores it on startup.
ReferencedAssetProvider An asset provider that resolves an address to a directly referenced asset. Use it when assets are assigned by reference rather than loaded from built content, a Resources folder, or Addressables.
ResourceAssetEntry Represents a localized asset stored as a path into a Resources folder.
ResourceDatabase Resolves localized strings and assets for the active localization settings.
ResourceEntryBase Serves as the base class for the built-in resource entry kinds, holding the stable key id and per-entry metadata.
ResourceFolderProvider An asset provider that loads assets from Resources folders, treating the address as a Resources path.
ResourceTable A localization table that holds the translated values for one locale in a collection.
ResourceTableData A flat, serializable snapshot of one per-locale table.
SharedTableData The shared key table for a localization table collection: the set of string keys and their stable ids that every per-locale table in the collection uses.
SpecificLocaleSelector Selects a fixed locale by its identifier when that locale is available.
StringEntry Represents a localized string entry that stores a single text value with no variants.
SystemLocaleSelector Detects the locale from the device's current UI culture and matches the closest available locale.

Structs

Struct Description
AssetKey Identifies a single asset to load through an asset provider. The key pairs a provider specific address with an expected asset type, and optionally the name of a sub-asset at that address.
LocaleIdentifier Identifies a locale by its culture code, for example "en" or "fr-CA".
SelectorData A serialized variant selector: its type plus the selector's own serialized fields.
TableEntryReference A serializable reference to a single table entry, identified either by its key text or by its stable key id.
TableReference A serializable reference to a table collection, identified either by its name or by its collection GUID.
VariantData One variant value: the selector key it applies to and the string payload.

Enumerations

Enumeration Description
LoadingPreference Selects whether the localization system resolves values asynchronously or synchronously when it has the choice.
MetadataType Identifies where a kind of metadata may be attached in a localized project.
PlayModeSource Selects what a file table provider serves in the editor when entering Play Mode.
SharedEntryFlags Per-key flags stored once on the shared table entry and shared across every locale.