我正在尝试使用 mergelocales.py 脚本,但无法正常工作。
在我的 ui.xml(我用来测试它的那个)中,我有这个语言环境:
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"
ui:generateLocales="en_US, es_ES"
ui:defaultLocale="es_ES"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
然后我使用“-extra extras”参数编译我的项目。这会在我的项目中生成一个“extras”目录,该目录有一个名为“myModule”的文件夹,该文件夹内是生成的 .properties 文件:
/myproject/extras/myModule/com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_en_US.properties
/myproject/extras/myModule/com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_es_ES.properties
现在,我正在尝试运行 mergelocales.py 以获取 LocalizableResources*.properties 文件,并且当我尝试运行时:
python2.5 ~/Downloads/mergelocales.py extras/myModule src/main/java/com/google/gwt/i18n/client/
我得到以下堆栈跟踪:
Skipping non-default locale in extra directory: com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_en_US.properties
Skipping non-default locale in extra directory: com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_es_ES.properties
Traceback (most recent call last):
File "/Users/admin/Downloads/mergelocales.py", line 497, in <module>
main()
File "/Users/admin/Downloads/mergelocales.py", line 131, in main
mergeLocales( args[0], args[1] )
File "/Users/admin/Downloads/mergelocales.py", line 466, in mergeLocales
pathname = os.path.join( resourcesDir, defaultLocaleFilename )
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 60, in join
if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'
为了让这个脚本正常工作,我缺少什么东西吗?