We are localizing all parts of our website to many languages. We use XML localization files. I think this scenario is so common, and even there should be a standard solution to this, but still I couldn't find any good advice, and every developer here has different opinion about it, so I'm asking you.
Suggest the following example:
If you have question, please ask our <a href="blabla" target="_blank" title="Our nice Customer Support">
Customer support</a>
or write an email to <a href="mailto:XXX">
Jane Doe </a>
our specialist.
Or a long, formatted text:
<p>A very long, marketing blah-blah. A very long, marketing blah-blah. A very long, marketing blah-blah concluding in a list:</p>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
1) Would you put html tags into the localization XML file?
My concern is the View is separated into 2 files: your page and your localization file. People will forget to check the localization file. Also, there's logic and style embedded in html as well (see target="_blank"
, or the fact that the above mentioned list is unordered...)
2) Or splitting it to smaller parts?
<msg id="IfYouHaveQuestion">
If you have question, please ask our</msg>
<msg id="CustomerSupport">
Customer support</msg>
<msg id="OrWrite">
or write an email to</msg>
...
Now, View can contain all the markup and style. It's easy to change it, flexible.
But.
There's absolutely no guarantee that the word order will be the same in all languages. Also, this would make the translator's work a nightmare, making it a puzzle.
3) Or introduce BB-style markdown?
<msg id="HaveQuestion">
If you have question, please ask our [link url="{customersupportlink}" title="{{CustomerSupportTitle}}">
Customer support[/link]
or write an email ...</msg>
But probably this is over-complicating the issue, and also we have to write our own parser for this (though, I think it wouldn't be so hard). And probably does not solve the long, formatted text problem.
4) ??? (Your golden solution here) :)