Class LocalizedStringDatabase | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class LocalizedStringDatabase

    Handles loading strings and their tables for the selected locale.

    Inheritance
    System.Object
    LocalizedDatabase
    LocalizedStringDatabase
    Inherited Members
    LocalizedDatabase.DefaultTableName
    Namespace: UnityEngine.Localization
    Syntax
    public class LocalizedStringDatabase : LocalizedDatabase, IPreloadRequired

    Fields

    StringTableLabel

    Declaration
    public const string StringTableLabel = "StringTable"
    Field Value
    Type Description
    System.String

    Properties

    NoTranslationFoundFormat

    The message to display when a string can not be localized. The final string will be created using String.Format where format item 0 contains the original string.

    Declaration
    public string NoTranslationFoundFormat { get; set; }
    Property Value
    Type Description
    System.String

    PreloadOperation

    Declaration
    public IAsyncOperation PreloadOperation { get; }
    Property Value
    Type Description
    IAsyncOperation
    Implements
    IPreloadRequired.PreloadOperation

    Methods

    GetLocalizedString(String)

    Attempts to retrieve a string from the default StringTable. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.

    Declaration
    public virtual IAsyncOperation<string> GetLocalizedString(string original)
    Parameters
    Type Name Description
    System.String original

    The original text or key that should be used to find the translated text.

    Returns
    Type Description
    IAsyncOperation<System.String>

    GetLocalizedString(String, Int32)

    Attempts to retrieve a plural string from the default StringTable. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.

    Declaration
    public virtual IAsyncOperation<string> GetLocalizedString(string original, int n)
    Parameters
    Type Name Description
    System.String original

    Original string or key to find the localized string.

    System.Int32 n

    Plural value

    Returns
    Type Description
    IAsyncOperation<System.String>

    GetLocalizedString(String, String)

    Attempts to retrieve a string from a StringTable. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.

    Declaration
    public virtual IAsyncOperation<string> GetLocalizedString(string tableName, string original)
    Parameters
    Type Name Description
    System.String tableName

    The name of the string table to look for the translated text in.

    System.String original

    The original text or key that should be used to find the translated text.

    Returns
    Type Description
    IAsyncOperation<System.String>

    GetLocalizedString(String, String, Int32)

    Attempts to retrieve a plural string from the table. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.

    Declaration
    public virtual IAsyncOperation<string> GetLocalizedString(string tableName, string original, int n)
    Parameters
    Type Name Description
    System.String tableName

    Table to search for the original string.

    System.String original

    Original string or key to find the localized string.

    System.Int32 n

    Plural value

    Returns
    Type Description
    IAsyncOperation<System.String>

    GetTable(String)

    Returns the named table. This function is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.

    Declaration
    public virtual IAsyncOperation<StringTableBase> GetTable(string tableName)
    Parameters
    Type Name Description
    System.String tableName
    Returns
    Type Description
    IAsyncOperation<StringTableBase>

    OnLocaleChanged(Locale)

    Called before the LocaleChanged event is sent out in order to give the database a chance to prepare.

    Declaration
    public override void OnLocaleChanged(Locale locale)
    Parameters
    Type Name Description
    Locale locale
    Overrides
    LocalizedDatabase.OnLocaleChanged(Locale)

    ProcessUntranslatedText(String)

    Declaration
    protected virtual string ProcessUntranslatedText(string original)
    Parameters
    Type Name Description
    System.String original
    Returns
    Type Description
    System.String
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023