問題描述
我正在編寫一個 asp.net 應用程序,它需要本地化到北美以外的幾個地區.我需要做些什么來為這種全球化做準備?學習如何編寫世界通用的應用程序的最重要的 1 到 2 個資源是什么.
I'm writing an asp.net application that will need to be localized to several regions other than North America. What do I need to do to prepare for this globalization? What are your top 1 to 2 resources for learning how to write a world ready application.
推薦答案
我學到的一些東西:
絕對且殘酷地減少您擁有的包含文本的圖像數量.這樣做將使您的生活輕松 10 億%,因為您不必為每種該死的語言獲取一組新圖像.
Absolutely and brutally minimize the number of images you have that contain text. Doing so will make your life a billion percent easier since you won't have to get a new set of images for every friggin' language.
對于依賴于始終保持相同大小的事物的 css 定位要非常小心.如果這些內容包含文本,它們將不會保持相同的大小,然后您需要返回并修復您的設計.
Be very wary of css positioning that relies on things always remaining the same size. If those things contain text, they will not remain the same size, and you will then need to go back and fix your designs.
如果您在 sql 表中使用字符類型,請確保任何可能接收國際輸入的字符類型都是 unicode(nchar、nvarchar、ntext).就此而言,我只是標準化使用 unicode 版本.
If you use character types in your sql tables, make sure that any of those that might receive international input are unicode (nchar, nvarchar, ntext). For that matter, I would just standardize on using the unicode versions.
如果您正在動態構建 SQL 查詢,請確保在任何引用的文本之前包含 N 前綴,以防文本可能是 unicode.如果您最終將垃圾放入 SQL 表中,請檢查是否存在.
If you're building SQL queries dynamically, make sure that you include the N prefix before any quoted text if there's any chance that text might be unicode. If you end up putting garbage in a SQL table, check to see if that's there.
確保您的所有網頁都明確聲明它們是 unicode 格式.請參閱上面提到的 Joel 的文章.
Make sure that all your web pages definitively state that they are in a unicode format. See Joel's article, mentioned above.
您將在這個項目中大量使用資源文件.這很好——ASP.NET 2.0 對此有很好的支持.您需要查看 App_LocalResources 和 App_GlobalResources 文件夾以及 GetLocalResourceObject、GetGlobalResourceObject 和 meta:resourceKey 的概念.Professional ASP.NET 2.0 的第 30 章有一些很棒的有關的內容.這本書的3.5版本可能也有很好的內容,但我不擁有它.
You're going to be using resource files a lot for this project. That's good - ASP.NET 2.0 has great support for such. You'll want to look into the App_LocalResources and App_GlobalResources folder as well as GetLocalResourceObject, GetGlobalResourceObject, and the concept of meta:resourceKey. Chapter 30 of Professional ASP.NET 2.0 has some great content regarding that. The 3.5 version of the book may well have good content there as well, but I don't own it.
想想字體.您可能想要使用的許多標準字體不支持 unicode.我一直很幸運使用 Arial Unicode MS、MS Gothic、MS Mincho.不過,我不確定這些是如何跨平臺的.另請注意,并非所有字體都支持所有 Unicode 字符定義.再次,測試,測試,測試.
Think about fonts. Many of the standard fonts you might want to use aren't unicode capable. I've always had luck with Arial Unicode MS, MS Gothic, MS Mincho. I'm not sure about how cross-platform these are, though. Also, note that not all fonts support all of the Unicode character definition. Again, test, test, test.
現在開始考慮如何將翻譯輸入到這個系統中.與您的翻譯供應商討論他們希望如何來回傳遞數據以進行翻譯.想想這樣一個事實,通過您的本地資源文件,您可能會在系統中重復一些常用的字符串.您是否將它們規范化為全局資源文件,或者您是否有某種數據庫層,其中每個使用的文本只生成一個副本.在我們最近的項目中,我們使用了從包含所有翻譯和資源文件的原始英文版本的數據庫表中生成的資源文件.
Start thinking now about how you're going to get translations into this system. Go talk to whoever is your translation vendor about how they want data passed back and forth for translation. Think about the fact that, through your local resource files, you will likely be repeating some commonly used strings through the system. Do you normalize those into global resource files, or do you have some sort of database layer where only one copy of each text used is generated. In our recent project, we used resource files which were generated from a database table that contained all the translations and the original, english version of the resource files.
測試.一般來說,我會用德語、波蘭語和亞洲語言(日語、漢語、韓語)進行考試.德語和波蘭語很冗長,幾乎可以保證會拉伸文本區域,亞洲語言使用完全不同的字符集來測試您的 unicode 支持.
Test. Generally speaking I will test in German, Polish, and an Asian language (Japanese, Chinese, Korean). German and Polish are wordy and nearly guaranteed to stretch text areas, Asian languages use an entirely different set of characters which tests your unicode support.
這篇關于全球化 asp.net 應用程序需要了解什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!