全球化 asp.net 应用程序需要了解什么?

What do I need to know to globalize an asp.net application?(全球化 asp.net 应用程序需要了解什么?)

本文介绍了全球化 asp.net 应用程序需要了解什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 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 应用程序需要了解什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:全球化 asp.net 应用程序需要了解什么?

基础教程推荐