Reputation: 283
We are currently working on a custom php framework, with multilanguage feature. So far its easy to handle translations, but now we have more complex messages with links. For example, this:
"hello user <a href="/register">register</a> here!"
could be translated with included HTML tags?
"fkds vkelip <a href="/register">regiximi</a> fácő ea!"
Or I should do this in 3 steps:
"hello user" -> translation
"register" -> translation
"here" -> translation
?
Upvotes: 1
Views: 93
Reputation: 709
You should put all text into the translate function because it's the whole sentence:
__('hello user <a href="/register">register</a> here!');
Upvotes: 1
Reputation: 3065
you should use gettext function which handles all your translation requirements. as most of the current cms and framework does .
"<?=__('hello user')?> <a href="/register"><?=__('register')?></a> <?=__('here!')?>"
Upvotes: 1