1
我有一個單語言GWT應用程序(英文),我想使用本地化的日期和數字格式。GWT中的本地化日期和數字格式
我已將<inherits name="com.google.gwt.i18n.I18N"/>
添加到我的gwt.xml
,但格式保留在en-us
。我已使用此腳本檢查了瀏覽器的lacale
private native String getBrowserLocale() /*-{
return navigator.language!=null ? navigator.language : navigator.browserLanguage;
}-*/;
哪些報告da_DK
。
我也嘗試強制將<meta name="gwt:property" content="locale=da">
加到index.html
,但沒有運氣。
我可以得到正確格式的唯一方法是使用<extend-property name="locale" values="da" />
直接將區域設置添加到gwt.xml
,這非常煩人,因爲有相當多的區域設置可用。
有沒有人知道這個解決方法?