How to change report locale

4 views (last 30 days)
Achim Kern
Achim Kern on 18 Jun 2019
Hi,
how is it possible to change the report locale from German (default in my case) to english?
I create a pdf report out of my skript like these:
R = Report('report','pdf');
open(R);

Answers (1)

Suryaansh Mata
Suryaansh Mata on 18 Jun 2019
One can change the language or the Report Locale directly in Java from the MATLAB command line. The following example sets the language to Italian:
java.util.Locale.setDefault(java.util.Locale.ITALY)
Alternatively, you can set the preferred language directly in your .rpt file using -:
  1. Right-click the Report component and select Send to Workspace.This displays the properties of the report, which are stored in the variable ans. Access the report's Language property from the command line through this variable. By default, Language is auto, which indicates that the system's default language is in use.
  2. Override the default value of Language by setting this property to your desired language; for example, en for English or it for Italian.
  2 Comments
Achim Kern
Achim Kern on 18 Jun 2019
Thanks for your fast reply.
I had already tried the first solution
java.util.Locale.setDefault(java.util.Locale.ITALY)
But it doesnt work, the chapter names are still in German.
How can I implement the 2. alternative?
I do not have an .rpt file in my root folder.
Is there an other way?
Thanks.
Alberto Flores Martínez
Alberto Flores Martínez on 18 Sep 2020
Edited: Alberto Flores Martínez on 18 Sep 2020
R.Locale='english' worked for me

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!