I’m currently doing internationalization with gettext using PHP. I was wondering if there were any good methods for this example:
By using this website, you accept the <a href="<?php print($dir); ?>/tos/">Terms of Use</a>.
For en_US, this sentence would follow such a format. However, in another language, the link “Terms of Use” could be at the beginning of the sentence. Is there an elegant way to do this? Thanks for your time.
Here’s how I’d do it. The phrase to be translated would be
Then I’d replace the link after the phrase is localised, e.g.
Of course you can replace
<a>and</a>with whatever makes sense to you and your translators. Come to think of it, since you have to escape your output to prevent translators from messing up with your HTML (intentionally or not) I’d probably go with something like