docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LocaleColumns

    Represents the localized value and Comment metadata from a StringTable.

    Inheritance
    object
    CsvColumns
    LocaleColumns
    Implements
    ISerializationCallbackReceiver
    Inherited Members
    CsvColumns.WriteEnd(StringTableCollection)
    Namespace: UnityEditor.Localization.Plugins.CSV.Columns
    Assembly: Unity.Localization.Editor.dll
    Syntax
    [Serializable]
    public class LocaleColumns : CsvColumns, ISerializationCallbackReceiver

    Properties

    Name Description
    CommentFieldName

    The comments field name when exporting and importing. When importing this name will be checked against the headers to determine if the field is present in the CSV data.

    FieldName

    The value field name when exporting and importing. When importing this name will be checked against the headers to determine if the field is present in the CSV data.

    IncludeComments

    Should the Comment metadata be exported as a separate column?

    LocaleIdentifier

    Used to extract the StringTable from the StringTableCollection when importing and exporting.

    Methods

    Name Description
    ReadBegin(StringTableCollection, CsvReader)

    Called when reading a CSV file column header row. This call should be used to determine which column indexes to use during ReadRow(SharedTableEntry, CsvReader). Use reader.GetFieldIndex("Column Header", isTryGet: true) to check for a column with a matching name.

    ReadEnd(StringTableCollection)

    Called when the CSV file has been imported. This can be used to perform any required cleanup.

    ReadRow(SharedTableEntry, CsvReader)

    Called when reading each row of the CSV file. Unity recommends to store the indexes of the rows you are interested in during ReadBegin(StringTableCollection, CsvReader) and then use them to access the row using reader.GetField.

    SetDefaultFieldNames()

    Sets the field names to their default values. The default values are UnityEngine.Localization.LocaleIdentifier.ToString() for FieldName and FieldName + " Comments" for CommentFieldName.

    WriteBegin(StringTableCollection, CsvWriter)

    Called when writing the header row of the CSV file. Each column that will be written to during WriteRow(SharedTableEntry, IList<StringTableEntry>, CsvWriter) should have its column header written here using writer.WriteField("Header Title").

    WriteRow(SharedTableEntry, IList<StringTableEntry>, CsvWriter)

    Called when writing each row of the CSV file. This is called in the same order as WriteBegin(StringTableCollection, CsvWriter) and expects each column that was written to be populated each time. If a column will not always contain a value, you can use writer.WriteField(string.Empty).

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)