![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I've been thinking about this problem lately and can't figure out a clean way to solve it. The problem is: I'm storing localized strings in a db (planning to keep the most requested languages on cache). I figured out a way to keep links out of the database and rendering them calling my GetText(Locale, PlaceHolder, params string[] Links) and replacing them in the order they are met.[1] Leaving behind discussions on performance that this approach may bring (we'll tune them as we go) what I can't figure out is a way to keep the string formatting (such as bold, italic, etc...), as well as the links, out of the database. How would you deal with this? Is there any best practice you could recommend in this respect? Thank You, Lorenzo -- [1] This is for rendering something like: "If you would like to contact us click here"... where the click here is going to be rendered as <a href="contactus.aspx">click here</a |
#3
| |||
| |||
|
|
The biggest problems:, off the top of my head 1) For some languages, italics simply do not work (think Arabic script, Divehi, or others), and pothers will look very ugly to customers if they are bold. Basucally you need the formatting to be localizable so the localizer can save you from yourself on these strings. 2) Inserts can change order in other languages, so your idea of filling inserts in order is not a good one. better to have inserts like {0], {1}, etc. so the localizer can move them as needed. |
#4
| |||
| |||
|
|
Michael (michka) Kaplan [MS] wrote: The biggest problems:, off the top of my head 1) For some languages, italics simply do not work (think Arabic script, Divehi, or others), and pothers will look very ugly to customers if they are bold. Basucally you need the formatting to be localizable so the localizer can save you from yourself on these strings. 2) Inserts can change order in other languages, so your idea of filling inserts in order is not a good one. better to have inserts like {0], {1}, etc. so the localizer can move them as needed. Thanks for the answer Michka. Indeed you're right about formatting and the link rendering. I will not be supporting RTL writings in the immediate future but since I might, someday, it's better to stay on the safe side. Lorenzo |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |