Birt国际化无效 [英] Birt internationalization doesn't work

查看:153
本文介绍了Birt国际化无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我做的:我下载了Birt Runtime 4.2.我部署了WebViewerExample并将报表设计添加到其中.

here is what I did : I downloaded Birt Runtime 4.2. I deployed the WebViewerExample and added my report design to it.

我创建了一些资源/属性文件,并按如下所示对其进行了引用:

I created a few resource/properties files and referenced them like shown below :

然后我为报告中的图形标题选择了适当的键.

Then I selected the appropriate key for a graph title in the report.

结果:在eclipse中,密钥由列表顶部的资源文件中包含的值更改.在浏览器中,我的图形标题的默认值仍然显示...

Result : in eclipse, the key is changed by the value contained in the resource file at the top of the list. In the browser, the default value of my graph title is still displayed...

我已按此处说明的所有内容进行了操作 http://wiki.eclipse.org/BIRT/FAQ/国际化.我还尝试在web.xml中设置属性文件的路径:

I did everything explained here http://wiki.eclipse.org/BIRT/FAQ/Internationalization. I also tried to set the path of my properties files in the web.xml :

 <!-- Resource location directory. Defaults to ${birt home} -->
    <context-param>
            <param-name>BIRT_RESOURCE_PATH</param-name>
            <param-value>resource/</param-value>
    </context-param>

我尝试了不同的路径,例如WebContent/resource或绝对路径,但没有一个起作用.

I tried different paths such as WebContent/resource, or the absolute path, none worked.

我的语言环境被设置了多次:在放置的web.xml中

My locale is set multiple times : in the web.xml I put

<!-- Default locale setting.
-->
<context-param>
    <param-name>BIRT_VIEWER_LOCALE</param-name>
    <param-value>en-US</param-value>
</context-param>

我还在URL中放置了参数__locale = en_US,以防万一它不起作用.但是标题不会以英文显示,并且也没有使用我的任何属性文件.

I also placed the parameter __locale=en_US in the url just in case it wouldn't work. But the title is not displayed in english, and it doesn't use any of my properties file either.

我现在正在失去信心...知道吗?

I am losing faith now... Any idea ?

推荐答案

最终纠正了该错误.问题的根源是资源的路径.

Finally corrected the bug. The problem's source is the path of the resources.

在这里可以执行此操作.如果您使用的是Eclipse并遇到与我相同的错误,请转到窗口">首选项">报表设计">资源",然后将资源文件夹更改为其中包含您的资源的文件夹(而不是<<<<<"当前的Projet文件夹>> ).

Here is what to do so that it works. If you're using Eclipse and get the same error as me, then go to Window > Preferences > Report Design > resource and change the resource folder to the one with your resources in it (instead of << Current Projet Folder >>).

现在,引用您的基本资源文件(例如resources.properties,而不是所有的语言,只是默认的一种,Birt会自己找到其他的resource_lang.properties等).

Now, reference your base resource file (like resources.properties, and not all languages, just the default one, Birt will find the other resources_lang.properties etc on his own).

您现在应该有类似这样的内容:(此处名为birtText.properties的资源文件)

You should now have something like this : (resource file called birtText.properties here)

如果报表设计器的版本与Birt运行时的版本不同,请当心.报表设计器将更改report.design xml源中的某些版本.您可能会遇到运行时问题.为了避免这种情况,请检查旧xml与新xml之间的差异.并放回所有未链接到所引用的新属性文件的内容(链接仅涉及一组新行).

If the version of your report designer is the different from the version of your Birt runtime, take care. The report designer will change some versions in the report.design xml source. You may face a runtime problem. To avoid that, check the differences between the old xml and the new. And put back everything that is not linked to the new properties files referenced (there should be only one group of new lines concerned by the linking).

仅将<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22" id="1">行放回原处就足够了.

Edit : just putting the line <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22" id="1"> back as it was should be enough.

此错误来自以下事实:Birt报表设计器资源文件夹与web.xml中指定的默认资源路径不同-由报表引擎使用(默认文件夹).

This error came from the fact that the birt report designer resource folder was different from the default resource path specified in the web.xml - used by the report engine (the report folder is default).

希望这会有所帮助.它解决了我的问题.

Hope this helps. It solved my problem.

这篇关于Birt国际化无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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