编写国际通用软件的最佳实践 (i18n) [英] Best Practices for writing software to be consumed internationally (i18n)

查看:14
本文介绍了编写国际通用软件的最佳实践 (i18n)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找编写过国际通用软件的专家的意见.我想了解人们在每个逻辑软件层(数据(rdbms)、业务(中间件)、用户界面)采用的最佳实践.

I am looking for opinions from experts that have written software consumed internationally. I would like to understand the best practices people have employeed at each logical softare layer (Data (rdbms), Business (middleware), User Interface).

感谢您提供的任何帮助.

Thanks for any help you can give.

推荐答案

数据

  • 当您转至 UTF-8 时,请准备好每个字符最多占用 3 个字节(在中文的情况下),这意味着 VARCHAR(20) 现在需要成为 VARCHAR(60).
  • 除非您真的有充分的理由这样做,否则看在上帝的份上,不要将您的 UI 翻译存储在数据库中.
  • Data

    • When you go to UTF-8, be prepared for characters to take up to 3 bytes each (in the case of Chinese), which means that VARCHAR(20) now needs to be a VARCHAR(60).
    • Unless you really have a good reason to do it, for the love of god, don't store your UI translations in the DB.
      • 在需求上花费大量时间.作为起点,对应用程序中的每个屏幕进行屏幕截图,将其放入文档中,然后开始围绕需要 i18n 支持的内容绘制框.然后将每个框映射到需要更改的代码区域.

      不要

      string foo = "Page " + currentPage + " of " + totalPages;
      

      string foo = string.Format("Page {0} of {1}", currentPage, totalPages);
      

      为什么?词序很重要.

      <value>Page {0} of {1}</value>
       <value>{1}ページ中の第{0}ページ</value>
      

      UI 中没有什么是神圣的甚至像显示绿色为正数和红色为负数这样基本的东西也是公平游戏.

      Nothing is sacred in the UI Even something as fundamental as showing green for positive numbers and red for negative numbers is fair game.

      这篇关于编写国际通用软件的最佳实践 (i18n)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆