Skip navigation
Currently Being Moderated

changing language with one click

Jan 24, 2012 2:43 AM

We often make coproductions, and it is really a pain to get all stylelables to the Dutch language. It would be nice to have a saveoption to change original (often English) language into other (in my case Dutch) language, without changing all stylelabels one by one.

 
Replies
  • Currently Being Moderated
    Jan 24, 2012 3:02 AM   in reply to designer1955

    Language is a character-level attribute and I suspect you already know that changing the language changes which dictionary is used for both spelling and hyphenation rules. The big advantage to keeping it at the character level is that you can, in fact, assign language as part of a style in order to mark "foreign" words with the correct dictionary when they appear in other text. If you do this with a character style that only assigns the language you can change the font specifications in the underlying paragraph style and your "foreign words" will also change, and you'll have no need for a local format override.

     

    That said, I can see where if you get a file that was created with all the text in the wrong language you might want a fast way to fix it. As long as you understand that you will be wiping out potentially useful styles at the same time, I think you could probably script this. You should probably start a thread over in scripting to see if they can help: InDesign Scripting

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Jan 24, 2012 5:35 AM   in reply to designer1955

    Err, so, Peter S. is correct that it is a simple script to change the language associated with all character styles.

    But usually there are easier ways.

    Peter V., do either of these meet your needs?

    1) Base all your character styles on a common character style whose language attribute you can change

    2) Use the formatting options in Find/Change to change the language of all text (search for wildcard)

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 24, 2012 5:46 AM   in reply to John Hawkinson

    John the request, though, was to change the language in the styles, so I don't see how Find/Change is going to help. Nor I think will the based-on sulution work in cases where you are working with existing files. You'd need to set that up in advance.

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Jan 24, 2012 5:58 AM   in reply to Peter Spier

    Right, right, I just wanted to point it out in case it worked for him.

     

    Also, incidently, in IDML, even character styles that aren't based on any other are actually based on a magic master "CharacterStyle/$ID/[No character style]" character style. So you can export to IDML, unzip, edit the definition of that one style, rezip, and import the IDML, and then all the other styles will fall into line.

     

    This is probably more effort than a script though.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 30, 2012 2:33 AM   in reply to designer1955

    @designer1955 – this code will not work if you store your paragraph styles in subfolders. The scope of "app.activeDocument.paragraphStyles" are  paragraph styles at top level. The solution here is to use "allParagraphStyles" instead of "paragraphStyles".

     

    Also it will give you the old rules by using "app.languagesWithVendors.item("Dutch")"

     

    In my German version there are two "Dutch" options "Niederländisch: Alte Rechtschreibung" (old one) or "Niederländisch: Rechtschreibreform 2005" (new reformed).

     

    See Marc Autret: "List of available Languages (and related secrets)" at:

     

    http://www.indiscripts.com/post/2011/12/indesign-scripting-forum-round up-2

     

    Simply "Dutch" will get you the old rules.


    "nl_NL_2005" will get you the new reformed rules:

     

    var a = app.activeDocument.allParagraphStyles;
    for (var i=a.length-1; i > 0; i--){
    a[i].appliedLanguage = app.languagesWithVendors.itemByName("nl_NL_2005");
    };
    

     

    Ok. Now we have set all paragraph styles.

    Be aware that "appliedLanguage" is on "character" level! So you need to change all character styles as well, if they apply a different language. And oh!, there could be local formatting, too. Now changing the paragraph style does not change the local formatting. You see, it's getting complicated here…

     

    Uwe

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)