Page 1 of 1

Check for multiple languages

Posted: 31 Mar 2021, 18:32
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?

Re: Check for multiple languages

Posted: 01 Apr 2021, 02:55
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.

Re: Check for multiple languages

Posted: 01 Apr 2021, 10:44
by Franky
Thank you! I solved it now like this:

Code: Select all

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