Automatically setting the target language in Word documents
Thread poster: xxx2nl
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
Jun 1, 2015

I modified a well-known macro in order to allow automatically setting the target language in Word documents that have been translated with CafeTran for Mac:

http://cafetran.wikidot.com/auto-setting-the-target-language-in-docx

Upon opening your translation, the correct target language (currently supported: DE, EN, FR, NL, ES, IT) is assigned to all textual elements of your target file.


Direct link Reply with quote
 

Michael Joseph Wdowiak Beijer  Identity Verified
United Kingdom
Local time: 22:43
Member (2009)
Dutch to English
+ ...
??? Jun 1, 2015

2nl wrote:

I modified a well-known macro in order to allow automatically setting the target language in Word documents that have been translated with CafeTran for Mac:

http://cafetran.wikidot.com/auto-setting-the-target-language-in-docx

Upon opening your translation, the correct target language (currently supported: DE, EN, FR, NL, ES, IT) is assigned to all textual elements of your target file.


Thanks for the macro Hans, but can we also have a little information on how to use it? Does it work in the Windows version of Word?


Direct link Reply with quote
 
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
TOPIC STARTER
How to run the macro Jun 1, 2015

Michael Beijer wrote:

Thanks for the macro Hans, but can we also have a little information on how to use it? Does it work in the Windows version of Word?


You are very welcome indeed.

You have to install the AutoOpen macro in ... the AutoOpen part of your normal.dotx. Add the line with the timer if the AutoOpen macro already exists (else add the complete AutoOpen macro). Install the second macro (see http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm). It should run on Windows too. It's more work for me to test this than for you, since I'd have to start Parallels first.

If you've installed both macros, every document that you open will be set to English automatically. How's that?


Direct link Reply with quote
 

Michael Joseph Wdowiak Beijer  Identity Verified
United Kingdom
Local time: 22:43
Member (2009)
Dutch to English
+ ...
Hmm, not very useful. Jun 1, 2015

2nl wrote:

Michael Beijer wrote:

Thanks for the macro Hans, but can we also have a little information on how to use it? Does it work in the Windows version of Word?


You are very welcome indeed.

You have to install the AutoOpen macro in ... the AutoOpen part of your normal.dotx. Add the line with the timer if the AutoOpen macro already exists (else add the complete AutoOpen macro). Install the second macro (see http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm). It should run on Windows too. It's more work for me to test this than for you, since I'd have to start Parallels first.

If you've installed both macros, every document that you open will be set to English automatically. How's that?


Every time I open a Dutch (nl-NL or nl-BE) source text from a client and want to do file prepping, this macro would change that to English?

It would be much better for CafeTran to just take the target language of the project and apply that to whatever it exports as a target document. How hard could that be to code for Igor? I admit that I know virtually nothing about Java and what this would actually mean in terms of coding, but it seems like it ought to be trivial.


Direct link Reply with quote
 
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
TOPIC STARTER
Only when the file name contains nl_NL Jun 1, 2015

Michael Beijer wrote:

Every time I open a Dutch (nl-NL or nl-BE) source text from a client and want to do file prepping, this macro would change that to English?



Only when the file name contains nl_NL the target language is changed to Dutch, etc.

[Edited at 2015-06-01 16:48 GMT]


Direct link Reply with quote
 

Michael Joseph Wdowiak Beijer  Identity Verified
United Kingdom
Local time: 22:43
Member (2009)
Dutch to English
+ ...
Not very satisfying. Jun 1, 2015

2nl wrote:

Michael Beijer wrote:

Every time I open a Dutch (nl-NL or nl-BE) source text from a client and want to do file prepping, this macro would change that to English?



Only when the file name contains nl_NL the target language is changed to Dutch, etc.

[Edited at 2015-06-01 16:48 GMT]


I often can't change the names of client files, and anyway, this would very quickly get very confusing (all this changing of file names to and between various languages).


Direct link Reply with quote
 
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
TOPIC STARTER
Duh Jun 1, 2015

Michael Beijer wrote:

I often can't change the names of client files, and anyway, this would very quickly get very confusing (all this changing of file names to and between various languages).


It's not the question whether YOU would like to change the name of the exported target file. CafeTran does so automatically: it adds _en-GB to it. It would be simple if you'd just give it a try. It's clever.


Direct link Reply with quote
 

Michael Joseph Wdowiak Beijer  Identity Verified
United Kingdom
Local time: 22:43
Member (2009)
Dutch to English
+ ...
Had dat dan allemaal wat eerder gezegd jongen! Jun 1, 2015

2nl wrote:

Michael Beijer wrote:

I often can't change the names of client files, and anyway, this would very quickly get very confusing (all this changing of file names to and between various languages).


It's not the question whether YOU would like to change the name of the exported target file. CafeTran does so automatically: it adds _en-GB to it. It would be simple if you'd just give it a try. It's clever.


Aha, in that case it might be useful.

A CT-based solution would obviously be much better, but I'll fiddle around with this until then. You can't really expect all CT users to (know how to or be able to) install a solution like this.

[Edited at 2015-06-01 17:26 GMT]


Direct link Reply with quote
 
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
TOPIC STARTER
Actually I designed it with you in mind Jun 1, 2015

Michael Beijer wrote:

You can't really expect all CT users to (know how to or be able to) install a solution like this.


Actually I designed it with you in mind.


Direct link Reply with quote
 

Michael Joseph Wdowiak Beijer  Identity Verified
United Kingdom
Local time: 22:43
Member (2009)
Dutch to English
+ ...
same macro as "LangID" function in CodeZapper Jun 1, 2015

Interesting, the macro you posted is the exact same one used in CodeZapper's "LangID" function:

"LangID: Set language throughout document (all story ranges). Enter the LanguageID code in the input box displayed: 1036 = French, 1043 = Dutch, 1033 = EnglishUS, 2057 = EnglishUK, 1034 = Spanish, 1031 = German, 1040 = Italian, 1053 = Swedish, 1041 = Japanese, 1038 = Hungarian, 1037 = Hebrew, 1032 = Greek, etc. See: http://msdn.microsoft.com/en-us/library/bb213877.aspx"

src: Readme CodeZapper 2_9_4.doc + http://asap-traduction.com/CodeZapper

Michael

[Edited at 2015-06-02 00:17 GMT]


Direct link Reply with quote
 
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
TOPIC STARTER
I wouldn't say that Jun 2, 2015

It's not the same. It's similar. But there are differences. CZ doesn't work in Word for Mac and the macro that I have posted doesn't require human input (once installed). It recognizes your target language based on the language code in the name of the document that you exported from CT.

Direct link Reply with quote
 
xxx2nl  Identity Verified
Netherlands
Local time: 23:43
TOPIC STARTER
Solved in CafeTran! Jun 4, 2015

As of June 3, 2015 CafeTran automatically sets the target language in all stories (headers, footers, text boxes etc.) in MS Word documents.

Source document:



In the target document all stories have the correct target language assigned:



[Edited at 2015-06-04 06:47 GMT]


Direct link Reply with quote
 


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

Moderator(s) of this forum
Natalie[Call to this topic]

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

Automatically setting the target language in Word documents

Advanced search






PDF Translation - the Easy Way
TransPDF converts your PDFs to XLIFF ready for professional translation.

TransPDF converts your PDFs to XLIFF ready for professional translation. It also puts your translations back into the PDF to make new PDFs. Quicker and more accurate than hand-editing PDF. Includes free use of Infix PDF Editor with your translated PDFs.

More info »
WordFinder
The words you want Anywhere, Anytime

WordFinder is the market's fastest and easiest way of finding the right word, term, translation or synonym in one or more dictionaries. In our assortment you can choose among more than 120 dictionaries in 15 languages from leading publishers.

More info »



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