In my model, there is an object named "domain" with two methods: getDescriptionEn() and getDescriptionFr().
I am trying to retrieve the appropriate description based on the current locale.
My issue lies in the following code snippet:
var locale = "${currentLocale}"; // Returns either "En" or "Fr"
var method = "{domain.getDescription".concat(locale).concat("}"); // Results in "{domain.getDescriptionEn}" or "{domain.getDescriptionFr}"
var expr = "$".concat(method); // Produces "${domain.getDescriptionFr}"
Unfortunately, I am having trouble evaluating this expression.
I have attempted various string parsing techniques,
Additionally, I tried the following approach:
var method = "domain.getDescription".concat(locale); // Results in "domain.getDescriptionEn" or "domain.getDescriptionFr"
var expr = "${".concat(method).concat("}");