TabularEditor / TabularEditor3

Bug reports, feature requests, discussion and documentation for Tabular Editor 3 (commercial version).
65 stars 7 forks source link

Metadata translations containing commas are truncated on import from UTF-8 text file #639

Open rob51i03 opened 2 years ago

rob51i03 commented 2 years ago

When importing metadata translations from a UTF-8 tab separated file using the ImportProperties scripting command, any translations containing commas are truncated at the comma.

This occurs whether or not a text qualifier is used around the values in the text file , such as a quotation symbol.

otykier commented 2 years ago

Could you share the script you use to call the ImportProperties method? Most likely, it is a matter of how the csv data is parsed.

rob51i03 commented 2 years ago

Here's the code I used:

var tsvFilePath = @"c:\Temp\Translations.txt";

// Read the tsv
var tsv = ReadFile(tsvFilePath);

// Import the translations into the model
ImportProperties(tsv);

Here's a small extract of the tab separated file used as the source for the import. Translations.txt Rows 12 and 15 have commas in the French translations; these are truncated at the comma upon import. Other translations import as expected.

rob51i03 commented 2 years ago

Could I get a status for this? Currently I am working around this by copying and pasting translations in via the UI but it's not ideal. Thanks!

otykier commented 2 years ago

We were not able to reproduce this issue. The following simple script example shows that the ImportProperties and ExportProperties do not truncate the names (assuming the selection contains a one or more measures having commas in their translated names):

var tsv = ExportProperties(Selected.Measures, "Name,TranslatedNames");
tsv.Output();
ImportProperties(tsv);

Please make sure that your .txt file conforms to the format used by ExportProperties (no quotes, tabs as separators)