Localization data not rendered when accessed using an array



  • Hey JsForum team,

    we realized the following issue using jsrReport 4.6.0. Before this version the following snippet was working in our templates to translate months to the corresponding month names e.g. to english

    Before this was working before jsReport 4.0.6

    {{lookup localize "months" (localizationFolder) settlementMonth}}
    

    our current new fix is the following

    {{localize (concat "months." settlementMonth) (localizationFolder)}}
    

    Now the question: Is this the correct way to extract the data and make the translation or can you provide the correct way?

    Thank you upfront


  • administrators

    hi @lennykey

    Before this was working before jsReport 4.0.6

    do you mean before 4.6.0? right?

    {{lookup localize "months" (localizationFolder) settlementMonth}}

    hmm i am not even sure why using the lookup worked previously here, that way you use the lookup makes use of 4 parameters, even though i think lookup only works with 2 (according to handlebars docs).

    {{localize (concat "months." settlementMonth) (localizationFolder)}}

    This looks good, and it is the correct way to use the localize helper, though i am not sure why you need to wrap the localizationFolder in parentheses (localizationFolder), if it is just a data variable you should not need to use handlebars sub-expressions here.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.