Search Results for

    Show / Hide Table of Contents

    Class Localization

    A collection of localization related helper utilities.

    Inheritance
    System.Object
    Localization
    Namespace: GDX
    Syntax
    [VisualScriptingCompatible((short)8)]
    public static class Localization

    Fields

    | Improve this Doc View Source

    ByteSizes

    An array of strings representative for file size formats.

    Declaration
    public static readonly string[] ByteSizes
    Field Value
    Type Description
    System.String[]
    | Improve this Doc View Source

    FilenameTimestampFormat

    A filename safe System.DateTime.ToString(System.String).

    Declaration
    public const string FilenameTimestampFormat = "yyyyMMdd_HHmmss"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    LocalTimestampFormat

    The local ISO 8601 compliant System.DateTime.ToString(System.String).

    Declaration
    public const string LocalTimestampFormat = "yyyy-MM-dd HH\\:mm\\:ss"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    UtcTimestampFormat

    The UTC ISO 8601 compliant System.DateTime.ToString(System.String).

    Declaration
    public const string UtcTimestampFormat = "yyyy-MM-ddTHH\\:mm\\:ss.fffffffzzz"
    Field Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    GetHumanReadableFileSize(Int64)

    Creates a more human readable System.String of a byte size.

    Declaration
    public static string GetHumanReadableFileSize(long base2Size)
    Parameters
    Type Name Description
    System.Int64 base2Size

    The number of bytes (binary) to measure.

    Returns
    Type Description
    System.String

    A human readable version of the provided base2Size.

    Examples

    A byte size of 1024, will return a string of 1 KB.

    | Improve this Doc View Source

    GetIETF_BCP47(Localization.Language)

    Get the IETF BCP 47 language code for targetLanguage.

    Declaration
    public static string GetIETF_BCP47(this Localization.Language targetLanguage)
    Parameters
    Type Name Description
    Localization.Language targetLanguage

    The target Localization.Language.

    Returns
    Type Description
    System.String

    The language code.

    Remarks

    Two additional non-compliant values may be returned DEV or DEFAULT.

    | Improve this Doc View Source

    GetISO639_1(Localization.Language)

    Get the ISO 639-1 language code for targetLanguage.

    Declaration
    public static string GetISO639_1(this Localization.Language targetLanguage)
    Parameters
    Type Name Description
    Localization.Language targetLanguage

    The target Localization.Language.

    Returns
    Type Description
    System.String

    The language code.

    Remarks

    Two additional non-compliant values may be returned DEV or DEFAULT.

    | Improve this Doc View Source

    GetSystemLanguage()

    Get the Localization.Language equivalent of the UnityEngine.SystemLanguage.

    Declaration
    public static Localization.Language GetSystemLanguage()
    Returns
    Type Description
    Localization.Language

    The appropriate Localization.Language, or default.

    | Improve this Doc View Source

    GetTimestampFormat(Localization.Language)

    Get the localized System.DateTime.System.DateTime.ToString(System.String) for targetLanguage.

    Declaration
    public static string GetTimestampFormat(this Localization.Language targetLanguage)
    Parameters
    Type Name Description
    Localization.Language targetLanguage

    The target Localization.Language.

    Returns
    Type Description
    System.String

    The format System.String.

    | Improve this Doc View Source

    SetDefaultCulture()

    Sets the current threads culture to a defined setting in Config.

    Declaration
    public static void SetDefaultCulture()
    Remarks

    Can be used to avoid issues with culture settings without a Gregorian Calendar. Configurable to automatically execute after assemblies are loaded.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.