HighTechTalks DotNet Forums  

Handling formatting in localized strings

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss Handling formatting in localized strings in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
lbolognini (AT) gmail (DOT) com
 
Posts: n/a

Default Handling formatting in localized strings - 09-07-2005 , 06:01 PM






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>


Reply With Quote
  #2  
Old   
Michael \(michka\) Kaplan [MS]
 
Posts: n/a

Default Re: Handling formatting in localized strings - 09-07-2005 , 08:52 PM






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.


--
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.



<lbolognini (AT) gmail (DOT) com> wrote

Quote:
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




Reply With Quote
  #3  
Old   
lbolognini (AT) gmail (DOT) com
 
Posts: n/a

Default Re: Handling formatting in localized strings - 09-08-2005 , 09:01 AM




Michael (michka) Kaplan [MS] wrote:
Quote:
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



Reply With Quote
  #4  
Old   
Michael \(michka\) Kaplan [MS]
 
Posts: n/a

Default Re: Handling formatting in localized strings - 09-13-2005 , 04:53 AM



Well, #1 can happen in CJK and other languages, and #2 can happen in any
language....


--
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.



<lbolognini (AT) gmail (DOT) com> wrote

Quote:
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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.