Json project shows 0 words De persoon die dit onderwerp heeft geplaatst: 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 Verenigde Staten Local time: 00:58 Lid 2002 Engels naar Spaans + ... | Dan Lucas Verenigd Koninkrijk Local time: 06:58 Lid 2014 Japans naar Engels 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 Nederland Local time: 07:58 Lid 2006 Engels naar 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 Brazilië Local time: 03:58 Lid 2020 Engels naar Portugees + ... ONDERWERPSTARTER | | Samuel Murray Nederland Local time: 07:58 Lid 2006 Engels naar 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 Verenigd Koninkrijk Local time: 06:58 Lid 2014 Japans naar Engels
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 Nederland Local time: 07:58 Lid 2006 Engels naar 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 Brazilië Local time: 03:58 Lid 2020 Engels naar Portugees + ... ONDERWERPSTARTER 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 Verenigd Koninkrijk Local time: 06:58 Lid 2014 Japans naar Engels 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 Nederland Local time: 07:58 Lid 2006 Engels naar 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 Brazilië Local time: 03:58 Lid 2020 Engels naar Portugees + ... ONDERWERPSTARTER Thank you Dan & Samuel | Nov 14, 2022 |
You are life-savers | | | Dan Lucas Verenigd Koninkrijk Local time: 06:58 Lid 2014 Japans naar Engels 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 Anycount & Translation Office 3000 | Translation Office 3000
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
More info » |
| Protemos translation business management system | Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!
The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |