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

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.