How to detect the language used in the document by script

Question

Is it possible to detect the language used in the document by script?

Answer

For doing this, please use the IField object, GetLangs() method to detect the language used in the document:

var t = Context.Field("Field Name").GetLangs();
var p = "";
foreach (var s in t)
{
p += s.ToString()+",";
}
FCTools.ShowMessage( "Language " +  p);

 

Additional information

iField

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request