Multi-languages json file

Hello !

I need advice on how to process a json file.

For the moment, my client does not want to send me the file, but he explained to me that he needs an output file with all the languages in it.

Like this : 

Fullscreen
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

is it possible ? how can I do this with Trados as I'll have 1 target file per language ?

Thanks for your help !

Isabelle



Tidying the code.
[edited by: Paul at 10:11 PM (GMT 0) on 1 Feb 2022]
emoji
  • You probably have two choices as far as I know:

    1. translate one language at a time, so you do the en-fr for example, then save the target file and use that file to do the en-sp, save the target file and now you have all three languages in one file.
    2. pre-process the file, translate, post-process the file.

    The first is self-explanatory and would be a lengthy process for a file with many languages.  The second would require a localization engineer who knew how to do this work... tools like Okapi Rainbow could be helpful here... but it would allow you to carry out the translation of each language simultaneously and eventually merge the files back into one.

    It's quite interesting because we created the multilingual XML filetype through our AppStore Team to be able to deal with this process and create a single multilingual xml file from a multilingual project.  We'll be tackling multilingual Excel next and I suppose there may be a niche for multilingual JSON too.  Perhaps something we'll put on our backlog and look at it if there is some demand.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
  • Hello Paul !

    Thanks for the answer ! As usal very clear and documented ! Slight smile

    For what I understand, choice 2 is too technical for us since we do not have a localization engineer. I tried to install Okapi Rainbow, but the installation crashed.

    I'll try to see what I can do with choice 1 : the only thing I would like to kow it's how can I ADD the translation (and not replace the source text) ? Is there a way to do this in Trados or should I prepare the file manually using a txt editor ?

    Thanks !

    emoji
  • 1 : the only thing I would like to kow it's how can I ADD the translation (and not replace the source text) ?

    It sounds as though the example you gave us is the final output, but the input should have only contained one language?  I thought it was te source file and you just needed to know how to get all the translated languages into one file.

    In this case you will need to add them prior to translating so you can overwrite the translatable text, and then follow choice 1.

    It sounds to me more and more as though it may be time to look at employing a localization engineer, or train someone up.  A truly valuable investment.

    For now, I guess a regex search and replace would do the trick as you could also do this with a batch process if you have many files.  A quick example...

    Take a source file like this:

    Fullscreen
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Search for this:

    ({.+?"Langue":\s)("EN")(.+?}),?

    Replace with this:

    $1$2$3,\r\n$1"SP"$3,\r\n$1"FR"$3,

    Gets you this:

    Fullscreen
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Then you just translate the file for each language as in choice 1.  Would that work?

    Is there a way to do this in Trados or should I prepare the file manually using a txt editor ?

    See above...

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
  • Just let me know if I'm right :

    1 - my client send me a file with FR text ONLY:

    [

      {

        "Ref": "534976",

        "Langue": "FR",

        "Designation": "LAMPE ABAT JOUR BLANC SUR TREPIED BOIS",

        "SousDesignation": "Décoration d’intérieur, lampe à poser",

        "Description": “<p><span style="font-size:12px">Lampe sur trépied en bois avec abat-jour en tissu blanc. Idéale pour apporter une touche scandinave à votre déco intérieure ! </span></p>"

      }

    ]

    2 - I need to translate this file into ENG and SP. But the final output should be ONE single file with FR/ENG/SP texts (as mentioned above). So, I have to prepare the file (as stated above with the regex). Then I have to prepare the sdlxliff file in Trados for the ENG translator by locking FR and SP segments. Once the ENG translation is received, I prepare an sdlxliff file in Trados for the SP translator by locking FR and ENG segments. 

    Is that correct ?

    PS : I totally agree a localization engineer would be very helpfull, but I'm afraid my management is not ready to invest !

    emoji
  • So, I have to prepare the file (as stated above with the regex).

    Yes... you need to follow the process.  But make sure you adapt the language codes to suit as my example started with EN.  Your example starts with FR.

    Then I have to prepare the sdlxliff file in Trados for the ENG translator by locking FR and SP segments.

    Lock... or more appropriately don't extract.  Might be better.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
  • Also note your sample was missing commas from the end of the "Description" element, and these attributes need to use single quotes, not double.  So this:

    style='font-size:12px'

    NOT this:

    style="font-size:12px"

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji