Home
Analytics
Localization - location of .properties file inside jar file
hgk
Hi,
How do I specify the location of the .properties file in the report design(abc.rptdesign) if the abc.properties file is in the jar file. The path of the abc.properties file is comxyzreport in the jar file.
The jar file is in WEB-INF/lib.
I cannot place the properties file in the same location as the abc.rptdesign because it is being used by the rest of the web application.
Thanks,
Bindu
Find more posts tagged with
Comments
averma
Hi Bindu:
You can specify it under Resource tab in your property editor.
Ashwini
hgk
Ashwini,
I tried that. During desing time the entries in rptdesign xml file looks like
<property name="includeResource">com.xyz.report.abc</property>
<list-property name="scriptLibs">
<structure>
<property name="name">bin/sat.jar</property>
</structure>
</list-property>
How do I point to the jar in WEB-INF/lib? Could you please give me the xml entries for my example. Should I specify the path for the properties file com.xyz.report.abc?
Thanks,
Bindu
averma
Bindu:
The resource file that you specify here is looked up under the resources folder specified in Windows->Preferences->Report Design->Resource.
Ashwini
satishbabu
Hi Friends,
similar question i hve
i created the one sample report and two properties files like
Resources_en_US.properties,
Resources_ja_JP.properties
in same project ,so when choose the properties file in general Resources File,
only one file apearing as Resources,
and when click ,label go to localization ,got the Resources_en_US.properties, with no content
i tried in another way like created to two properties file like
en_languages.properties
jp_languages.properties
in same project and choose the jp_languages.properties
file by placing all key value pairs in encoded format
but am not getting japanese lang instead getting
some squares boxes like that am struck up with these
hope replay
Parveen
Even I have the same problem,
Have you found the solution, if so please tell me the solution.
Thanks
Parveen
hewb
BIRT properties files are considered as part of report designs, so don't package them in jars, just place them directly under $BIRT_RESOURCE_Folder folder, which could be specified:
1. inside designer, it can be set through Windows->Preferences->Report Design->Resource.
2. in BIRT viewer,it can be specified through the following parameter in web.xml.
<!-- Resource location directory. Default to ${birt home} -->
<context-param>
<param-name>BIRT_RESOURCE_PATH</param-name>
<param-value></param-value>
</context-param>
When the .properties files are published under $BIRT_Resource_Folder, you can use relative path to refer them in BIRT report designs. The approach will work in both open source BIRT as well as Actuate iserver (both iserver express and enterprise).
-wenbin
Parveen
Hi, I did the sme thing, i have file called MyResource_ja_JP.properties, and its content is welcome = モデル, when I am trying to use this file, I am getting only ??? marks in my value.
Please suggest me something, our client is Japanese, they want all the labels in Japanese.
Thanks
Parveen
hewb
<blockquote class='ipsBlockquote' data-author="Parveen"><p>Hi, I did the sme thing, i have file called MyResource_ja_JP.properties, and its content is welcome = モデル, when I am trying to use this file, I am getting only ??? marks in my value.<br />
<br />
Please suggest me something, our client is Japanese, they want all the labels in Japanese.<br />
<br />
Thanks<br />
Parveen</p></blockquote>
<br />
Is your properties in Unicode encoded? if not, you need to convert you properties file into Unicode encoded characters? You can use native2ascii to do that. Please refer to the follow link on how to do this. <a class='bbc_url' href='
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html'>http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html</a>
;
Parveen
Hi, It worked for me,
Thanks
Parveen
Parveen
<blockquote class='ipsBlockquote' data-author="satishbabu"><p>Hi Friends,<br />
similar question i hve <br />
i created the one sample report and two properties files like<br />
Resources_en_US.properties,<br />
Resources_ja_JP.properties<br />
in same project ,so when choose the properties file in general Resources File,<br />
only one file apearing as Resources,<br />
and when click ,label go to localization ,got the Resources_en_US.properties, with no content <br />
<br />
i tried in another way like created to two properties file like<br />
en_languages.properties<br />
jp_languages.properties <br />
in same project and choose the jp_languages.properties <br />
file by placing all key value pairs in encoded format<br />
but am not getting japanese lang instead getting<br />
some squares boxes like that am struck up with these<br />
hope replay</p></blockquote>
<br />
<br />
Take those square boxes, and preview the result, it should work, for me also, while specifying the Key/value it was apearing in square boxes, when I Preview the report, the langauge is appearing, Hope it will work for you.
Parveen
<blockquote class='ipsBlockquote' data-author="hewb"><p>BIRT properties files are considered as part of report designs, so don't package them in jars, just place them directly under $BIRT_RESOURCE_Folder folder, which could be specified:<br />
<br />
1. inside designer, it can be set through Windows->Preferences->Report Design->Resource.<br />
<br />
2. in BIRT viewer,it can be specified through the following parameter in web.xml.<br />
<br />
<!-- Resource location directory. Default to ${birt home} --><br />
<context-param><br />
<param-name>BIRT_RESOURCE_PATH</param-name><br />
<param-value></param-value><br />
</context-param><br />
<br />
When the .properties files are published under $BIRT_Resource_Folder, you can use relative path to refer them in BIRT report designs. The approach will work in both open source BIRT as well as Actuate iserver (both iserver express and enterprise).<br />
<br />
-wenbin</p></blockquote>
<br />
<br />
Hi,<br />
I have one small doubt, after creating the report we need to assign the properties file, so that report will be specific to the .property file, but suppose if my locale is changed, is it possible I can change the property file depend on the locale, i.e if I am changing the locale to eng automatically it should change the property file, without me changing manually.<br />
If u can answer my question it will be great help for me.<br />
Thanks Parveen
hewb
<blockquote class='ipsBlockquote' data-author="Parveen"><p>Hi,<br />
I have one small doubt, after creating the report we need to assign the properties file, so that report will be specific to the .property file, but suppose if my locale is changed, is it possible I can change the property file depend on the locale, i.e if I am changing the locale to eng automatically it should change the property file, without me changing manually.<br />
If u can answer my question it will be great help for me.<br />
Thanks Parveen</p></blockquote>
<br />
yes. You can localize your report designs by providing the translated .properties files for the languages you want to support after the report design is created. Actually that is exactly what you should do for BIRT report design localization. At viewing time, BIRT report engine will load the resource based on the user's locale. BIRT uses java resource bundles to manage the localized resource properties. you can get more info in the following link <a class='bbc_url' href='
http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html'>http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html</a>
;
Parveen
<blockquote class='ipsBlockquote' data-author="averma"><p>Bindu:<br />
<br />
The resource file that you specify here is looked up under the resources folder specified in Windows->Preferences->Report Design->Resource. <br />
<br />
Ashwini</p></blockquote>
<br />
Hi,<br />
I have localized my label, but when I am changing my locale, still I am seing the Japanes code only.<br />
I dont want to do it manually, is there any way where I can select my property file based on locale.<br />
<br />
Any suggestion will be great help.<br />
<br />
Thanks<br />
Parveen
hewb
<blockquote class='ipsBlockquote' data-author="Parveen"><p>Hi,<br />
I have localized my label, but when I am changing my locale, still I am seing the Japanes code only.<br />
I dont want to do it manually, is there any way where I can select my property file based on locale.<br />
<br />
Any suggestion will be great help.<br />
<br />
Thanks<br />
Parveen</p></blockquote>
<br />
Can you explain how you change the locale? <br />
<br />
At design time, the resource properties file name should not include locale as described in <a class='bbc_url' href='
http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html'>http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html</a>
. At report viewing time, you can change the locale through engine RenderTask API. If you are using the sample BIRT viewer, you can change the locale through URL parameter. In this way, the rendered report output will be displayed in the locale specified. By default, the machine's locale will be used.<br />
<br />
If you are using the BIRT built-in L10N framework, the report content will be automatically localized based on the locale specified at viewing time (RenderTask) as long as the corresponding resource properties file for that locale is available. If you are following this process, and still have issues, please make sure your resource properties file name are correct. That's acommon mistake when working with java resource bundles.
parveenh
<blockquote class='ipsBlockquote' data-author="hewb"><p>BIRT properties files are considered as part of report designs, so don't package them in jars, just place them directly under $BIRT_RESOURCE_Folder folder, which could be specified:<br />
<br />
1. inside designer, it can be set through Windows->Preferences->Report Design->Resource.<br />
<br />
2. in BIRT viewer,it can be specified through the following parameter in web.xml.<br />
<br />
<!-- Resource location directory. Default to ${birt home} --><br />
<context-param><br />
<param-name>BIRT_RESOURCE_PATH</param-name><br />
<param-value></param-value><br />
</context-param><br />
<br />
When the .properties files are published under $BIRT_Resource_Folder, you can use relative path to refer them in BIRT report designs. The approach will work in both open source BIRT as well as Actuate iserver (both iserver express and enterprise).<br />
<br />
-wenbin</p></blockquote>
<br />
<br />
Hi,<br />
Do i need to specify this context-param in my webapplication, I did that, where do i read this context-param in Engine file,<br />
<br />
Please can explain me with example.<br />
<br />
Thanks<br />
Parveen
parveenh
Hi,
In my report i have three Parameters 1)From Date 2) To date, and third is Lang_cd, to thi lang_cd I want to pass some java code where I will read the locale, is it possible to do that.
Any Suggestions......
Parveen