We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Missing translation for default text

Hi,

I need to get a picture from a diagram in another language (Spain in this case).

But I got only the English translation for Increase, Decrease, Total even though I changed the Culture of the workbook. When I open it with a Spanish Regional Setting, it is translated in Spanish.

Here are the files: XL.zip (333.0 KB)

Here is the code

xlsLic.SetLicense(“Aspose.Total.lic”);
CellsHelper.DPI = 96;
Workbook w3 = new Workbook(“Xl_V2.xlsx”);
w3.Settings.CultureInfo = new System.Globalization.CultureInfo(“es-ES”);
Worksheet excelWorksheet = w3.Worksheets[“Hoja1”];
Aspose.Cells.Range range = excelWorksheet.Workbook.Worksheets.GetRangeByName(“BIPLI_PRUEBA_CASCADA”);
string startCell = CellsHelper.CellIndexToName(range.FirstRow, range.FirstColumn);
string endCell = CellsHelper.CellIndexToName(range.FirstRow + range.RowCount - 1, range.FirstColumn + range.ColumnCount - 1);
string rangeAddress = string.Format("{0}:{1}", startCell, endCell);

        ImageOrPrintOptions options = new ImageOrPrintOptions();
        options.AllColumnsInOnePagePerSheet = true;
        options.ImageType = Aspose.Cells.Drawing.ImageType.Emf;
        //options.ImageFormat = ImageFormat.Emf;
        options.OnePagePerSheet = true;
        options.HorizontalResolution = 600;
        options.VerticalResolution = 600;
        options.OnlyArea = true;

        Aspose.Cells.PageSetup pageSetup = excelWorksheet.PageSetup;


        pageSetup.PrintArea = rangeAddress;
        using (MemoryStream imageStream = new MemoryStream())
        {
            SheetRender sr = new SheetRender(excelWorksheet, options);
            sr.ToImage(0, imageStream);
            Image.FromStream(imageStream).Save("PRUEBA_CASCADA.png", ImageFormat.Emf);

        };

Kind regards,
Nachti

@Nachti,

We are evaluating your issue using your template file.

Could you please share the screenshot to show how legend items are displayed when you open the file into MS Excel manually? This may help to evaluate your issue precisely.

Here it is

Prueba Grafico.png (57.8 KB)

Check header in graph: ‘Aumento’, …
Regards,
Nachti

@Nachti,

Thanks for the screenshot.

Please notice, I am able to reproduce the issue as you mentioned. I found legend entries labels are not translated/converted in accordance with locale/regional settings which is set in code. I tried your sample and also tried to find relevant APIs for globalizations but to no avail. To evaluate and to investigate your issue precisely, I have logged a ticket with an id “CELLSNET-52029” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

Hi @Nachti
For this issue, we will add support for Spanish Chart’s legend labels in future releases.
And before that, You can use existing interfaces to meet your needs, please check the sample project.
ExtendChartGlobalization.zip (306.4 KB)

The image generated using the above project is as follows:
PRUEBA_CASCADA_out_es.png (156.3 KB)