Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimir 1849 endre punktum til desimaltegn tooltip engelske highchart #2097

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/resources/assets/js/app/highchart.es6
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ const EMPTY_CONFIG = {

// HIGHCHART
export function init() {
Highcharts.setOptions(accessibilityLang)

//Highchart language
//if html = 'nb' then accessibilityLang selected, if html = 'en' then default higcharts eng (no accessibiltyLang selected)
const lang = $('html').attr('lang')
if (lang === 'nb') {
Highcharts.setOptions(accessibilityLang)
}

// Workaround for table ascending/descending sort.
// There is a feature request in github, so a config option to disable the feature is being implemented.
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/assets/js/highchart-lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"downloadPDF": "Last ned som PDF",
"downloadPNG": "Last ned som PNG",
"downloadSVG": "Last ned som SVG",
"downloadCSV": "Last ned tala som CSV",
"downloadXLS": "Last ned tala som XLS",
"downloadCSV": "Last ned tallene som CSV",
"downloadXLS": "Last ned tallene som XLS",
"drillUpText": "Tilbake til {series.name}",
"loading": "Tegner graf...",
"noData": "Tall ikke tilgjengelig",
Expand All @@ -96,4 +96,4 @@
"resetZoomTitle": "Nullstill zoom",
"thousandsSep": " "
}
}
}
12 changes: 10 additions & 2 deletions src/main/resources/site/parts/nameSearch/nameSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ function NameSearch(props) {
function renderGraphs(desktop, nameForRender) {
const { frontPage, phrases, language } = props
const lineColor = '#21383a'
if (nameGraphData) {
const options = {

// Highchart language checker
if (language === 'nb') {
Highcharts.setOptions({
Carl-OW marked this conversation as resolved.
Show resolved Hide resolved
lang: {
...accessibilityLang.lang,
accessibility: {
Expand All @@ -293,7 +295,13 @@ function NameSearch(props) {
legendLabelNoTitle: props.phrases.legendLabelNoTitle,
},
},
decimalPoint: accessibilityLang.lang.decimalPoint,
},
})
}

if (nameGraphData) {
const options = {
chart: {
type: 'spline',
height: frontPage || !desktop ? '380px' : '75%',
Expand Down
8 changes: 2 additions & 6 deletions src/main/resources/site/parts/nameSearch/nameSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import type { NameSearch as NameSearchPartConfig } from '.'
import { getContent, getComponent, pageUrl, serviceUrl } from '/lib/xp/portal'
import { localize } from '/lib/xp/i18n'

const { getLanguageShortName } = __non_webpack_require__('/lib/ssb/utils/language')

exports.get = (req: XP.Request): XP.Response => {
try {
return renderPart(req)
Expand All @@ -24,8 +22,6 @@ function renderPart(req: XP.Request) {
const component = getComponent<NameSearchPartConfig>()
if (!component) throw Error('No part found')

const locale: string = getLanguageShortName(getContent())

const urlToService: string = serviceUrl({
service: 'nameSearch',
})
Expand All @@ -35,8 +31,8 @@ function renderPart(req: XP.Request) {
aboutLink: aboutLinkResources(component.config),
nameSearchDescription: component.config.nameSearchDescription,
frontPage: component.config.frontPage,
phrases: partsPhrases(locale),
language: locale,
phrases: partsPhrases(getContent().language),
language: getContent().language,
GA_TRACKING_ID: GA_TRACKING_ID,
}

Expand Down