The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Handling formatting in localized strings

Hi all,

I've got a multilingual appication which retrieves localized messages from the db through a GetText(LangID, PlaceHolder) method.

How would you handle links inside the text such as in:
"If you would like to contact us click here"

where "click here" would be a link and, say, the word "contact" would be in bold?

I thought about markdown for formatting since we'll have translators to localize the website and they wouldn't need to deal with HTML brakets and slashes even though that would maybe just move the problem from HTML to markdown. Any thoughts on this?

Regarding the rendering of links I thought about modifiying the GetText method to accept optional parameters GetText(int LangID, string PlaceHolder, string[] args) where the args would match in order with the marked links in the string stored in the db so I wouldn't have to mantain a separate table in the db just for links and look them up with a GetLink(PlaceHolder, LinkPlaceHolder) method. Any thoughts on this too?

Thanks in advance,
Lorenzo
Lorenzo Bolognini Send private email
Monday, September 05, 2005
 
 
I am not a translator, but after looking at the Markdown page, I think it would be more confusing than HTML. It looks to me like Markdown is meant to be easy to type. But HTML should be nice and consistent to read, e.g.,

  **bold text**

vs.

  <strong>bold text</strong> or <b>bold text</b>

Any HTML markup will have the same pattern of brackets and slashes, so it's consistent.

But HTML *is* clunky, and will add a lot of "noise" to the strings, especially if you have links. It might make sense to create your own XML markup that you can then translate into HTML.
EKB Send private email
Monday, September 05, 2005
 
 
No, Markdown is easy to write *and* easy to read. HTML is easy to parse.
Karel Thönissen
Tuesday, September 06, 2005
 
 
We don't use formatting in strings, that have to be translated, we rather use "double indirection" in formatting strings with markup:

log.log("<h5>%s</h5>", Strings::getSFormattedString(ID_MSG_37534,
                            navrhPovysenia->getPKAsVariant().getValueAsString(),
                            poradca->getCisloOsoby(),
                            poradca->getPK().getValueAsString()));
                            
//ID_MSG_37534  = "Navrh %s, poradca c. %s : Návrh nie je akceptovany.\n"
jan soltis
Thursday, September 08, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz