docs.unity3d.com
    Show / Hide Table of Contents

    Class ColumnMapping

    Provides preconfigured columns mappings that can be used with GoogleSheets.

    Inheritance
    Object
    ColumnMapping
    Namespace: UnityEditor.Localization.Plugins.Google.Columns
    Syntax
    public static class ColumnMapping

    Methods

    AddLocaleMappings(IList<SheetColumn>)

    Creates a LocaleColumn for any project Locale that is missing from the columns.

    Declaration
    public static void AddLocaleMappings(IList<SheetColumn> columns)
    Parameters
    Type Name Description
    IList<SheetColumn> columns

    The existing column that will also be appeneded with any missing Locale's

    CreateDefaultMapping()

    Creates a KeyColumn at "A" and then a LocaleColumn for each Locale in the project, each mapped to a unique Column.

    Declaration
    public static List<SheetColumn> CreateDefaultMapping()
    Returns
    Type Description
    List<SheetColumn>

    CreateMappingsFromColumnNames(IList<String>, IList<String>)

    Creates columns by attempting to match to expected column names(case insensitive).
    The following names are checked:

    • keyKeyColumn
    • Project Locale's name, UnityEngine.Localization.LocaleIdentifier.ToString or CodeLocaleColumn

    Declaration
    public static List<SheetColumn> CreateMappingsFromColumnNames(IList<string> columNames, IList<string> unusedNames = null)
    Parameters
    Type Name Description
    IList<String> columNames

    The column names to create mappings for.

    IList<String> unusedNames

    Optional list that can be populated with the names that a match could not be found for.

    Returns
    Type Description
    List<SheetColumn>

    GetNextAvailableColumn(HashSet<Int32>)

    Returns the next available sheet column.

    Declaration
    public static string GetNextAvailableColumn(HashSet<int> reservedColumIds)
    Parameters
    Type Name Description
    HashSet<Int32> reservedColumIds

    The reserved column ids where "A" = 0, "B" = 1 etc. The found available column will also be added.

    Returns
    Type Description
    String

    GetNextAvailableColumn(IList<SheetColumn>)

    Returns the next available column name. For example if columns was using "A", "B", "D" then "C" would be returned.

    Declaration
    public static string GetNextAvailableColumn(IList<SheetColumn> columns)
    Parameters
    Type Name Description
    IList<SheetColumn> columns

    The columns that are currently in use.

    Returns
    Type Description
    String

    The next available column name.

    GetNextAvailableColumn(String[])

    Returns the next available column name. For example if reservedColumns was "A", "B", "D" then "C" would be returned.

    Declaration
    public static string GetNextAvailableColumn(params string[] reservedColumns)
    Parameters
    Type Name Description
    String[] reservedColumns

    The column names that are currently in use.

    Returns
    Type Description
    String

    The next available column name.

    Back to top
    Terms of use
    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