OmegaT: .TXT, .Strings segmentation
Thread poster: radruz

radruz  Identity Verified
Germany
Local time: 07:40
English to Spanish
+ ...
Sep 15, 2009

Hi everybody:

I hope somebody will be able to help me. I have downloaded OmegaT and I am trying to do a translation of a software application. The source text is a *.txt file that can be open with OmegaT, no problems until here.
I would like to be able to do two things:

1) filter part of the code in order to get/see only the text I need to translate. I give you an example:

-------------------------------------------------------------------------------
$saLang['texts']['header_profile'] = "Profil";
$saLang['texts']['header_friends'] = "Freunde";
$saLang['texts']['header_settings'] = "Einstellungen";
-------------------------------------------------------------------------------

What I would like to get ist only the text after the “=”, is there any possibility of making that happen? I don't know if am asking too much, but just in case prefere to give it a try.

2) modify the segments so that I get one word or sentence at a time, for example:

$saLang['texts']['header_profile'] = "Profil";


but with the changes I would like to implement in my first question, which would look like that:

“Profil”



Is that possible?? hopefully somebody out there faced the same problems and could solve them.

Thanks a lot

Rafael


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 07:40
Member (2006)
English to Afrikaans
+ ...
Are you... Sep 15, 2009

radruz wrote:
$saLang['texts']['header_profile'] = "Profil";
$saLang['texts']['header_friends'] = "Freunde";
$saLang['texts']['header_settings'] = "Einstellungen";


Read up in the OmegaT User Manal about how to add segmentation rules. Add the following two "*.txt" rules:

break: yes
before: [a-z]'\\]\\s+=\\s+\\"
after: .

break: yes
before: .
after: \\";

This will result in Profil, Freunde and Einstellungen being on separate lines, but unfortunately you'll still see the rest of the file, and OmegaT will offer them for translation (just press Ctrl+U to skip past them). It means you have to press Ctrl+U two or three times after each translation.




[Edited at 2009-09-15 12:24 GMT]


Direct link Reply with quote
 

radruz  Identity Verified
Germany
Local time: 07:40
English to Spanish
+ ...
TOPIC STARTER
Thanks a lot Sep 15, 2009

Hi Samuel,

thanks a lot for your answer, I tried what you told me the result is the following:


Hobbies";
$saLang['tags']['occupation'] = "


Beruf";
$saLang['tags']['likes'] = "


Ich finde gut";
$saLang['tags']['dislikes'] = "



The space between the "=" and the code has changed, I am not supossed to modify that.

Any way thanks a lot for your help

Kind regards

Rafael


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 07:40
Member (2006)
English to Afrikaans
+ ...
My guess... Sep 15, 2009

radruz wrote:
Hobbies";
$saLang['tags']['occupation'] = "

Beruf";
$saLang['tags']['likes'] = "


Well, it works for me. My guess is that the file you're trying to translate, uses different line endings than your system (or OmegaT does). Try it with either this:

break: yes
before: .
after: \\";\\n

or this:

break: yes
before: .
after: \\";\\r\\n

as the second rule. Also play around with Options > File Filters > Text Files > Options, if the above doesn't work.


Direct link Reply with quote
 

Didier Briel  Identity Verified
France
Local time: 07:40
Member (2007)
English to French
+ ...
Use the key=value filter Sep 15, 2009

radruz wrote:
1) filter part of the code in order to get/see only the text I need to translate. I give you an example:

-------------------------------------------------------------------------------
$saLang['texts']['header_profile'] = "Profil";
$saLang['texts']['header_friends'] = "Freunde";
$saLang['texts']['header_settings'] = "Einstellungen";
-------------------------------------------------------------------------------

What I would like to get ist only the text after the “=”, is there any possibility of making that happen? I don't know if am asking too much, but just in case prefere to give it a try.

2) modify the segments so that I get one word or sentence at a time, for example:

$saLang['texts']['header_profile'] = "Profil";


but with the changes I would like to implement in my first question, which would look like that:

“Profil”



Is that possible?? hopefully somebody out there faced the same problems and could solve them.

The Key=Value Text Files filter is designed to do that.
To use it, simply rename your file to your_file_name.ini

OmegaT will then present you the following segments:
"Profil";

"Freunde";

"Einstellungen";

Didier


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 07:40
Member (2006)
English to Afrikaans
+ ...
If I use the key=value filter... Sep 15, 2009

Didier Briel wrote:
The Key=Value Text Files filter is designed to do that.
To use it, simply rename your file to your_file_name.ini


That is also an option, yes. But I find it annoying to have to type quotes and a semi-colon manually in every segment. And the key=value filter replaces all white space between the equal sign and the first quotation mark with a single space (which might not be an issue for you).


Direct link Reply with quote
 


There is no moderator assigned specifically to this forum.
To report site rules violations or get help, please contact site staff »


OmegaT: .TXT, .Strings segmentation

Advanced search






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 SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
SDL MultiTerm 2017
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2017 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2017 you can automatically create term lists from your existing documentation to save time.

More info »



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