Extract & translate nested sentences in .INI files
Thread poster: Joris Bogaert
Joris Bogaert
Joris Bogaert  Identity Verified
Italy
Local time: 21:28
Italian to Dutch
+ ...
Aug 18, 2009

Hello,

Sorry for my English, I mainly translate Italian>Dutch.
I need to translate about 200 small ini.files which can be opened with Bloc note.
Such files cannot be opened with SDL Trados 2007, so I found a program INI Translator (http://initranslator.sourceforge.net/wiki/index.php/Main_Page) in order to work within a program that unfortunately does
... See more
Hello,

Sorry for my English, I mainly translate Italian>Dutch.
I need to translate about 200 small ini.files which can be opened with Bloc note.
Such files cannot be opened with SDL Trados 2007, so I found a program INI Translator (http://initranslator.sourceforge.net/wiki/index.php/Main_Page) in order to work within a program that unfortunately does not offer CAT-options.

The sentences I need to translate are all between "..", ex.:
yes_label="Yes"
I only need to translate "Yes".

Is there any macro or other way to extract the text between ".." for all those files, then translate (prefer. with a CAT - I have SDL Trados 2007) and then reinsert the text using some batch command?

Another solution could be a batch command that converts all INI files to a CAT-compatible format and then reconvert to INI. I tried to do so using TXT collector, I obtained 1 big TXT file that I converted to word, but I still need to extract the text between "..". Forthermore, I need to copy and past the translation from within word in all .ini files after translation.

Does anyone know a way to make this job easier and less time-consuming?

Thanks a lot!

Joris
Collapse


 
Jaroslaw Michalak
Jaroslaw Michalak  Identity Verified
Poland
Local time: 21:28
Member (2004)
English to Polish
SITE LOCALIZER
Regular expressions Aug 18, 2009

You need to use the Regular Expression filter, check this post:

http://www.proz.com/forum/sdl_trados_support/136105-text_file_parsing_tutorials_training_or_tips.html#1133954


 
Joris Bogaert
Joris Bogaert  Identity Verified
Italy
Local time: 21:28
Italian to Dutch
+ ...
TOPIC STARTER
Great! Aug 18, 2009

Thanks Jabberwock,

this is a great solution! I did as you mentioned and it worked fine, I just need to define better the opening and closing patterns, great!

Thanks again!
Joris


 
Lori Cirefice
Lori Cirefice  Identity Verified
France
Local time: 21:28
French to English
Preptags Aug 18, 2009

I would imagine Preptags could be used to prepare this kind of file as well. Probably easier than a tutorial on regular expressions? Just a thought.

 
heikeb
heikeb  Identity Verified
Ireland
Local time: 20:28
Member (2003)
English to German
+ ...
Word Aug 19, 2009

You could also rename the .ini files as .txt, open them in Word and convert into a two-column table, using the = as delimiter. Then just translate the right column in Trados.

Reverse these steps to get back to your .ini files.


Or you could just define the equal sign as segmentation character in Trados. Then you can just insert source in the first half and translate the second half in Trados. That's my preferred MO for small files.


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 21:28
Member (2006)
English to Afrikaans
+ ...
Use RTF styling and translate with Trados Aug 19, 2009

Joris Bogaert wrote:
The sentences I need to translate are all between "..", ex.:
yes_label="Yes"
I only need to translate "Yes".


Piece of cake, if you can use MS Word's regex find/replace system and if you have the style "tw4winExternal" in MS Word. Since you have lots of files, perhaps you should record a macro and assign a keyboard shortcut to it (but this is optional). Your INI file seems fairly regular so you should be able to do it in very few steps:

1. Find: ^p
Replace: ^l
(this is so that you can use line breaks in regular expressions)

2. Find: (\"^l)(*)(=\")
Replace: (nothing, but click "More options", then Formatting, then Style, and select the tw4winWinExternal style. make sure the "replace" box has the style. if you make a mistake, click "No formatting" and try again.)
Oh, and put a check in the checkbox "regular expressions".

3. Find: ^l
Replace: ^p
(without checkbox "regular expressions")

Another method is to use Excel. Sometimes when you open the file in Excel, you can usually select the delimiter, so select "=". If Excel doesn't ask for a delimiter, there is a way to make it ask for it (not sure how).

Another method is to open the file in MS Word and then do:

1. Find: ="
Replace: ="^t

2. Find: "^p
Replace: ^t"^p

...and then translate the whole thing in Trados (while skipping certain sections). When you're done with the translation, do:

3. Find: ^t
Replace: (nothing)

The above suggestions all assume your INI file is fairly regular. You may need to fiddle with each file for some lines of text.


 
Hermann Bruns
Hermann Bruns  Identity Verified
Local time: 21:28
English to German
MetaTexis has special filter Aug 23, 2009

Hello,

MetaTexis, a translation memory tool that runs in Word, has a special filter for text files of the kind you need to translate. You can download a trial version here: www.metatexis.com.

Best regards
Hermann


 
Joris Bogaert
Joris Bogaert  Identity Verified
Italy
Local time: 21:28
Italian to Dutch
+ ...
TOPIC STARTER
Thanks! Aug 23, 2009

Thanks for your replies, all great solutions, especially those mentioned by Jabberwock and Samuel! It worked out.

Thanks again,

Joris


 


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


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

Extract & translate nested sentences in .INI files







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 »
Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »