Copyright
이 모든 내용은 Pluralsight에 Jeremy Clark가 올린 'Localization and Globalization in .NET'라는 강의의 네번째 챕터를 듣고 정리한 것입니다(https://app.pluralsight.com/library/courses/intro-to-localization-globalization-dotnet/table-of-contents).
Outline
Naming Resource Strings
Danger of culture-specific Image
Translation Considerations
Screen Layout
Exception Messags
Code Analysis Globalization Rule
Resource Naming Recommendation
Name the resources based on their purpose
Page/View-Level Resources
Naming based on purpose
Grouping_Purpose or Grouping_Grouping_Purpose
Assembly-Level Resources
Naming based on purpose
Module_Grouping_Purpose
e.g., MainWindow_Customer_Rating
The Danger of culture-specific Images
The Danger of Flags for Language
If possible, use images that do not rely on culture-specific references
e.g., A US mailbox may not be recognized in another culture, use a letter or postage stamp image instead
If possible, do not include words as part of images
If it is not possible to avoid culture-specific references, then load localized images into the .resx file along with localized strings
Translation Considerations
Machine Translation (like google translator)
Not good enough to go straight into production
But can help with screen layout during development
Human Translation
Prefer native speakers of the target language
Still not perfect - Locker Issue
Best Bet
A human translator who understands the business purpose of the application
Provide the human translator with the business context and let him determine what is best
(Screen shots and Descriptions of a program... etc)
Screen Layout Concerns
Different languages take up different amounts of space.
German words are usually long
Japanese words are usually short
Some languages read right-to-left
Use flow layouts for greatest flexibility
In XAML : use grids and stack panels to hold our controls
Avoid fixed positions and sizes
Favor auto-sizing controls and grids
Windows Forms : TableLayoutPanel, WinRes Tool
WPF, UWP : Grids and StackPanels, Grid - Auto and Star
Exception Messages
To Localize...
The message is displayed to the user
The user can act on the message
To not Localize...
The message is not displayed to the user
The message is logged for support staff
# Exception Thrower
private void ExceptionThrower(Type exceptionType)
{
var currentCulture = Thread.CurrentThread.CurrentUICulutre;
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
try
{
Exception ex;
ex = Activator.CreateInstance(exceptionType) as Exception;
throw ex;
}
finally
{
Thread.CurrentThread.CurrentUICulture = currentCulture;
}
}
Code Analysis Globalization Rule
FXCop is a downloadable tool that analyzes our code and provides suggestions based on a set of rules
This has been incorporated into the Code Analysis tool that is available in some of the VS versions
We're able to choose a rule set that we want to use for analysis in our project.
This is available in the Solution properties.
One of the rule sets is Microsoft Globalization Rules (specifically checks for items that may affect localization and globalization)
The Globalization Rule Set consists of 11 Rules (check the rules for detail)
e.g., 1.Set Microsoft Globalization Rules in Solution properties -> Code Analysis Settings -> Change Rule Set
2. Analyze menu -> Run Code Analysis On Solution
3. Fix the error messages
Warning : Code Analysis do not work at XAML markup
Summary (생략)
출처
이 모든 내용은 Pluralsight에 Jeremy Clark가 올린 'Localization and Globalization in .NET'라는 강의의 네번째 챕터를 듣고 정리한 것입니다(https://app.pluralsight.com/library/courses/intro-to-localization-globalization-dotnet/table-of-contents). 제가 정리한 것보다 더 많은 내용과 Demo를 포함하고 있으며 최종 Summary는 생략하겠습니다. Microsoft 지원을 통해 한달간 무료로 Pluralsight의 강의를 들으실 수도 있습니다.
'Programming > .NET' 카테고리의 다른 글
(Localization and Globalization in .NET) Globalization (0) | 2018.01.01 |
---|---|
(Localization and Globalization in .Net) Fundamentals (0) | 2017.12.30 |
.Net ecosystem (0) | 2017.12.03 |