|
Kaushal_MS (Moderator):
Hello and welcome to today’s chat on “Developing Internationalized
software using .NET Framework”
Kaushal_MS (Moderator):
We
have with us here 4 experts to answer your questions on the topic
today...
Kaushal_MS (Moderator):
Anutthara Bhardwaj - SDE/T working in MSFT for 2 years. Testing
Visual Studio Team System, mostly the Team Build component being
built out of IDC Hyderabad.
Kaushal_MS (Moderator):
Kranthi K – SDET, Mobile Devices Group
Kaushal_MS (Moderator):
Prakash Paramasivam - Test Lead for WinFS working at Microsoft for
over an year and involved in testing various WinFS features.
Kaushal_MS (Moderator):
Alok Goyal - works for IDC Mobility group in SQL Mobile Team as a
SDET.
Kaushal_MS (Moderator):
4
experts - all yours for an hour. Start shooting your questions!
(Please remember to check ‘Ask Expert’ checkbox in your chat window)
Anu
[MS] (Expert):
Q:
Can
we get an understanding of internationalized software imply?
A: Internationalized software simply means software that
works on different language platforms as well as can s/w that can be
presented in different languages
Prakash[MS] (Expert):
Lets first discuss about Globalization concepts first ..While the
questions are always welcome
Prakash[MS] (Expert):
Globalization is a process of developing apps that supports
localized user, regional support for data in multiple cultures.
Alok[MS] (Expert):
Let
me explain what does mean the term localization mean
Alok[MS] (Expert):
Localization is the process of translating an application's
resources into localized versions for each culture that the
application will support. It composed of two blocks: UI Block and
Code Block
Localized Version =Localized UI Block + Code
Alok[MS] (Expert):
Q:
How
can I get all Cultures supported on a system through .NET
A: You can simply do foreach (CultureInfo ci in
CultureInfo.GetCultures(CultureTypes.AllCultures))
KranthiK[MS] (Expert):
Q:
Can
you explain a bit more on Internationalization?
A: Internationalization has two parts - World-Readiness and
Localization. World-Readiness again has two parts - Globalization
and Localizability. Please read info provided by Alok and Prakash
regarding globalization and localization
Anu
[MS] (Expert):
Q:
What is the benchmark you take while developing internalized
software?
A: : If you are asking for what are the stuff we look at for
developing internationalized software, then we look at:
1.
Product must work on platforms of different languages and be able to
take input from several languages - this is globalization.
2.
if the product is localized, the UI language/elements will be in
different languages and will be able to take input and give output
in many languages
Anu
[MS] (Expert):
Q:
just to add Alok Can we set culture values in the globalization
section of the web.config file?
A: You can set culture as well as UICulture values in the
globalization section of your web.config file.
Here
is a sample: <globalization
culture="en-US"
uiCulture="de-DE"
/>
Prakash[MS] (Expert):
Q:
If
I have to go and start making my app global ready, what is the
starting point? Can you provide me a good link which I can read?
A: This is the link you can start off with
http://www.microsoft.com/globaldev/getWR/default.mspx
Anu
[MS] (Expert):
Q:
We
have faced issues when we persist data in SQL server in a particular
date/time format and retrieving and displaying it in different
culture. It displays error messages provided the date format is not
compatible with what is retrieved.
A: This is probably due to saving in a different culture and
retrieving in a different culture. Using the Convert function you
can display dates in diff formats and of course convert between them
too. Here is a helpful link:
http://www.databasejournal.com/features/mssql/article.php/2197931
Alok[MS] (Expert):
Q:
Windows keeps on adding new cultures with every release then how it
is handled through .NET
A: Basically through .NET we can get to know windows
supported culture only by doing the
following
foreach (CultureInfo culture in CultureInfo.GetCultures(
CultureTypes.WindowsOnlyCultures))
{
Console.WriteLine (ci.Name);
}
Anu
[MS] (Expert):
Q:
How
do we overcome the issue of persisting date in a particular format
and showing in the relevant culture of the client application?
A: A best practice is to save all dates in the UTC format.
While retrieving data, you can retrieve data as UTC and display
according to the current culture on the machine you are displaying.
Here is a link describing how to format dates on different cultures
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformattingobjectsforspecificculture.asp
KranthiK[MS] (Expert):
Q:
What is the difference between culture and UICulture?
A: UICulture is just specific to the UI. That is if UICulture
is set to Chinese, you will see all UI in Chinese language if you
have resources for it. Culture applies to date/time formats, sort
mechanisms etc
Alok[MS] (Expert):
Q:
What is the best way to represent a locale?
A: In the Windows operating systems, a locale is a set of
user preference information related to the user's language,
environment and/or cultural conventions. This information is
represented as a list of values used to determine the correct input
language, keyboard layout, sorting order, and the formats used for
numbers, dates, currencies and time. In order for a particular
locale to be available for selection, the appropriate language group
<
http://www.microsoft.com/globaldev/DrIntl/faqs/Locales.mspx
>
must be installed.
Windows 2000 and Windows XP include support for 126 and 136
different locales, respectively, ensuring that users around the
world can configure their systems to use the correct formats for
their own language and region.
Anu
[MS] (Expert):
Q:
Can't we use .resx file for the purpose, by which means we can
localize our site?
A: Web sites localization has been immensely simplified with
VS 2005. Some cool features that would help are managed resource
editor, localizing static content automatically etc. I would suggest
using satellite dlls to store localized resources of your site. Here
is a link that describes localization for web sites -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/ASP2local.asp
Alok[MS] (Expert):
Q:
For Retrieving user locale in win32 – which API is to be used?
A: Retrieving user locale - GetUserDefaultLCID ()
Prakash[MS] (Expert):
Q:
how
do you localize using windows mobile 2005?
A: In general for localizing any .NET apps, the steps are
·
Add
Localized Resources
·
Set
the CurrentCulture to Local Culture
·
Use
ResourceManager to read resources
·
Use
CultureInfo Class for culture-specific information
Alok[MS] (Expert):
Q:
What are Win32 API’s for handling inputs.
A: WIN32 API’s for handling inputs
GetKeyboardLayout
GetKeyboardLayoutList
GetKeyboardLayoutName
LoadKeyboardLayout
UnloadKeyboardLayout
ActivateKeyboardLayout
But
please keep discussion relevant to .NETFX only :)
KranthiK[MS] (Expert):
Q:
I
know what is a locale and what is a language. But when comes to
coding, I want to represent them using one best way. The ways I can
think of Locale ID (LCID), TwoLetterISOStandardLanugageName ...
etc... However which one is the preferred one?
A: Preferred way is to use twoletterlanguagename like fr-FR.
Alok[MS] (Expert):
Q:
We
have serialized control properties in a particular culture and
deserialized using a different culture. This hasn't worked since the
format changes for properties like size and width and we end up with
an error. Is there a way we can overcome this.
A: May be you can try using invariant culture to achieve it,
KranthiK[MS] (Expert):
Q:
I’m
very much interested in localization. is there a code page for
Telugu/Tamil/Hindi?
A: Code pages for Indic languages are available from Windows
2003 and not before that. Telugu - 57005, Tamil - 57004 and Hindi -
57002
Anu
[MS] (Expert):
Q:
How
exactly my control panel regional settings map to
CultureInfo.CurrentCulture and CultureInfo.CurrentUICulture?
A: CurrentCulture is the culture that you can choose in the
dropdown in the "regional options" tab. CurrentUICulture has no
direct equivalent in the R&LSO AFAIK
Anu
[MS] (Expert):
Q:
Ok
, I have tried with localizing my web site with resx files and
setting current culture but it didn’t worked, can u figure out why ?
A: I will need a bit more detail like what exactly you did to
generate the resx file and where the current culture was set and
what was the bug you encountered. I'll possibly need to take a peek
at your web.config also.
Alok[MS] (Expert):
Q:
In
what circumstances one should use Ordinal, Invariant and Current
Cultures
A: To decide which you should use in a given situation, it is
important to look at what you are trying to accomplish. Would you
want two strings that are equivalent according to the Unicode
normalization rules to be treated as equal, like you might in a
sorted list of names? This is probably a good time to use the
current culture. Are you trying to list items in the same order, no
matter how the user's preferences are configured? Using Invariant
here is probably the best plan. Or should any difference in the
underlying strings be cause for treating the strings as different,
whether the difference is visible or not (like in a password)?
Ordinal comparisons are probably the best plan here.
Anu
[MS] (Expert):
Q:
What is easiest method to localize web site ?
A: The easiest way to localize a Web page is usually to
create a copy and translate it to the target language. This works
well for static content that does not require a lot of maintenance.
To support this model for ASP.NET pages, you can set the Culture
attribute using the Page directive. All locale-dependent methods
pick up the value of the Culture attribute. But the problem with
this is that this model is not scalable. With the advent of new loc
features in asp.net 2.0, localizing using satellite dlls is also
very easy as well as scalable. Refer
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/ASP2local.asp
Alok[MS] (Expert):
Q:
What exactly meant by Surrogate Characters? And which character
encoding these surrogate characters belong to?
A: Surrogate character basically consists of two sequences of
16 bit code units. High 16 bit code unit is called high surrogate
and low 16 bit code unit is called low surrogate. Surrogate
characters are basically used in complex scripts and please
elaborate what do u mean by character encoding. What I know is UCS
and Unicode supports Surrogate characters
Alok[MS] (Expert):
Q:
Oops...I see that Surrogate Characters are problematic and they are
meant to overcome. Alok, do you mean to say that Unicode standard
overcomes surrogate character problem? Or Unicode standard also has
surrogate character problem? I am confused pl explain
A: Basically Unicode and UCS standard overcomes surrogated
character problem. After BMP Plane in character set tables there are
code point which are allocated to surrogate characters, so I must
say that in Unicode you do not need to worry and if you use
StringInfo or TextInfo class, it will not be a problem
Alok[MS] (Expert):
Q:
What is Unicode Normalization and what are the methods supported by
.NETFX
A: The Unicode Consortium defines normalization as a method
whereby "equivalent text will have identical binary representations.
When implementations keep strings in a normalized form, they can be
assured that equivalent strings have a unique binary
representation." The Unicode version of normalization is described
in Unicode Standard Annex (UAX) #15. The .NET Framework adds two
methods to the String class with two overrides each, and one
enumeration giving the different forms:
Anu
[MS] (Expert):
Q:
how
to make phonetic presentation?
A: Jaideep - I wonder if you could elaborate that. Phonetic
presentation is a way of spelling which matches letters to the
sounds of words - but what exactly do you wish to use the .NET fx
for?
KranthiK[MS] (Expert):
Q:
how
to make phonetic presentation?
A: Look at this presentation for more info on phonetics
http://depts.washington.edu/lingweb/ling200/lect3_phonetics1.ppt
Alok[MS] (Expert):
Q:
What exactly meant by Surrogate Characters? And which character
encoding these surrogate characters belong to? And, how .NET FX
coding is affected by these surrogate characters presence in the
string I give to the .NET FX API? (IGNORE my previous question)
A: I have given the answer of your previous question and to
add more in .NETFX has support of surrogate characters through
StringInfo and TextInfo classes. Also please find a code snippet and
you may get more clarity
sing System;
using System.Globalization;
public class SamplesTextElementEnumerator
{
public static void Main()
{
// Creates and initializes a String containing the
following:
// - a surrogate pair (high surrogate U+D800 and low
surrogate U+DC00)
// - a combining character sequence (the Latin small
letter "a" followed by the combining grave accent)
// - a base character (the ligature "")
String myString = "\uD800\uDC00\u0061\u0300\u00C6";
TextElementEnumerator myTEE =
StringInfo.GetTextElementEnumerator(myString);
myTEE.Reset();
while (myTEE.MoveNext())
{
Console.WriteLine("[{0}]:\t{1}\t{2}", myTEE.ElementIndex,
myTEE.Current, myTEE.GetTextElement());
}
Anu
[MS] (Expert):
Q:
right, but I want to change my locale dynamically without adding
many pages to my site.
A: Yep - I get you. You will find these samples helpful
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/localize/i18n/i18n_regional.src
- Sample to switch regional settings
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/localize/localize2/news-en-us.src
- Sample to show localized content in server controls
Anu
[MS] (Expert):
Q:
what are the two methods in the String Class
A: There are many methods in the String class. Which methods
are you enquiring about?
Here is a list of all members
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemStringMethodsTopic.asp
Alok[MS] (Expert):
Q:
Can
you please explain what is Turkish Eye problem? Also in the same
line, are there any other well known problems with other locales?
A: in Turkish when you try to lowercase the capital Letter I
then in English Language it comes as ‘i’. Please look at the dot on
top of small ‘i’. But in Turkish there won't be any dot and it will
be bare a vertical stroke. In Swedish locale accented a comes after
'a' but in English it comes after 'z'
KranthiK[MS] (Expert):
Q:
Where can I find more about Unicode and how .NET supports Unicode
A: You can find complete info about Unicode at
www.unicode.org .NET has Unicode class in System.Text names
which provides methods to encode and decode all UTF data
Anu
[MS] (Expert):
Q:
Moderator: Can I ask WIN32 questions related to
Internationalization?
A: All of us have areas of expertise within .NET, so we would
be better equipped to answer those related to .NET, but we can try
to answer your win32 questions or get back with the appropriate info
:)
Kaushal_MS (Moderator):
Q:
!!
Quick break friends!! ... Microsoft will be doing a mega launch of
Visual Studio 2005, SQL Server 2005 and BizTalk Server 2006 with
Bill Gates coming down next week! Make sure you don't miss out on
the action! Hit here - www.rockthelaunch.in or www.billgateslive.com
(webcast). Are you ready to rock the launch?
Alok[MS] (Expert):
Q:
Where can I find more about Unicode and how .NET supports Unicode
A:
www.unicode.org for Unicode information and you refer
System.Text namespace in .NET
Prakash[MS] (Expert):
Q:
does internationalization encompass localization and globalization ?
How are both accomplished
A: Yes, Internationalization encompass globalization and
localization. In Internationalization, Globalization is the fist
step in the process, localizability is the next step and
Localization is the last step in the process.
Alok[MS] (Expert):
Q:
Where is the location of BOM and how can we determine the encoding
type?
A:
there is a Byte Order Mark(BOM) associated with a file which is
encoded in UTF-16, UTF-8 or UTF-32. Basically the location of BOM is
in the file header. This BOM is fixed for each type of encoding
(UTF-8, UTF-16, UTF32). So if you read this BOM you can come to know
about the encoding.
Alok[MS] (Expert):
Q:
Do
you know if .NET supports UTF-32 encoding?
A:
May
be it supports , Look at System.Text namespace. Please check
Encoding Class and look at various properties. For example
Encoding.UTF8, Encoding.UTF16 so probably UTF32 is also there .
Anu
[MS] (Expert):
Q:
Alok people with cleft palette understand phonetics. There are
medical applications that have representation for these characters,
I am not sure what those are, but are there representation for such
a thing. net fx?
A: Jaideep - AFAIK, we do not have explicit support for these
on .NET, but I will get back to you on this topic to confirm with
more data.
Kaushal_MS (Moderator):
for
those who came in late - we're discussing "Developing
Internationalized software using .NET Framework” - please shoot your
questions after checking the 'Ask The Expert' checkbox!
KranthiK[MS] (Expert):
Q:
How
can I store my words in SQL Server in different languages and
retrieve them as well ?
A: SQL Server is Unicode based. As long as your client also
supports Unicode, storing any language and retrieving it will not
create any problem.
Alok[MS] (Expert):
Q:
Alok, ByteOrderMask (BOM) is stored in file header for files. But
where it gets stored for the Unicode string I am receiving from my
caller?
A: In Windows XP it is by default it is UTF-16 but when r u
receiving it on the network then byte order mark can be useful on
the destination machine to know the encoding,
Prakash[MS] (Expert):
Q:
Is
.NET CF 2.0 supports the same level of internationalization as that
of .NET FX 2.0? Especially the devices these days are getting
localized!
A: Yes, it supports the same level of internationalization
for devices
Kaushal_MS (Moderator):
Mademoiselles et hommes (in true internationalized fashion) - we
have 2 more mins. for the chat to end. Would you like some more time
(if the experts may permit!)
KranthiK[MS] (Expert):
Q:
When a file is encoded in Unicode standard let’s say UTF16 and then
sent over the network to a different machine then how target machine
determines the source file encoding and what issues may arise.
A: Every file will contain Byte Order Mark (BOM) using which
we can identify the encoding scheme
Kaushal_MS (Moderator):
great! we have 10 more minutes with the kind consent of the experts
:)
Kaushal_MS (Moderator):
no
more new questions please - we
Kaushal_MS (Moderator):
...
we will answer the pending questions
Anu
[MS] (Expert):
Q:
Is
there any .NET FX API that takes any format string and always gives
out the string in a particular (say UTF-32) string format. This
way, I probably can use that API to convert the incoming string to
UTF-32 always!
A: Yes - you can use Convert API - here is a link that
explains more on this
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemTextEncodingClassConvertTopic.asp
Alok[MS] (Expert):
Q:
Alok true for the network packets, but I am API provider and takes
String object in my API. I just want to find the incoming string
format type and react upon accordingly?
A: If you do the following you may find the answer byte[]
encodedcharacters = Encoding.GetBytes(IncomingString) , if you can
calculate the number of bytes you may come to know if it is UTF-16
or UTF-32. Basically you need to calculate the number of bytes used
and then find out
Anu
[MS] (Expert):
Q:
Hi
can you tell me the difference between localization and
localizability?
A: You can read more about it at http://blogs.msdn.com/anutthara/archive/2005/11/25/496923.aspx
Designing a software's code and resources such that they can be
localized and presented in other languages thus making it usable in
other languages is called localizability. This means, I need to
design my product in a way that if tomorrow I want an international
developer to use it, the software must be easily lendable to
localization. Localization is the actual process of localizing the
resources used in the software, thus making the product ready in a
new language
Kaushal_MS (Moderator):
ok
folks! looks like all the questions have been answered
Kaushal_MS (Moderator):
except for whether or not we're alone in this universe
Kaushal_MS (Moderator):
thank you all... for attending this chat!
Kaushal_MS (Moderator):
it
was great having you here!
Kaushal_MS (Moderator):
would also like to thank the experts for their time and valuable
info
Anu
[MS] (Expert):
Thanks for attending folks. It was awesome being here! :) See you...
Prakash[MS] (Expert):
Thanks guys. Its nice to see great questions.
KranthiK[MS] (Expert):
Thanks all for asking such interesting questions
Alok[MS] (Expert):
Thanks Guys, I found that chat very interesting and the questions
were really cool , see u next time , bye
Kaushal_MS (Moderator):
goodbye everyone! this chat has officially ended. have a great
evening.
Kaushal_MS (Moderator):
if
you'd like a transcript of the chat, please check back on
www.microsoft.com/india/msdn/chat
later
Kaushal_MS (Moderator):
Q:
Moderator: Where is this chat script uploaded online for future
reference?
A:
www.microsoft.com/india/chat
|