Multilingual CSV : unable to use same file for sources & translations

Hello Crowdin community !

I’m trying to use multilingual CSV synchronisation with our Github repository. My goal is to have sources & translations together in a sources.csv and then use target bundles to export in both Localizable.strings for iOS & string.xml for Android.

However when setting up CSV Github integration I can’t make crowdin use my sources.csv as both input & output. I get the error in the screenshot. My only option seems to have as output one folder per language (with the same multilingual csv in each) which seems to defy the purpose of multilingual CSVs.

Is there something I’m missing here ? Isn’t this the purpose of multilingual CSVs ?
Thanks in advance

Hello @gchevillot

Would you have a chance to give a try the pattern that is described in this example?

Thanks for the quick answer @Dima ! However I’m not sure it’s what I’m looking for. I’m not looking to filter out files but update my single .csv in place. I seem to have managed it by editing crowdin.yml directly like so :

files:

  • source: sources.csv
    translation: /sources.csv
    multilingual_spreadsheet: 1
    first_line_contains_header: 1
    scheme: ‘identifier,source_phrase,context,fr’

but it still gives me an issue :

Invalid options given : [exportPattern][exportPattern - If the resulting file name starts with the slash (/), it should contain at least one language identifier to prevent overriding translation in the archive [%language%, %two_letters_code%, %three_letters_code%, %locale%, %locale_with_underscore%, %android_code%, %osx_code%, %osx_locale%]]

Dear @gchevillot , Translated path requires having some language placeholder, so translated file should look like sources.csv_%two_letters_code% (or any other placeholder

Since if you don’t use that, your translations can be overwritten with the source as you have same source and translations paths

@gchevillot try the following configuration in your crowdin.yml file:

"files": [
  {
    "source": "sources.csv",
    "translation": "sources.csv",
    "first_line_contains_header": true,
    "scheme": "identifier,source_phrase,context,fr,en"
  }
]

For more details, see the Multilingual Spreadsheet docs.

@NataliaM @andrii-bodnar thanks for your answers. From what you are saying, I gather that I can’t really have a single csv for both my sources & translations. I will always have to deal with a hierarchy like in the capture below where each .csv actually contains only one language ! Is there no way to have it all merged into one truly multilanguage csv ?

@gchevillot did you try to specify in the “scheme” all your target languages? Do you still get separated files?

thanks for the suggestion @NataliaS ! I had way too many languages in my sample so I tried creating an empty project with just french & english. It doesn’t seem to make a difference unfortunately :confused:

BTW You’ll notice he doesn’t seem to like my scheme very much because of the “labels” column …

Hi!
If you don’t have labels in your file then you should omit this code in the scheme. If you add context to source strings which should help translators in their work - feel free to specify the context column
If your file contains several languages you need to specify all language codes as we advised above

Thanks for the answer. I have labels in my csv so I need it in my scheme. But my main issue here is not with labels but rather the whole translation hierarchy that doesn’t make sense for multilingual files :wink: and yes I had specified english & french which were the only 2 languages handled in this example project :slight_smile:

Hi gchevillot,

Sorry for the confusion here!

Could you please let me know when you used the config my colleague andrii-bodnar provided the files in the PR had the same structure? i.e separate folders for each language?

It might be that the preview in the integration settings was incorrect,

Looking forward to your reply,

Hello @Olena
I’ve tried again from scratch with the config provided by @andrii-bodnar and it still gives me the same result. The steps to reproduce :

  • Create a project from scratch (mine is GS-MOD-Sandbox3)
  • I have a branch named develop/v28.0 which has a sources.csv :
identifier,source_phrase,context,fr,en
user_account_persons,People,unit for number of persons in household,Personnes,People
user_account_save_button,Validate,Save the changes button,Valider,Validate

and crowdin.yml provided :

"files": [
  {
    "source": "sources.csv",
    "translation": "sources.csv",
    "first_line_contains_header": true,
    "scheme": "identifier,source_phrase,context,fr,en"
  }
]
  • I setup my “Source and translation files mode” integration in the most basic manner & hit Save

the sync is automatically performed and gives me a PR with this content :

thanks for the time spent on this. Can you confirm this is a bug on your side ?

Hi,

Kindly contact us at support@crowdin.com and please share your source file from the repo. We’ll do our best to investigate everything on our side

So for anyone facing the same issue, for now Crowdin doesn’t handle multilingual well even if they are working to improve it.

The best you can achieve at the moment, is to have only one other multilingual file (ex: en-translations.csv) by using “translation_replace” to map all languages to “en” in crowdin.yml.

Thanks everyone