language dependent resources
Posted 23 February 2012 - 04:03 AM
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.
Posted 16 March 2012 - 08:37 AM
None of the methods proposed there worked in my context. I run a RunAndRenderTask from my Java application.
In my rptdesign:
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?
Posted 20 March 2012 - 08:47 AM
Immediately before running the task, I control the locale with
System.out.println( "task Locale set to: " + task.getLocale().toString());
but only the default properties are taken!
Posted 20 March 2012 - 09:30 AM
Are you setting the resource folder in your code? And does the resource folder contain your properties files? Did you set the report to include the generic properties file?
//config is EngineConfig
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.)
Posted 21 March 2012 - 11:54 AM
Posted 22 March 2012 - 04:26 AM
-- 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:
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?
Posted 22 March 2012 - 05:29 AM
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?