Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to change language in all paragraph styles all at once?

New Here ,
Mar 11, 2025 Mar 11, 2025

I have a book in English that all paragraph and charachter styles are already set, now I need to make a copy of english styles and change all at once to Spanish, is there any easy way in Indesign to change all at once without clicking on each paragraph style and change to spanish one by one?

Remmeber I don't make style from scratch, only changing previous styles. 
I use Indesign CS6
Has Adobe any script for that?

TOPICS
Feature request , How to , Scripting
827
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2025 Mar 11, 2025

If all styles are children of a single parent styl, as it should be, change the language of that style. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2025 Mar 12, 2025

I respectfully disagree with 'As it should be'. Absolutely not, that would be a nightmare.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2025 Mar 12, 2025

I agree (mostly) with Willi. 

All my Body-based styles are children of the Body parent. 

All my heading styles are children of the main head (e.g., Heading1) but are NOT connected to Body.

My Table styles are based off of one another but NOT connected to Body. 

etc. 

In other words, they are based-on in logical groups, so depending on the complexity of the document, I might have 4-6 main styles to edit to change the language.

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2025 Mar 13, 2025

And then there are Accessibility tags and you change a level. You have to check each 'based upon' style. I respectfully disagree with 'as it should be'. You can, not should.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 11, 2025 Mar 11, 2025

@dtp_1544 

 

for (var a = app.activeDocument.paragraphStyles.length - 1; a > 1; a--)
{
   app.activeDocument.paragraphStyles[a].appliedLanguage = "Polish";
}

 

https://creativepro.com/how-to-install-scripts-in-indesign/

 

You could change "a > 1;" to "a > 0;"- but this will also change the definition of "[Basic Paragraph]" Style.

 

The other option would be to export IDML file and edit it directly.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2025 Mar 11, 2025

@Robert at ID-Tasker 

Changing language for [Basic Paragraph] would probably be appropriate in this case, especially if any other style is based on it.  And as I read the question, the OP wants to change the language to Spanish rather than Polish so that would be another change the should make in your code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 11, 2025 Mar 11, 2025

@Peter Spier 

 

Yes, of course, language was just an example - and should be changed 😉 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 11, 2025 Mar 11, 2025

But this will change the paragraph styles which are at document level (meaning styles not under an folder - style group).
What if OP has created or using styles which are under style group?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 11, 2025 Mar 11, 2025

@adarsh_0848 

 

for (var a = app.activeDocument.allParagraphStyles.length - 1; a > 1; a--)
{
   app.activeDocument.allParagraphStyles[a].appliedLanguage = "Polish";
}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2025 Mar 12, 2025

Hi @dtp_1544 ,

just a remark on the value that you need for property appliedLanguage in Robert's script:

Best use a representation that will work in every localisation of InDesign, not only in the English one.

With Spanish in mind you can test this string:

"$ID/Spanish"

 

So with Robert's code it would be:

for (var a = app.activeDocument.allParagraphStyles.length - 1; a > 1; a--)
{
   app.activeDocument.allParagraphStyles[a].appliedLanguage = "$ID/Spanish";
}

 Just tested this with my German InDesign 2025.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2025 Mar 13, 2025

Just another remark on the strings used with appliedLanguage:

"Polish" or "Spanish" for example will not work with my German InDesign.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 13, 2025 Sep 13, 2025
LATEST

Hi @dtp_1544 ,

we recently discussed this topic in a similar thread.

 

Scripting with ExtendScript:

If you are after the string for a specific language and you need the "international" version, the one that should work in all localized versions of InDesign, one can get the important part of the string from selected text with the applied target language like that:

alert( app.selection[0].appliedLanguage.untranslatedName );

 

Simply add "$ID/" in front of the alerted string and you can use it with the script Robert @Robert at ID-Tasker  posted above.

 

All in all like that:

// Get the untranslated language name from selected text.
// Keep it in a form for all localized versions of InDesign:
var languageName = "$ID/" + app.selection[0].appliedLanguage.untranslatedName;

// Apply the found language to all paragraph styles.
// Also ones that are stored in paragraph style groups.

// With:
// var n = 1 the basic paragraph style is also affected.
// NOT SO with:
// var n = 2

for( var n = 1; n < app.activeDocument.allParagraphStyles.length; n++ )
{
	app.activeDocument.allParagraphStyles[n].appliedLanguage = languageName ;
};

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines