Template for internationalizing links in JSF

I want to internationalize the following content:

Click hereto view our privacy policy.

here- hyperlink. Here's how I say it now:

#{msg.footer_privacyPolicy1}
<h:outputLink>
    #{msg.footer_privacyPolicy2}
</h:outputLink>
#{msg.footer_privacyPolicy3}

msgis ResourceBundleregistered faces-config.xmlwith the following contents:

footer_privacyPolicy1 = Click
footer_privacyPolicy2 = here
footer_privacyPolicy3 = to view our privacy policy.

I think that to achieve this goal there must be a better model. Here's what I don't like about my approach:

  • The flexibility in actual internationalization is lost because I am holding back the semantic order of the sentence. For example, perhaps in some languages ​​the imperative "click" should go at the end of the sentence, but this is not possible in my approach.
  • (.. ) . - , .

, ?

+4
1

JSF OmniFaces <o:param> .

footer.privacyPolicy = Click {0} to view our privacy policy.
footer.privacyPolicy.link = here
<h:outputFormat value="#{i18n['footer.privacyPolicy']}" escape="false">
    <o:param><h:link outcome="privacyPolicy" value="#{i18n['footer.privacyPolicy.link']}" /></o:param>
</h:outputFormat>

<f:param>, .

+3

All Articles