Our powerful JS Calendar component


Post by licjapodaca »

I want to change the tooltip text of a button toolbar like so:

...
	prevButton: {
		margin: '0 0 0 16',
		width: 32,
		cls: 'cpv-toolbar-prev',
		tooltip: 'Ir a mes anterior'
	},
	nextButton: {
		width: 32,
		cls: 'cpv-toolbar-next',
		tooltip: 'Ir a siguiente mes'
	},
...

But the previous code doesn't work, still appears the default text like so:

tooltip-button-toolbar.png
tooltip-button-toolbar.png (73.08 KiB) Viewed 667 times

Regards


Post by Animal »

Looking at the screenshot you posted, it looks like you have a Spanish locale file. It could be just that the keys for those buttons are missing.

They are taken from the locale file. See the localization example:

Screenshot 2021-12-01 at 11.00.26.png
Screenshot 2021-12-01 at 11.00.26.png (44.7 KiB) Viewed 654 times

Your locale file needs this section for those buttons (Obviously with the text translated):

    Calendar : {
        Today    : 'Today',
        next     : range => `Next ${range}`, //<---- these are the buttons
        previous : range => `Previous ${range}`,
        plusMore : value => `+${value} more`
    }

Post by licjapodaca »

Excellent, how can I see all the Keys that I must translate?


Post by alex.l »

All the best,
Alex


Post by licjapodaca »

Ok my problem was the version of the Calendar component, I have the v4.2.6, and with that version the Keys next and previous do not translate with the Custom Locale I made in Spanish, but after I upgrade to v4.3.3, the problem was solved.

Thanks in advance...

Regards


Post Reply