DialogicCsvFile

This contains the source code documentation of the class DialogicCsvFile.

DialogicCsvFile

Inherits: RefCounted

Handles translation of a DialogicTimeline to a CSV file.

Properties


Methods


Constants

const String = 0

No description available.


const Array = 1

No description available.


const Other = 2

No description available.


const TRANSLATION_ID = "_translation_id"

No description available.


Property Descriptions

var lines = []

No description available.


var old_lines = {}

Dictionary of lines from the original file. Key: String, Value: PackedStringArray


var column_count = 0

The amount of columns the CSV file has after loading it. Used to add trailing commas to new lines.


var is_new_file = false

Whether this CSV file was able to be loaded a defined file path.


var file

The underlying file used to read and write the CSV file.


var used_file_path

File path used to load the CSV file.


var updated_rows = 0

The amount of events that were updated in the CSV file.


var new_rows = 0

The amount of events that were added to the CSV file.


var add_separator = false

Whether this CSV handler should add newlines as a separator between sections. A section may be a new character, new timeline, or new glossary item inside a per-project file.


Method Descriptions

func collect_lines_from_characters ( characters: Dictionary ) ⇒ void

Collects names from the given characters and adds them to the lines. If this is the character name CSV file, use this method to take previously collected characters from other DialogicCsvFiles.


func add_translation_keys_to_glossary ( glossary: DialogicGlossary ) ⇒ void

Reads all lines and adds them to the given glossary's internal collection of words-to-translation-key mappings. Populate the CSV's lines with the method collect_lines_from_glossary before.


func collect_lines_from_glossary ( glossary: DialogicGlossary ) ⇒ void

Collects properties from glossary entries from the given glossary and adds them to the lines.


func collect_lines_from_timeline ( timeline: DialogicTimeline ) ⇒ void

Collects translatable events from the given timeline and adds them to the lines.


func update_csv_file_on_disk ( ) ⇒ void

Clears the CSV file on disk and writes the current lines array to it. Uses the old_lines dictionary to update existing translations. If a translation row misses a column, a trailing comma will be added to conform to the CSV file format. If the locale CSV line was collected only, a new file won't be created and already existing translations won't be updated.