天天看點

SAP Fiori internationalization(國際化)實作的一些例子CLDR - Unicode Common Locale Data Repository

下圖這個Opportunity的金額,在右邊的明細頁面裡顯示的是1880 USD,但為何在左邊,顯示的是2K這個近似值?

在Chrome開發者工具的調試器裡,我們能看到從背景傳回的金額确實是1880:

是以這個2k一定是前台UI5代碼裡進行的格式化:

答案就在上圖sap.ca.ui.model.format.AmoutFormat.FormatAmoutShort這個方法裡。

這裡涉及到一個CLDR的概念:

CLDR - Unicode Common Locale Data Repository

The Unicode CLDR provides key building blocks for software to support the world's languages, with the largest and most extensive standard repository of locale data available. This data is used by a wide spectrum of companies for their software internationalization and localization, adapting software to the conventions of different languages for such common software tasks.

1880轉換成2k的調試:

本文來自雲栖社群合作夥伴“汪子熙”,了解相關資訊可以關注微信公衆号"汪子熙"。

繼續閱讀