Check for multiple languages

All about user-defined episode / movie / file name format expressions
Post Reply
Franky
Posts: 9
Joined: 31 Mar 2021, 16:38

Check for multiple languages

Post by Franky »

I want an expression that checks the languages of the audio, and if there exists audio of two or more different languages, outputs the string "Multilang". Any ideas on how that could be done?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Check for multiple languages

Post by rednoah »

Here's an example:

Code: Select all

{
	def n = audioLanguages.size()
	n > 2 ? "Multi" : n > 1 ? "Dual" : null
}

:arrow: You can search the forums for "audioLanguages" to find more complex examples and real-world use cases.
:idea: Please read the FAQ and How to Request Help.
Franky
Posts: 9
Joined: 31 Mar 2021, 16:38

Re: Check for multiple languages

Post by Franky »

Thank you! I solved it now like this:

Code: Select all

{if (audioLanguages.size() > 1) ', Multilang'}
Post Reply