Pages in topic:   < [1 2]
Microsoft Office foreign language proofing tools - any good?
Thread poster: Libero_Lang_Lab
wotswot
wotswot  Identity Verified
France
Local time: 02:20
Member (2011)
French to English
My macro for setting language Apr 4, 2012

Hi all,

Here's my take on this. My macro sets the language of EITHER the selection (if length thereof > 0) OR the whole document (all StoryRanges) if selection length equals zero.

In the latter case, it also (optionally) tags the filename with a user-defined suffix (in my case EN-gb).

Typically (if translating in Word), I open the source doc (French in my case) and click my UK button, which:
1. Sets the entire doc to English UK (including text boxes,
... See more
Hi all,

Here's my take on this. My macro sets the language of EITHER the selection (if length thereof > 0) OR the whole document (all StoryRanges) if selection length equals zero.

In the latter case, it also (optionally) tags the filename with a user-defined suffix (in my case EN-gb).

Typically (if translating in Word), I open the source doc (French in my case) and click my UK button, which:
1. Sets the entire doc to English UK (including text boxes, footnotes, etc.)
2. Renames and saves the doc (e.g. Test.doc saved as Test EN-gb.doc)

If I subsequently and inadvertently click my UK button when Selection.Length = 0, thankfully nothing happens (the filename isn't "retagged"), because the macro knows it's already tagged.

I also have an FR button, which enables me to reset certain phrases, names of organizations, etc., back to French; I just select them then click the FR button. Since this works on the above principle (selection length > 0), only that phrase is marked French. This can save a lot of time on the spell-check.

If you're interested, here's the code:

http://www.wot.fr/get.php/App_RenameSaveDocs.bas

NB: you will have to comment out or recode certain lines containing names of my custom functions residing in other modules (not provided), but it gives you the general logic.
Collapse


 
Rolf Keller
Rolf Keller
Germany
Local time: 02:20
English to German
Language macro again Apr 4, 2012

Tony M wrote:

Is it at all possible you could either share with us an EN version of that, or tell use which bits to change


Word macros are language independent but may contain some words in the programmer's native language. The computer does'nt mind that, but human readers do. The following version is more readable for English speakers.

The first part (between the AAAAAAAAAAAA and ZZZZZZZZZZZZ lines) must be adapted to the user's needs. I put two snippets for your languages in there. You may insert similar snippets for any language(s). These snippets are the macros you have to call. All the rest (after the ZZZZZZZZZZZZZZZZ line) makes the snippets work - dont' t change it.

' AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
' Examples for English and French

' For other languages use "wd..." from the following list:
' http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.wdlanguageid(v=office.11).aspx

Public Sub SetEnglishUK()
SetLanguage (wdEnglishUK)
End Sub


Public Sub SetFrench()
SetLanguage (wdFrench)
End Sub

' ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Public Sub SetLanguage(LANG_ID As Long)

Dim COMPONENT As Range, STYLE As STYLE

' Step 1: Set the LanguageID property of the Standard style
ActiveDocument.Styles("Standard").LanguageID = LANG_ID
ActiveDocument.Styles("Standard").NoProofing = False
Application.CheckLanguage = False

' Step 2: Set the LanguageID property of all styles of the active document
On Error Resume Next ' Because some styles have no LanguageID property
For Each STYLE In ActiveDocument.Styles
  STYLE.LanguageID = LANG_ID
  STYLE.NoProofing = False
Next STYLE
On Error GoTo 0

' Step 3: Set the LanguageID property of all components of the active document
For Each COMPONENT In ActiveDocument.StoryRanges
  COMPONENT.LanguageID = LANG_ID
  COMPONENT.NoProofing = False

  While Not (COMPONENT.NextStoryRange Is Nothing) ' goto next text area
    Set COMPONENT = COMPONENT.NextStoryRange
    COMPONENT.LanguageID = LANG_ID
    COMPONENT.NoProofing = False
  Wend

Next COMPONENT

End Sub
' =============================================


 
Pages in topic:   < [1 2]


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


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

Microsoft Office foreign language proofing tools - any good?






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

Buy now! »
Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »