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

radruz  Identity Verified
Germany
Local time: 00:00
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: 00:00
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: 00:00
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: 00:00
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: 00:00
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: 00:00
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






PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »
Across v6.3
Translation Toolkit and Sales Potential under One Roof

Apart from features that enable you to translate more efficiently, the new Across Translator Edition v6.3 comprises your crossMarket membership. The new online network for Across users assists you in exploring new sales potential and generating revenue.

More info »



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