language dependent resources
#1
Posted 23 February 2012 - 04:03 AM
<simple-property-list name="includeResource">
<value>resources/strings/order_report</value>
</simple-property-list>
So the text keys in resources/strings/order_report.properties are used for the language dependent parts of the report. If I want to change the language, I have the selection either to change the report template (e.g. specifying order_report_de_DE) or to change the resource file so that it contains the wished language resource. But my question is, if there is a possibility to control the resource access via a report parameter, e.g. myLocale, and if so, how the access has to be specified for that.
#2
Posted 27 February 2012 - 08:19 PM
#3
Posted 16 March 2012 - 08:37 AM
JasonW, on 27 February 2012 - 08:19 PM, said:
None of the methods proposed there worked in my context. I run a RunAndRenderTask from my Java application.
In my rptdesign:
<simple-property-list name="includeResource">
<value>order_report</value>
</simple-property-list>
So I have a order_report.properties for the default locale. Furthermore I have order_report_de_DE.properties, if the locale is de_DE. But however, neither setting the locale from the app nor setting the parameter "__locale" to "de_DE" has any effect. Always order_report.properties is taken.
A further question: java.util.Properties does not support UTF-8, what is very uncomfortable using it for translations into non-latin languages. What alternatives for BIRT?
#7
Posted 21 March 2012 - 02:11 AM
thank you for your reply. I were very optimistic as I saw that my config resource path was null. So I set it as you told. But the story is always the same! Finally I renamed my default properties into order_report_en_US.properties, but also in this case the locale en_US is taken, independly what locale the task has. (I'm checking this by slightly changing the resource.)
Peter
#9
Posted 22 March 2012 - 04:26 AM
JasonW, on 21 March 2012 - 11:54 AM, said:
-- yes, at the moment these are order_report_en_US.properties and order_report_de_DE.properties, after I have renamed order_report.properties into order_report_en_US.properties.
Did you add the default properties file to the report design in general resources.
-- as I wrote, my design contains:
<simple-property-list name="includeResource">
<value>order_report</value>
</simple-property-list>
at the top level of the <report> element.
Are you setting the keys on text you want to change based on locale?
-- this is proven by changing the _en_US resource. But why this resource is taken, even if task.getLocale() returns de_DE?
Jason
Peter
#12
Posted 26 March 2012 - 12:09 AM
the designs I deal with have been typically developed by copying and changing. So I don't know how the locale clause got in.
Another question: Is there an element to say within the design, if there is no resource for the current locale (set by task.setLocale), take the resource from another locale, instead of the default values in the design?
Peter





MultiQuote



