Premium support for our pure JavaScript UI components


Post by nramos »

Hi!,
I have a file with the translations of the gantt and the task editor everything works fine, but I can't translate the word days and hours, that I mark in the attached image, it is found both in the general tab, predecessor and successor tab.

Can you tell me how to do it?

I attach a file with the translations

Attachments
editorTask.JPG
editorTask.JPG (68.2 KiB) Viewed 834 times
bryntum translate.json
(16.62 KiB) Downloaded 58 times

Post by mats »

Can you please show how you localized your application? Works fine when you change languages in our demos (use gear icon in top right corner). https://bryntum.com/examples/gantt/advanced/

Please ensure you read this guide thoroughly: https://bryntum.com/docs/gantt/#Gantt/guides/customization/localization.md


Post by nramos »

Hi mats,

It works well, only that I am missing those two words to translate, the ones that I show in the image, but I don't know how to do it, I share the non-executable project.

dashboard-builder - copy.rar(where do i implement the gantt) views/Planning
https://drive.google.com/file/d/1LED48JsK8WiFXEwCK2YiVJgaIazFJmrp/view?usp=sharing

stay tuned.


Post by alex.l »

Hi nramos,

Here is an example for Nl locale.

locale     = {
	DateHelper : {
            locale         : 'nl',
            weekStartDay   : 1,
            // Non-working days which match weekends by default, but can be changed according to schedule needs
            nonWorkingDays : {
                0 : true,
                6 : true
            },
            // Days considered as weekends by the selected country, but could be working days in the schedule
            weekends : {
                0 : true,
                6 : true
            },
            unitNames : [
                { single : 'ms', plural : 'ms', abbrev : 'ms' },
                { single : 'seconde', plural : 'seconden', abbrev : 's' },
                { single : 'minuut', plural : 'minuten', abbrev : 'm' },
                { single : 'uur', plural : 'uren', abbrev : 'u' },
                { single : 'dag', plural : 'dagen', abbrev : 'd' },
                { single : 'week', plural : 'weken', abbrev : 'w' },
                { single : 'maand', plural : 'maanden', abbrev : 'ma' },
                { single : 'kwartaal', plural : 'kwartalen', abbrev : 'kw' },
                { single : 'jaar', plural : 'jaren', abbrev : 'j' },
                { single : 'decennium', plural : 'decennia', abbrev : 'dec' }
            ],
            // Used to build a RegExp for parsing time units.
            // The full names from above are added into the generated Regexp.
            // So you may type "2 w" or "2 wk" or "2 week" or "2 weken" into a DurationField.
            // When generating its display value though, it uses the full localized names above.
            unitAbbreviations : [
                ['mil'],
                ['s', 'sec'],
                ['m', 'min'],
                ['u'],
                ['d'],
                ['w', 'wk'],
                ['ma', 'mnd', 'm'],
                ['k', 'kwar', 'kwt', 'kw'],
                ['j', 'jr'],
                ['dec']
            ],
            parsers : {
                L  : 'DD-MM-YYYY',
                LT : 'HH:mm'
            },
            ordinalSuffix : number => number
        }

    //endregion
};

All the best,
Alex


Post by nramos »

Hello there,

I already have all that and it works well, most of the things I have translated as explained above.

The problem I have is with the words that I mark in the image above.

can that help me?

in my previous comments I gave you my code.

stay tuned


Post by alex.l »

Hi nramos,

The words you marked above may be translated in unitNames array. Did you specify it in your translation? I verified it locally with our examples.

All the best,
Alex


Post by nramos »

Hi!

As I mentioned at the beginning, I am missing only those words to translate, attach the file that I use for the translations, if you look at unitNames I have the translations, even so they are not translated.

stay tuned.

Attachments
bryntum translate.json
(16.62 KiB) Downloaded 63 times

Post by alex.l »

Hi nramos,

I've applied the locale file you attached to our localization demo https://bryntum.com/examples/gantt/localization/

I cannot reproduce the problem you faced with, all works well to me. Please see attachments. I guess the problem is different place. Please check our demo and compare with your solution. If you can't find the cause, please attach a runnable test case here, we will help you out.

Attachments
Screenshot 2021-09-23 at 10.20.44.png
Screenshot 2021-09-23 at 10.20.44.png (93.48 KiB) Viewed 742 times

All the best,
Alex


Post Reply