Question regarding traduction with JSON files

Hi,

So I'm new here and I would like your help with this system of translation.

I have a website that uses JSON files to translate the words/sentences. Currently, the translations are available in french and english and the local code of my files are "fr-FR" and "en-US".

The format of my JSON files is very simple:

{

  "Name": "Name",

  "Apple": "Apple",

  "Orange": ""

}

I want to translate the key of the JSON file and not the value. When the value is empty, SDL studio doesn't propose me to translate it and it's a problem. I wonder if there is a solution for this.

Secondly, I wanna know if that's possible to not have a language as reference since both french and english has to be translated and we translate the name of the property that we give to our page.

If I put French as reference language then I can't translate french JSON file that has to be translated.

Thanks

Parents Reply
  • So not a mixture... all of them are translated already?  So what do you mean by "put them in the SDLXLIFF"?  When you open the file with your custom filetype they will be in the SDLXLIFF.  So what EXACTLY do you mean?

    - do you want to edit the source and change it so that you have the original source in there?

    - do you already have files with a non-translated key and you want to create an SDLXLIFF that has both the translated and non-translated versions?

    You're really not helping here. If you just explained properly what you've got now, what you're attempting to do, and what you want at the end of it then I'm sure I can provide you with a better answer.

    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

Children
  • The example I gave is what my JSON looks like, the key is what to translate and the value is the translation. In SDL studio when I open the file for translating I want the key to be on the left side and the value on the right side. If a key already has already a translation, that means there is something in the value, so when I open the file for translating there should be the key on the left side and the translation on the right side. If the key has no value, that means there is no translation, then the right side should be empty.

    Is it enough clear? ^^'

  • Is it enough clear? ^^'

    Yes.

    If a key already has already a translation, that means there is something in the value, so when I open the file for translating there should be the key on the left side and the translation on the right side.

    This is not possible on the basis of you having the key on the left and the translated value on the right. The solution I gave you earlier will only allow you to translate the key as a monlingual file.  So the result will be a new file with a translated key but the actual translated content will be exactly the same as it was before translation.  Studio doesn't have a bilngual text filetype... I wish it did.

    A possible solution would be to use the Bilingual Excel filetype instead.  If you import into Excel (based on your simple example) and use colon as the delimiter you get this:

    Excel spreadsheet showing JSON structure with keys in column A and values in column B, including 'Name', 'Apple', and 'Orange'.

    Now open in Studio with these settings:

    Trados Studio options menu with selected file type settings for Bilingual Excel showing tag verification and path rules.

    Looks like this in Studio:

    Trados Studio interface displaying the translation of keys on the left and translated content on the right in a table format.

    Now you have the key on the left and the translated content on the right.  Translate the files, save the target to get a translated Excel file and then reverse the process to get your JSON file back.

    Bit of a workaround... maybe someone else has a better idea.

    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


    Generated Image Alt-Text
    [edited by: Trados AI at 9:34 PM (GMT 0) on 28 Feb 2024]