Menu

Support for Translation Bundle

Peter Pahn
2017-09-08
2020-05-26
  • Peter Pahn

    Peter Pahn - 2017-09-08

    Hi,

    is it possible to support Translation Ressources? I implemented it in the report and it works fine wiht JR Studio. When I upload all the report files incl. the TranslationResources.properties files it does not render saying it can not find the ressource files even thou they are in the correct directory.

    thanks

     
  • Michael

    Michael - 2017-09-09

    Hi Peter,

    I guess you mean that yopu want to use a "Resource Bundle" containing translation strings that you want to use inside your report with "$R{...}".
    That should work.
    I.e., if you have specified in your jrxml the following:

    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Departments" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="project2/resources/Departments" whenResourceMissingType="Key" uuid="dbe7c04b-5ec9-4c69-bcb1-ce722659dd47">

    Consider the resourceBundle attribute. It's set to "project2/resources/Departments".
    This means that you have to place your resources files into a "resources" directory that is placed in a "project2" directory inside your configured reportPath directory.

    The resource files must have specific file names.
    I.e.:
    "Department_de_DE.properties" for German (Germany), "Department_de_AT.properties" for Germn (Austria)", "Department_fr" for French etc., and finally a default "Department.properties".

    Hope this helps.

    Regards,
    Michael

     
  • Peter Pahn

    Peter Pahn - 2017-09-11

    Hi Michael,

    Thanks for the reply, will try it and get back to you.

    Thanks

     

Log in to post a comment.