Search and replace tags?
Thread poster: Felipe Lacerda

Felipe Lacerda  Identity Verified
Brazil
Local time: 10:01
English to Portuguese
Mar 5, 2015

Yes, I know SDL Batch Find and Replace but, no, it doesn't replace tags. You can find them on the second tab (Find) but not on the third one (Replace).

Is there any option?


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 13:01
English
Only to use a text editor... Mar 6, 2015

... in the sdlxliff.

We did have tags in that application when we first released it. But it was problematic and causing problems for users so I asked the developer to remove it unless he could make it bomb-proof. We may add this back at some point but only when we have been able to devote enough time to it so it's reliable.

Regards

Paul
SDL Community Support


Direct link Reply with quote
 

Felipe Lacerda  Identity Verified
Brazil
Local time: 10:01
English to Portuguese
TOPIC STARTER
Tried that too Mar 6, 2015

Thanks, Paul!

I have tried that before as well but, unfortunately, it doesn't work. File ends up corrupted and Studio won't open it.


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 13:01
English
I guess it depends... Mar 6, 2015

Felipe Lacerda wrote:

Thanks, Paul!

I have tried that before as well but, unfortunately, it doesn't work. File ends up corrupted and Studio won't open it.


... on what you replace!! It is possible but requires care and knowledge of what you are changing. What are you trying to achieve?

Regards

Paul
SDL Community Support


Direct link Reply with quote
 

Felipe Lacerda  Identity Verified
Brazil
Local time: 10:01
English to Portuguese
TOPIC STARTER
... Mar 6, 2015

There's this tag ;& n b sp (withou spaces) that is not adding a space and messed up the whole target. So I'm intend to replace:
;& n b sp

For
;  (with space)

I did that in a text editor and took care to replace only in target but it just didn't work. I tried on Wordpad, by the way. Are there any specific settings/details I should consider when saving the file?

Felipe

[Edited at 2015-03-06 13:20 GMT]


Direct link Reply with quote
 

Dan Lucas  Identity Verified
United Kingdom
Local time: 12:01
Member (2014)
Japanese to English
XML search and replace potentially fruitful Mar 6, 2015

Felipe Lacerda wrote:
There's this tag ;& n b sp (withou spaces) that is not adding a space and messed up the whole target.

I must thank Felipe for his posts, because I was looking at an sdlxliff file yesterday wondering why I couldn't just use grep on it to replace tags. If we can get the technique down the possibilities are endless.

Paul, we wait with bated breath...

Dan


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 13:01
English
ok - let's think about this first. Mar 6, 2015

Hi Felipe,

You didn't mention your source filetype, and this is important for a couple of reasons. First of all the tags are different depending on the filetype, and secondly if it's a Word document for example then you might not need to do this at all.

So first of all think about the latter. If you use the option to "Treat special characters as inline placeholder tags" then then the non-breaking spaces in Word will be converted to tags. If you don't, then by showing formatting marks in the Studio editor they will look exactly like they do in Word. Just a space represented by a small elevated circle as opposed to the normal dot.

If the filetype is Word and you used the option to make these tags then the replace action is going to be tricky. For example, if the first inline tag was such a character then it will be represented by something like this:

<x id="1" />

Then somewhere else in the file there will be a reference to this particular Tag ID that contains more information to tell Studio how this should be displayed in different modes. The next non-breaking space could be this:

<x id="2" />

But what you can't see is this one was actually an optional hyphen. The instructions to Studio were in a different section. So in order to remove these in the sdlxliff you'd need to do two things. First look up the Tag IDs and see which ones were the non-breaking spaces and then remember the TagID in a back reference so you could delete the right one in the text itself. If the only inline tags you have are non-breaking spaces then it could be simple.

The good news is that removing this in the target section only is enough, and in my quick tests the file still saves as target because these are only formatting and not important.

<x id="1" />

But you do need to know which ones to delete or you could make a real mess of the file which is why the proper look up is important. Probably better handled with a perl script or something like that.

You'll also get lots of tag errors of course.

Maybe this helps you a little... but if you try this make sure you back up your original files. It's very easy to make a mess when you do this as it's completely uncontrolled. Hopefully this will also explain why search replacing ;& n b s p (without spaces) is a waste of time in this file.

What was your source filetype?

Just to finish... far better to manage all of this via the API. Perhaps you can list all the reasons why you want to do things like that and then we might be able to look at adding something controlled and useful into the SDLXLIFF Toolkit so this sort of thing can be done in a controlled and careful manner.

Regards

Paul
SDL Community Support


Direct link Reply with quote
 

Dan Lucas  Identity Verified
United Kingdom
Local time: 12:01
Member (2014)
Japanese to English
Yes, but when? Mar 6, 2015

SDL Community wrote:
Just to finish... far better to manage all of this via the API.

Paul, thanks for that, it was educational.

The only thing I wasn't sure about was the conclusion! No company has unlimited resources, so if it can be done by users, so much the better. It could be years, literally, before such a function is added given the existence of competing requests for other users.

I really need to understand the whole XML ecosystem a bit better than I do. Time to go back and re-read the XML Visual Quickstart Guide; perhaps I'll understand it better this time...

Dan


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 13:01
English
That's why I suggested the SDLXLIFF Toolkit... Mar 6, 2015

Dan Lucas wrote:

SDL Community wrote:
Just to finish... far better to manage all of this via the API.

Paul, thanks for that, it was educational.

The only thing I wasn't sure about was the conclusion! No company has unlimited resources, so if it can be done by users, so much the better. It could be years, literally, before such a function is added given the existence of competing requests for other users.

I really need to understand the whole XML ecosystem a bit better than I do. Time to go back and re-read the XML Visual Quickstart Guide; perhaps I'll understand it better this time...

Dan


... as we have a dedicated developer, dedicated not just because he is focused on the OpenExchange but he really is dedicated! The toolkit was originally built to allow what you need but the original developer had some problems with this and as I had limited budget at the time I had to cut a few things to get a useful working application. This was one of the things I cut.

So we could look at this again, but before we do I'd like to understand the usecases properly so we don't try and provide an overengineered solution when we don't need to. Might be more feasible and quick.

Of course don't let that stop you!! The more developers the better and the APIs are all very open and accessible. You can ask questions in here if you're interested:

https://community.sdl.com/developers/studio-developers/

Regards

Paul
SDL Community Support


Direct link Reply with quote
 
nixcalo
Local time: 13:01
Spanish to English
+ ...
An example Jul 29, 2016

This is my third attempt to post as I am including tags and it messes the post. Let's see if I get it right now! I will write the tags in brackets instead of < and >!

Sorry Paul for joining this post so late, but I can give you a useful example to why it might be useful to do this (change tags, search and replace tags. etc.)

I have a large text in SDLXLIFF format. The text has a lot of hyphens (en-dash) used as parentheses, for example...
"The authors -Allen, Johns and Weaver- are naught but..."

The problem is twofold. First, the text uses En dashes, but instead of using the alphanumeric sign, it uses a tag (namely, [char name="En Dash"/]) for each occurrence.

My second problem is that usage (En Dash as a parenthesis) is not used in Spanish. We use parentheses instead, or commas at most.

So you can see my problem. I have to search a huge text for the En Dash tags (I can't use Trados for that, as I can't filter by tags or search within tags). I use SDL Batch and Replace, but it's awful, as I can find the tags, but can't edit them. So I have to search the tags, copy the sentence, paste in in Find dialog in Trados, locate the En Dash tag, and change it for a parenthesis.

Repeat that procedure a million times and you are screwed. Any ideas or solutions?
Using a text editor is not useful since, as you said, in text format the [char name="En Dash"/] tag is changedt o an obscure [x id="252" /].

Another problem with tags is that Trados finds a difference between [cf bold="True"] and [cf bold="true"]. That is a nightmare because you get [cf bold="true"] in the target when you press Ctrl+B, while the source text uses [cf bold="True"] as a direct interpretation of boldcase in Word.

So when verifying, the QA Checker finds a million errors because the translator simply used Ctrl+B to write a name in boldcase, instead of copying the tags from the source (which usually involves CTRL-ALT-Down arrow).

If I could find a way to tell Trados that [cf bold="true"] and [cf bold="True"] are identical, or a find to way to change all [cf bold="true"> to [cf bold="True"], my life would be infinitely easier.

So any ideas on how to solve these issues? In Trados 2015, I haven't found it.

Thanks!

[Editado a las 2016-07-29 18:34 GMT]


Direct link Reply with quote
 


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


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

Search and replace tags?

Advanced search







LSP.expert
You’re a freelance translator? LSP.expert helps you manage your daily translation jobs. It’s easy, fast and secure.

How about you start tracking translation jobs and sending invoices in minutes? You can also manage your clients and generate reports about your business activities. So you always keep a clear view on your planning, AND you get a free 30 day trial period!

More info »
BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search