Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / September 2005

Tip: Looking for answers? Try searching our database.

Handling formatting in localized strings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lbolognini@gmail.com - 07 Sep 2005 23:01 GMT
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>
Michael (michka) Kaplan [MS] - 08 Sep 2005 01:52 GMT
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.

Signature

MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.

> Hi all,
>
[quoted text clipped - 21 lines]
> us click here"... where the click here is going to be rendered as <a
> href="contactus.aspx">click here</a>
lbolognini@gmail.com - 08 Sep 2005 14:01 GMT
> The biggest problems:, off the top of my head
>
[quoted text clipped - 6 lines]
> 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
Michael (michka) Kaplan [MS] - 13 Sep 2005 09:53 GMT
Well, #1 can happen in CJK and other languages, and #2 can happen in any
language....

Signature

MichKa [Microsoft]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Blog: http://blogs.msdn.com/michkap

This posting is provided "AS IS" with
no warranties, and confers no rights.

>> The biggest problems:, off the top of my head
>>
[quoted text clipped - 15 lines]
>
> Lorenzo

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.