Json project shows 0 words
Thread poster: Claudia Dornelles
Claudia Dornelles
Claudia Dornelles  Identity Verified
Brazil
Local time: 14:14
Member (2020)
English to Portuguese
+ ...
Nov 11, 2022

Hi!

I created a project with a json file in Trados 2021, but when I try to open it, it shows 0 words.

I'm an absolute beginner with Trados and have had no luck with their tutorials so far, so please talk to me like I'm 5.

Thank you!

Trados Studio - Project 7 11_11_2022 18_59_33

Trados Studio - Project 7 11_11_2022 18_58_52


 
Clarisa Moraña
Clarisa Moraña  Identity Verified
United States
Local time: 12:14
Member (2002)
English to Spanish
+ ...
Save your source file to a Trados supported format Nov 12, 2022

I¿'ve never used json but I don't think it's a file format supported by tTrados. Check file formats here: ps://gateway.sdl.com/apex/communityknowledge?articleName=000013699

I recommend you to export the fille to another Trados-supported format.


 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 18:14
Member (2014)
Japanese to English
More detail please Nov 12, 2022

Claudia, can you describe in more detail exactly what file or files you start with, and what you are doing with them? "Client gave me a file in XX format. I started Trados and did YY, then ZZ." That sort of thing.

I agree with Clarisa that JSON would be an unusual source format for most translators to be working on, as it is typically be used for settings and so on. If you're working on a localisation project it would certainly be a possibility, but it's impossible to tell from the
... See more
Claudia, can you describe in more detail exactly what file or files you start with, and what you are doing with them? "Client gave me a file in XX format. I started Trados and did YY, then ZZ." That sort of thing.

I agree with Clarisa that JSON would be an unusual source format for most translators to be working on, as it is typically be used for settings and so on. If you're working on a localisation project it would certainly be a possibility, but it's impossible to tell from the information you have provided.

Regards,
Dan
Collapse


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:14
Member (2006)
English to Afrikaans
+ ...
JSON Nov 12, 2022

Well, Trados does support JSON. And although JSON can be used to store settings, it can also be used to store content. Not all JSON files have translatable content, though.

I'm also not sure how comprehensive Trados' support for JSON files is (it may work with only a certain type of JSON file).

Also, could it be that the JSON file that the client sent you is not a real JSON file even though it has the ".json" file extension? If you open the JSON file in e.g. Note
... See more
Well, Trados does support JSON. And although JSON can be used to store settings, it can also be used to store content. Not all JSON files have translatable content, though.

I'm also not sure how comprehensive Trados' support for JSON files is (it may work with only a certain type of JSON file).

Also, could it be that the JSON file that the client sent you is not a real JSON file even though it has the ".json" file extension? If you open the JSON file in e.g. Notepad, does it look more or less like what a JSON file should look like?

How many words does the client believe there should be in that JSON file?
Collapse


Dan Lucas
 
Claudia Dornelles
Claudia Dornelles  Identity Verified
Brazil
Local time: 14:14
Member (2020)
English to Portuguese
+ ...
TOPIC STARTER
Thank you all for the replies Nov 12, 2022

The file is the user interface of a type of fitness equipment, sent by the client, word count 5620 according to MS Word:

Nova pasta 12_11_2022 09_26_16


It looks like this when opened, which I believe is what a json file should look like:

lang - WordPad


In Trados, I followed the 7 steps to create and prepare a new local project as usual -- select file, customer name, term base, etc:

Create a New Project - Preparation 12_11_2022 09_10_21

Trados Studio - Lang 12_11_2022 09_13_19

Everything seems fine up until this point, then I see the empty translation editor in my original post. What am I missing?


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 20:14
English to Russian
RWS Community Nov 12, 2022

Try to post your question at the RWS Community forum. You can use this link: https://community.rws.com/product-groups/trados-portfolio/trados-studio/f/studio/p/addpost
Also, you may want to rea
... See more
Try to post your question at the RWS Community forum. You can use this link: https://community.rws.com/product-groups/trados-portfolio/trados-studio/f/studio/p/addpost
Also, you may want to read this thread for example, notably what Paul recommends there (attach a test file for them to better understand your issue). Don't add your question in the same existing thread. Instead, use the above link to create a new one.
Collapse


Dan Lucas
 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:14
Member (2006)
English to Afrikaans
+ ...
@Claudia Nov 12, 2022

Claudia Dornelles wrote:
It looks like this when opened, which I believe is what a json file should look like:

lang - WordPad

I'm not an expert, but if I understand correctly, a JSON file usually looks like this:

"segment ID": "source text"

...which, when translated, will look like this:

"segment ID": "target text"

Trados is looking for the source text inside the second pair of quotes, which in your particular JSON file is empty. The creator of your JSON file decided to use the source text as the segment ID... which is not a problem, but he should have put the translatable source text between the second pair of quotes. It would be weird for Trados to treat the segment ID as translatable text. I'm not sure if it would be possible to hack Trados into doing that.

I tested this JSON file in four tools (WFP7, OmegaT, Trados and MemoQ):

{
"fruit": "banana",
"vegetable": "carrot",
"tree": "pine",
"flower": "rose"
}

...and all four of them considered banana, carrot, pine and rose to be the translatable text.

Do you know how to use fancy find/replace in some other text editor to put the source text of each segment into the second pair of quotes?

[Edited at 2022-11-12 14:00 GMT]


 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 18:14
Member (2014)
Japanese to English
One option Nov 12, 2022

Samuel Murray wrote:
Do you know how to use fancy find/replace in some other text editor to put the source text of each segment into the second pair of quotes?

Thanks for this Samuel. I used your example JSON text as a base to put together this, which seems to work.

Find regex

^"(.*)": "",$

Replace regex

"": "$1",

May need some tweaking for the editor in question, given that the above is the .NET flavour of regex. In either case, as you say, depends on how technically minded the OP is, and whether she is willing to have a go.

Dan


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:14
Member (2006)
English to Afrikaans
+ ...
@Dan Nov 13, 2022

Dan Lucas wrote:
^"(.*)": "",$

Just remember, the last segment before a closing bracket doesn't end on a comma (I'm not sure what some CAT tools will do with the file if you add a comma, but OmegaT for one will refuse to open the file).


Dan Lucas
 
Claudia Dornelles
Claudia Dornelles  Identity Verified
Brazil
Local time: 14:14
Member (2020)
English to Portuguese
+ ...
TOPIC STARTER
The OP is not very technically minded, but she is willing to have a go Nov 13, 2022

Dan Lucas wrote:

Samuel Murray wrote:
Do you know how to use fancy find/replace in some other text editor to put the source text of each segment into the second pair of quotes?

Thanks for this Samuel. I used your example JSON text as a base to put together this, which seems to work.

Find regex

^"(.*)": "",$

Replace regex

"": "$1",

May need some tweaking for the editor in question, given that the above is the .NET flavour of regex. In either case, as you say, depends on how technically minded the OP is, and whether she is willing to have a go.

Dan



Could you walk me through how to do this fancy find/replace?

Many thanks again!


 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 18:14
Member (2014)
Japanese to English
Working on it Nov 14, 2022

Claudia Dornelles wrote:
Could you walk me through how to do this fancy find/replace?

Claudia, I appreciate your willingness to give it a go. I'm having difficulty finding a free editor that can do the job. Notepad++ is a bit idiosyncratic for regexes.

Dan


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 19:14
Member (2006)
English to Afrikaans
+ ...
@Dan Nov 14, 2022

Dan Lucas wrote:
^"(.*)": "",$

This regex also makes certain assumptions about the OP's file. While the sample that she showed seems to follow this pattern, it's not unlikely that some parts of the JSON file may not be as consistent in its use of line breaks and spacing. I've seen localization files that have both consistent and inconsistent portions in the same file. The JSON format ignores all horizontal and vertical whitespace outside of quotes, so there may be one space, two spaces, a tab, or even a line break after the first quote (or before or after the comma); and many JSON files that I have seen, don't use any line breaks between segments at all (all of the content is on a single, long line). We can hope that the OP's file has a consistent format, but anything can happen.


 
Claudia Dornelles
Claudia Dornelles  Identity Verified
Brazil
Local time: 14:14
Member (2020)
English to Portuguese
+ ...
TOPIC STARTER
Thank you Dan & Samuel Nov 14, 2022

You are life-savers

 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 18:14
Member (2014)
Japanese to English
Now you have two problems Nov 14, 2022

Samuel Murray wrote:
We can hope that the OP's file has a consistent format, but anything can happen.

All fair points. Regular expressions can be tricky at the best of times, and this one was thrown together in a hurry and only minimally tested, so it is likely quite fragile.

In the end I decided that using the json module in python would probably result in a more robust solution. I sent a small and crude python script to the OP and it seems to have worked for her, so the problem is (hopefully) no more.

I wouldn't have investigated at all if you hadn't demonstrated that Trados should be able to handle the JSON, so thank you for that.

Regards,
Dan


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Json project shows 0 words







Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »