Class ColumnMapping
Provides preconfigured columns mappings that can be used with GoogleSheets.
Namespace: UnityEditor.Localization.Plugins.Google.Columns
Syntax
public static class ColumnMapping : object
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. |