score:62
Just to complete a little bit this topic:
All the options related with language are available here
A full Portuguese example:
var highchartsOptions = Highcharts.setOptions({
lang: {
loading: 'Aguarde...',
months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
shortMonths: ['Jan', 'Feb', 'Mar', 'Abr', 'Maio', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
exportButtonTitle: "Exportar",
printButtonTitle: "Imprimir",
rangeSelectorFrom: "De",
rangeSelectorTo: "Até",
rangeSelectorZoom: "Periodo",
downloadPNG: 'Download imagem PNG',
downloadJPEG: 'Download imagem JPEG',
downloadPDF: 'Download documento PDF',
downloadSVG: 'Download imagem SVG'
// resetZoom: "Reset",
// resetZoomTitle: "Reset,
// thousandsSep: ".",
// decimalPoint: ','
}
}
);
score:4
Don't forget to set your dateTimeLabelFormats to correct format;
for example: instead of month: '%b %y'
--> month: '%B %y'
(use long month)
score:6
Use the shortMonths property:
Highcharts.setOptions({
lang: {
shortMonths: [__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'),
__('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')] },
});
score:9
Of course if you are using moment in your stack it is pointless to translate again all these strings from scratch:
moment.locale('it-IT')
Highcharts.setOptions({
lang: {
months: moment.months(),
weekdays: moment.weekdays(),
shortMonths: moment.monthsShort(),
...
}
})
score:13
To localize weekdays, Highcharts.setOptions
should be called before chart creation and contain the new weekday names:
Highcharts.setOptions({
lang: {
weekdays: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']
} });
Note that the array should start with the name for Sunday not Monday (the first day of the work week).
score:16
And in German (note though that the mini-buttons in Highstocks are still labeled "YTD","1y", and "All") :
Highcharts.setOptions({
lang: {
decimalPoint: ',',
thousandsSep: '.',
loading: 'Daten werden geladen...',
months: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
weekdays: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
shortMonths: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
exportButtonTitle: "Exportieren",
printButtonTitle: "Drucken",
rangeSelectorFrom: "Von",
rangeSelectorTo: "Bis",
rangeSelectorZoom: "Zeitraum",
downloadPNG: 'Download als PNG-Bild',
downloadJPEG: 'Download als JPEG-Bild',
downloadPDF: 'Download als PDF-Dokument',
downloadSVG: 'Download als SVG-Bild',
resetZoom: "Zoom zurücksetzen",
resetZoomTitle: "Zoom zurücksetzen"
}
});
To change the range selector buttons, some more information is needed:
rangeSelector: {
buttons: [{
count: 1,
type: 'month',
text: '1M'
}, {
count: 5,
type: 'month',
text: '5M'
}, {
type: 'all',
text: 'Alles'
}],
inputEnabled: false,
selected: 0
},
month/months -> Monat/Monate ("M" is the correct abbreviation)
minute/minutes-> Minute/Minuten
millisecond/milliseconds-> Millisekunde/Millisekunden
year/years -> Jahr/Jahre
all -> Alles (everything) or Gesamt (the whole)
ytd (year to date) -> seit Jahresbeginn (since the start of this year)
Source: stackoverflow.com
Related Query
- Highcharts DateTime Localization
- customize highcharts tooltip to show datetime
- Highcharts datetime axis, how to disable time part (show only dates)?
- highcharts datetime x-axis custom formatting
- HighCharts show datetime format on xAxis
- Highcharts - remove times between dates on a datetime xaxis type
- How to convert datetime string to UTC to plot points on Highcharts
- How to convert datetime string to UTC to plot points on Highcharts
- Highcharts max interval for dateTime in x-axis?
- Highcharts - with datetime axis labels overlap
- Highcharts - show every month on datetime x-axis when the parent container is small
- Highcharts datetime starting on wrong day
- Highcharts displays wrong month (next month) in datetime chart
- Highcharts label format with tickPositioner in a datetime x Axis
- Wrong alignment in highcharts datetime points with xaxis
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to show only specific x-axis values on datetime axis in Highcharts
- Highcharts - Global configuration with common code and unique data & Headings
- HighCharts datetime xAxis without missing values (weekends)
- HighCharts scatter plot with Datetime on X Axis not plotting values correctly
- HighCharts - Creating a Scatter with datetime
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- How to format datetime for (x,y) pair data for Highcharts
- HighCharts Stock Chart error code 18
- highcharts change rendered image source on click
- Highcharts changing tooltip datetime with formatter
- How To Show All Data Labels For Datetime Axis In Highcharts
- How do i add mouse wheel code in Angular2 highcharts in typescript
- how to display 2 same highcharts without duplicate the code
- How to align Highcharts datetime x-axis with data I pass to it?
More Query from same tag
- Add extra labels to line charts
- ng serve causes error: "cannot use namespace as a type"
- Highcharts and NPM/Node
- How to make HighStock / HighChart scroll bar location default to the left hand side?
- Using a highstock chart with stacked series
- Highcharts > Tooltip > Crosshair: How to set horizontal crosshair to snap to CLOSE in OHLC series?
- Showing only one tooltip for all. Highstock highcharts
- Dynamically add an object property to existing object
- Responsive meteogram (icons) highcharts
- javascript for loop through nested json values
- Unhandled promise rejection mongoose aggregate
- highchart select an area to show some info by clicking and drag mouse but not release
- How to use date range for highcharter columnrange plot?
- Highcharts custom SVG marker
- How to implement the KDJ indicator calculation in highcharts
- Plot percentages on y-axis with rhighcharts?
- Highchart multi axes labels not showing
- Highcharts: Using an array as a data series - ordering
- How to update multiple highcharts charts with one function
- Select default view on charts as 1month rather than all
- How can I change a Highcharts bar color based on a third field?
- How to create a custom tooltip in highstocks
- Population pyramid for different regions in Highcharts
- Changing the way the data is shown in Highcharts
- High charts draggable not working for log scale
- Highcharts: How to add another(custom) label/ legend/ something else to the top right of the graph?
- Highcharts: why does redrawing change the radius of the selected point?
- Change color of selected point in HighCharts dynamically
- Making a timeline in Highcharts
- Highcharts svg convert to png with server