Passing variable to antl



Trying to pass a variable to ant like this

{{ antl.forLocale(lang).formatMessage(my_var) }}

my_var is coming from a database field.

How should I do it?


I had the same issue, have any solution ?


No I don’t


Do you get any errors? Since it should work fine


I find the solution. the problem is the key doesn’t exist, so, you must verify is the key exists. i made a try/catch to check. and it’s working now

try {
  fieldName = Antl.forLocale('zh').formatMessage(`fields.${errors[i].field}`);
} catch (e) {
   fieldName = errors[i].field;