CSV Multilingual Field Support
The Language Token
A specialized token that contains an instruction to apply on the column definition is added to a multilingual CSV column header. It is used to support the addition of new languages by adding multilingual field columns to an existing CSV file without having to modify the corresponding load file.
To use the CSV multilingual field support in TCC-TCB:
The properties section of the CSV file MUST contain the "csv.multilingual=true" property. The property name is case sensitive and MUST be lowercase.
The CSV header MUST be present. It means that the load file MUST have "Header present" checked, and that the first row of the CSV input file data is the header.
All the CSV file header names MUST match the column path or the column alias (header) specified in the load file.
To add new multilingual field columns, at least one column of this multilingual field MUST already exist in the load file. The new column header added to the CSV file MUST be placed after all the existing column headers defined in the load file for that field. It is not mandatory to put the new header right after the last existing header, it could be placed at the end of the row.
To specify a locale, the token [locale=xx] MUST be used at the end of the header name (where xx is a specified locale for example "fr"). The "locale" token is case sensitive and MUST be lowercase.
Example
Original CSV file:
Identifier,"UserLoginname","Title","ManagerLoginname"
abc123,abc123,architect,manager123
CSV file with additional multilingual fields:
#BEGINPROPERTIES
csv.multilingual=true
....
#ENDPROPERTIES
Identifier,"UserLoginname","Title","Title [locale=fr]",
"Title [locale=es]","ManagerLoginname"
abc123,abc123,architect,architecte,arquitecto,manager123
Note:The locale information is optional for the initial multilingual field columns defined in the load file.
-
When the locale is NOT specified in the CSV file, the locale information is retrieved from the load file.
-
When the locale is specified in the CSV file and the "csv.multilingual=true" property is set, it always overrides the locale information from the load file.
CSV file using specific locale:
#BEGINPROPERTIES
csv.multilingual=true
....
#ENDPROPERTIES
Identifier,"UserLoginname","Title [locale=fr]","ManagerLoginname"
abc123,abc123,architecte,manager123
Internal Load File
When TCC loads a set of additional multilingual columns, it creates an internal load file that matches the structure of the CSV file. The attribute values for the new columns are copied from the first multilingual column defined in the load file. The locale token value sets the locale attribute value for each new column.
Original Load File
<load:column parameter="1" type="DATA" path="CorrespondenceEmail" ignoreEmpty="true" localeType="NONE"/>
<load:column parameter="1" type="DATA" path="Title" ignoreEmpty="true" localeType="DEFAULT"/>
<load:column parameter="1" path="Department,CostCenter" searchType="NONE" localeType="DEFAULT" type="DATA"/>
New CSV File
#BEGINPROPERTIES
csv.multilingual=true
#ENDPROPERTIES
CorrespondenceEmail,Title,"Title [locale=fr]",
"Department,CostCenter","Department,CostCenter [locale=fr]"
abc123@xyz.com,plumber,plombier,plumbing,plomberie
Internal Load File
<load:column parameter="1" type="DATA" path="CorrespondenceEmail" ignoreEmpty="true" localeType="NONE"/>
<load:column parameter="1" type="DATA" path="Title" ignoreEmpty="true" localeType="DEFAULT"/>
<load:column parameter="1" type="DATA" path=" Title" ignoreEmpty="true" localeType="SPECIFIC" localeValue="fr"/>
<load:column parameter="1" path="Department,CostCenter" searchType="NONE" localeType="DEFAULT" type="DATA"/>
<load:column parameter="1" path="Department,CostCenter" searchType="NONE" localeType="SPECIFIC" localeValue="fr" type="DATA"/>
Note that only the locale attributes are different for the new columns, all the others are the same.