Access document generation language in RPE template
Hi,
I use a multilanguage RPE document template within the RTC document builder. The language of the output document reflects the language of the browser (e.g. Chrome). So far, so good. Further, I have some hardcoded strings (generated via scripts) in the RPE document template. How can I switch those strings based on the browser language?
I have searched the language information within the special variable "_sessionInfo" with no luck.
Of course, I could add an additional template variable for the language. But I hope for an automatic solution.
Best Regards
2 answers
RPE/Document Builder uses the OS/browser language. To get the user language, you can use the following expression in RPE template:
java.lang.System.getProperty("user.language")
_sessionInfo can be used to get details like data source URL, username, etc., not locale details.
To set different language/locale (different from the system locale), you can use the metadata property "Output Locale". In Document Builder, click "Edit Advanced Configuration" for the report and you will find this property under Metadata tab.
Comments
I am afraid you cannot get the browser language value in RPE template so that it can be used in condition or script. You cannot use _sessionInfo.getDocspecProperty("property", "") either when you are using Document Builder.
Why can't you remove and add the template elements with hardcoded strings for each language?