Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request Custom delimiter for CSV import/export

Discussion in 'Localization Tools' started by Tom-Psy, Oct 27, 2022.

  1. Tom-Psy

    Tom-Psy

    Joined:
    Aug 16, 2022
    Posts:
    2
    Hi!

    I was playing with the CSV importer recently and I did not find an option to change the delimiter from the default comma. We use the CSV format in a couple of other places in this project where we've standardized using the semicolon as delimiter. So it would be helpful if we could also use that for Unity Localize, for example exposed as a setting on the CsvExtension.

    Thanks!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,149
    Sounds reasonable. I'll add a task to our backlog for it.
     
  3. MathisHaumontRT

    MathisHaumontRT

    Joined:
    Sep 13, 2023
    Posts:
    4
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,149
    Hi,
    Sorry, we have not gotten to this yet although it is in our backlog.
     
  5. MathisHaumontRT

    MathisHaumontRT

    Joined:
    Sep 13, 2023
    Posts:
    4
    Hello !
    No problem ... but do you have a idea how can i make my own Localization Extensions ?
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,149
  7. MathisHaumontRT

    MathisHaumontRT

    Joined:
    Sep 13, 2023
    Posts:
    4
    @karl_jones i'm happy to say i just know how to add easily this new feature, how can we speak about it ?
    also i want to know if you have some plugin / extensions in your roadmap like Microsoft Azure Plugin to connect an Excel directly into Unity ?
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,149
    I'm happy to make changes if you have them. We don't have a public GitHub repository but you can post a patch file here.
    We don't currently have any plans to add any more plugins at the moment. Its possible to write your own though, we have some changes coming in 1.5 that also let you add custom menu elements into the Tables window, that will help with integration.
     
  9. MathisHaumontRT

    MathisHaumontRT

    Joined:
    Sep 13, 2023
    Posts:
    4
    Okay nice, let me some times to find the best way for Unity Localization to add this features, but the way it's to have an Scriptable Objects with the CsvHelper.Configuration.CsvConfiguration for the CSV Extensions, and just add this configuration in the Csv.cs

    for the function (delimiter need to be a variable)
    public static CsvConfiguration CustomCsvConfiguration()
    {
    CsvConfiguration csvConfiguration = new CsvConfiguration(CultureInfo.InvariantCulture)
    {
    Delimiter = ";",
    };
    return csvConfiguration;
    }

    and in the Csv.cs just add this :
    using (var csvReader = new CsvReader(reader, configuration: csvConfiguration))

    and it's fine, but maybe we can do this better
     
    karl_jones likes this.