Json project shows 0 words Persoa que publicou o fío: Claudia Dornelles
|
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!

 | | | Clarisa Moraña Türkiye Local time: 06:52 Membro (2002) English to Spanish + ... | Dan Lucas United Kingdom Local time: 03:52 Membro (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 Netherlands Local time: 04:52 Membro (2006) English to Afrikaans + ...
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 | |
|
|
Claudia Dornelles Brazil Local time: 00:52 Membro (2020) English to Portuguese + ... INICIO DE TEMA | Stepan Konev Russian Federation Local time: 06:52 English to Russian | Samuel Murray Netherlands Local time: 04:52 Membro (2006) English to Afrikaans + ...
Claudia Dornelles wrote:
It looks like this when opened, which I believe is what a json file should look like:
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 United Kingdom Local time: 03:52 Membro (2014) Japanese to English
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 Netherlands Local time: 04:52 Membro (2006) English to Afrikaans + ...
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). | | | Claudia Dornelles Brazil Local time: 00:52 Membro (2020) English to Portuguese + ... INICIO DE TEMA 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 United Kingdom Local time: 03:52 Membro (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 Netherlands Local time: 04:52 Membro (2006) English to Afrikaans + ...
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 Brazil Local time: 00:52 Membro (2020) English to Portuguese + ... INICIO DE TEMA Thank you Dan & Samuel | Nov 14, 2022 |
You are life-savers | | | Dan Lucas United Kingdom Local time: 03:52 Membro (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! » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |