View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

OpenbravoPOS Localization/zh cn

Contents

介绍

Openbravo POS设计时就考虑了本地化问题。所有版本的Openbravo POS使用英语开发,以使全世界尽可能多的用户能够使用它。利用Java平台在本地化方面的先天优势,所有的应用元素都可以被本地化:报表,报信信息,对话框,标签,数字格式,日期和货币等。

如果暂时还没有你所需要的语言的标签、报信信息,很容易创建新的文件来翻译这些信息,将这些新的文件加入到运行系统环境中也很容易,不需要重新编译系统或者执行复杂的步骤。

本文档包括如何翻译Openbravo POS到一个新的本地化语言,如何跟踪一些本地化项目。本文档用于Openbravo POS2.0或者以上的版本。

选取Openbravo POS的本地化

All the localization properties of Openbravo POS are available in the configuration panel under the Localization section.

Openbravo POS localization configuration.

The first option defines the locale of the application. This option shows all the locales available for the java platform. If (System default) is selected then the operating system configuration properties are selected.

The rest of the options define the pattern used to format all the values by type. If (Default) is selected then the defined pattern for the selected locale is chosen. However you can overwrite the pattern and select the format you want Openbravo POS to use.

For numeric values the pattern syntax used is documented in DecimalFormat Java API.

For date and time values the pattern syntax used is documented in SimpleDateFormat Java API.

For example if you want to display currency values with the $ symbol leading the ammount, group every three digits and display two decimal numbers, use the pattern "$ #,##0.##".

给Openbravo POS做本地化

Openbravo POS uses the localization support included in the Java platform and all the messages to translate are stored in properties files. An introduction about how to internationalize a java application can be found in Java Tutorial Internationalization.

The files that need to be translated for the application are the following ones:

locales/beans_messages.properties
locales/data_messages.properties
locales/erp_messages.properties
locales/jasper_messages.properties
locales/pos_messages.properties

And the files that need to be translated for the reports and charts included are:

reports/com/openbravo/com/chartsales_messages.properties      
reports/com/openbravo/com/closedpos_messages.properties       
reports/com/openbravo/com/closedproducts_messages.properties  
reports/com/openbravo/com/customers_messages.properties       
reports/com/openbravo/com/inventory_messages.properties       
reports/com/openbravo/com/inventoryb_messages.properties      
reports/com/openbravo/com/inventorydiff_messages.properties   
reports/com/openbravo/com/people_messages.properties
reports/com/openbravo/com/productlabels_messages.properties
reports/com/openbravo/com/products_messages.properties
reports/com/openbravo/com/productsales_messages.properties
reports/com/openbravo/com/productscatalog_messages.properties
reports/com/openbravo/com/taxes_messages.properties
reports/com/openbravo/com/usersales_messages.properties

To create a new translation you only need to copy all these files and rename it using the naming convention that distinguishes one localization from the others. For example, the Spanish version of the pos_messages.properties file should be renamed to pos_messages_es.properties and the Spanish version of Argentina should be renamed to pos_messages_es_AR.properties. An explanation of how these locales are formed are in the article Java Internationalization: Localization with ResourceBundles. And the available locales for java are in Java supported locales

Properties files are encoded using the ISO 8859-1 character encoding and the characters that cannot be directly represented in this encoding, Unicode escapes are used.

For example to localize Openbravo POS to Spanish, the language the code is es and the files will be called as follows:

locales/beans_messages_es.properties
locales/data_messages_es.properties
locales/erp_messages_es.properties
locales/jasper_messages_es.properties
locales/pos_messages_es.properties
reports/com/openbravo/com/chartsales_messages_es.properties      
reports/com/openbravo/com/closedpos_messages_es.properties       
reports/com/openbravo/com/closedproducts_messages_es.properties  
reports/com/openbravo/com/customers_messages_es.properties       
reports/com/openbravo/com/inventory_messages_es.properties       
reports/com/openbravo/com/inventoryb_messages_es.properties      
reports/com/openbravo/com/inventorydiff_messages_es.properties   
reports/com/openbravo/com/people_messages_es.properties
reports/com/openbravo/com/productlabels_messages_es.properties
reports/com/openbravo/com/products_messages_es.properties
reports/com/openbravo/com/productsales_messages_es.properties
reports/com/openbravo/com/productscatalog_messages_es.properties
reports/com/openbravo/com/taxes_messages_es.properties
reports/com/openbravo/com/usersales_messages_es.properties

用Netbeans来做Openbravo POS的本地化

Netbeans has a localization tool that can be used to localize easily Openbravo POS. You do not need the sources to localize Openbravo POS, you only need the *.properties files of the locales folder. With Netbeans you only need to create a new java project that contains only this folder to localize Openbravo POS. You can follow the OpenbravoPOS Developer guide to create a new Netbeans project.

To edit an Openbravo POS *.properties file, select the file in the project view, open the contextual menu and select Open. An editor will appear where you can edit the sentences.

Openbravo POS localization.

If you want to add a new language to a *.properties file, select the file, open the contextual menu and select Add Locale.... A new dialog will appear where you can select a new localization.

Adding a new locale.

如何安装本地化包

A localization package is just a collection of *.properties files like described in the previous paragraph. To install it you have to copy these files into the folders locales and reports of an Openbravo POS installation. Start Openbravo POS and go to the configuration panel and in the locale section select the locale corresponding to the collection of *.properties files. Save the configuration properties and re-start Openbravo POS.

当前本地化项目

Openbravo POS 2.00已经有了下列本地化内容:


国家地区 翻译人员 语言代码 Update for version 可用版本
西班牙 Adrián Romero <aro at openbravo.com> es R2.10 Included in the product
英语 Adrián Romero <aro at openbravo.com> en R2.10 Included in the product
Galician Mancomun.org gl R2.10 Included in the product
法国 Henri Azar fr R2.00 Available from Tracker
荷兰 paul1011, Anton Delaruelle nl R2.10 Available from Tracker
俄罗斯 Project OpenBravo POS RU ru R2.00 Available from Tracker
德国 Sebastian Muszytowski de R2.00 Available from Tracker
巴西 Sergio Carbonete pt_BR R2.00 Available from Tracker

所有翻译都可以在Openbravo POS找到,Subversion源代码库。

新的本地化项目

Please, if you do a new translation, summit it using the Openbravo POS tracker system. Attach the localized files as part of the issue report.

Retrieved from "http://wiki.openbravo.com/wiki/OpenbravoPOS_Localization/zh_cn"

This page has been accessed 11,541 times. This page was last modified on 15 September 2009, at 15:54. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.