How can we help you today?

Soft returns in "Find and Replace" window

alain

started a topic
over 3 years ago

Hi,

I can type soft returns in CT's editor pane, but I can't in the "Find and Replace" window...

For some reason CT inserts hard returns instead of soft ones when it gives a perfect match. I have hundreds of soft returns in my source segments and I need to replace them one by one manually each and every time in the target perfect matches... (my files are Excel files converted to sdlxliff by the client). In Studio the leading and trailing returns are excluded from the Editor's segments, but for some reason they are not in CT. :-(

So... any suggestion to quickly replace all the hard returns to soft ones in CT?

woorden

said
over 3 years ago

Errr.... a regex. Unfortunately, I don't know how they work in CT (apparently you'll need the Java flavour), but I suppose you'll have to search for a return followed by an undercast character. The return can be something like \r or \n or \r\n, whereas the following character probably will be represented by [a-z]. Replace by a space. Perform the action in the S/R box, for SL, regex enabled.

Actually, I'd close/quit the project, open the SDLXLIFF in TextWrangler, perform the action (with "Show invisibles" activated so you'll see what you're doing), and start a new CT project with the cleaned file.

For real advise, you'll have to wait till the genuine regex experts are up and awake, I'm afraid.

H.

alain

said
over 3 years ago

Hi woorden,

I will wait for Igor's advice, and try with TextWrangler if there is no other solution. By the way, are you sure that TextWrangler uses soft returns? I tried to replace hard with soft returns yesterday, and it was not possible (at least for me). The other problem is that I need to work only on the target segments inside CT, to make sure I don't replace anything in the source segments.

w

woorden

said
over 3 years ago

AC: I will wait for Igor's advice

Hmmm, I was thinking of the real RegExperts...

By the way, are you sure that TextWrangler uses soft returns?

I don't think you can "use" soft returns at all. They just happen, and are reflected by "returns". That's why I wondered how you can "typ soft returns in CT." I don't think you can.

I need to work only on the target segments inside CT

Oops. In that case you can't use TextWrangler, I think (not without making things - read: the regex - extremely difficult). You'd have to use the S/R box in CT. That's waaaay beyond me.

H.

alain

said
over 3 years ago

Indeed I can insert soft returns in the editor's pane, with shift-fn + space.

Screenshot of a soft one, followed by a hard one. But it doesn't work in the Find and Replace window.

w

woorden

said
over 3 years ago

Even if one is very old, one learns every day.

H.

w

woorden

said
over 3 years ago

AC: But it doesn't work in the Find and Replace window.

Doesn't work in TW either. Nor in TextEdit. You may need the unicode, which is probably 0x2028. Or something else, of course (can't really check, because I can't typ it. You can).

H.

alain

said
over 3 years ago

woorden: can't really check, because I can't typ it. You can

Where do you want me to type it? (confused)

w

woorden

said
over 3 years ago

Where do you want me to type it?

I told you, wait for the experts. I use KeyCodes, but I don't guarantee a thing.

H. (also confused as always if it concerns regexes, scripting, or anything else having to do with computers)

alain

woorden

Hans CafeTran Wiki

said
over 3 years ago

I'm trying to understand what you are meaning here. This is my attempt. In Excel the segments are surrounded by NewLines:

(These NewLines are inserted via Ctrl+Option+Enter.)

Studio doesn't take these surrounding NewLines into the segment, CafeTran does. They are hindering you with both FMs and during editing in CafeTran's Translation Editor. So you want to get them out there too.

It looks to me that this will require a modification to the way CafeTran interprets SDLXLIFF, or even a second flavour of the interpretation to stay on the safe side (not to break the current implementation).

As a work-around I could imagine using a bilingual review table. How does that look in CafeTran for this particular project?

Re: regular expressions, I have no idea.

alain

said
over 3 years ago

Thank you Hans, you understood my problem :-)

I tried a few things in TextWrangler, but nothing works. I also noticed that some soft returns (of the source sdlxliff file) are dislpayed as an upside-down question mark in TextWrangler, and that most display simply as return signs. Don't know why.

To be safe, here is what I did finally:

Completed the translation in CT

Reopened the package from scratch in Studio

Imported the tmx created by CT

It worked, the leading and trailing returns are ignored and I get 100% matches for almost all segments.

It would have been a pain in the XXX if my segments contained lots of tags, but they don't. So I'm will simply reviewing my translation in Studio, to make sure that the all the returns (hard, soft or wathever they are) stay untouched between the segments.

w

woorden

said
over 3 years ago

AC: Reopened the package from scratch in Studio

That's not what I want. I don't have Studio (God forbid), and I don't use Windows (God forbid). Could this solve the problem?

H.

alain

said
over 3 years ago

woorden: Could this solve the problem?

Mysterious woorden, where does this menu come from? I don't see it in TextWrangler. BBedit?