Problem/Motivation

The highcharts javascript library provide a way to apply global options to all charts on the same page using Highcharts.setOptions as demonstrated at https://www.highcharts.com/docs/getting-started/how-to-set-options#globa....

Steps to reproduce

For multi lingual website try to translate text like the one related to download csv, pdf or svg.

Proposed resolution

There is a lot of options that can be set globally and I think for the highcharts submodule, by default it should support the following language options for translations purpose:

  • lang.downloadCSV
  • lang.downloadJPEG
  • lang.downloadPDF
  • lang.downloadPNG
  • lang.downloadSVG
  • lang.downloadXLS
  • lang.exitFullscreen
  • lang.hideData
  • lang.loading
  • lang.mainBreadcrumb
  • lang.months
  • lang.noData
  • lang.printChart
  • lang.resetZoom
  • lang.resetZoomTitle
  • lang.shortMonths
  • lang.shortWeekdays
  • lang.viewData
  • lang.viewFullscreen
  • lang.weekdays

Note that this is not an exhaustive list of lang related global options but other can be added later if there is a use case for them.

Remaining tasks

Provide a patch or MR.

User interface changes

New form inputs will show up when setting up highcharts form.

API changes

Nothing at the moment apart that now we need to set the global options.

Data model changes

N/A

Issue fork charts-3317613

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nikathone created an issue. See original summary.

nikathone’s picture

Status: Active » Needs work

This is initial patch is ready for review but I am not sure if we should add test coverage for the post update and feature. That is why I set it to needs work for now.

andileco made their first commit to this issue’s fork.

  • andileco committed 107e11e on 5.0.x authored by nikathone
    Issue #3317613 by nikathone: Add the ability to configure and use global...
andileco’s picture

Status: Needs work » Fixed

I tested on a couple sites and it worked as expected. Thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.