@anoop345
hreflang attribute value is not enclosed in double quotes.
Also, you can use data-sly-set for framing concatenated String instead of data-sly-test
Use this markup (Amended on top of your latest)
<link
data-sly-repeat.analyticsItem="${head.AnalyticsItems}"
data-sly-set.concatenated="${'{0}-{1}' @ format=[analyticsItem.locale, analyticsItem.country]}"
hreflang="${analyticsItem.country == 'international' ? analyticsItem.locale : concatenated}"
rel="alternate"
href="${analyticsItem.path}"
/>
Thanks for the reply.
I tried both data-sly-test and data-sly-set but not sure why the value of "concatenated" is coming only "-" in the hreflang, however analyticsItem.country and analyticsItem.locale coming properly from the model. So if country is not international its coming like this in the output-
<link rel="alternate" hreflang="-" href="http://localhost:4502/content/myproject/content/br/en/test.html"/>