Picture of Guy Begin
Box Menu durationLabel attribute
by Guy Begin - Tuesday, 19 July 2016, 3:29 PM
 

Hello,

I'm trying to use the durationLabel attribute to change the labeling to french like so

 

    "durationLabel": "Durée:",

 

in contentObjects.json, but it seems that it has no effect. I still get the label as Duration:

Has anyone used this function successfully?

 

Picture of Matt Leathes
Re: Box Menu durationLabel attribute
by Matt Leathes - Tuesday, 19 July 2016, 4:42 PM
 

Ah yes - our mistake... you have to put the durationLabel property into course.json as part of the _boxmenu object, like this:

"_boxmenu": {
    "ariaRegion": "Menu",
    "menuItem": "Menu item.",
    "menuEnd": "You have reached the end of the menu.",
    "durationLabel": "Durée:"
}
We updated Box Menu back in November but forgot to update the framework's .json... even now I see that there's still a durationLabel property in contentObjects.json which is confusing.

Picture of Guy Begin
Re: Box Menu durationLabel attribute
by Guy Begin - Tuesday, 19 July 2016, 5:14 PM
 

Where should I put the _boxmenu object? I have tried within the components, right after _slider, but it doesn't seem to work. I still get Duration:

Picture of Matt Leathes
Re: Box Menu durationLabel attribute
by Matt Leathes - Tuesday, 19 July 2016, 6:34 PM
 

I've attached a working example for you.

This does all assume you're using a fairly recent version of framework and boxmenu - if you're not you need to let me know what versions you are using.

Interestingly (I've only just found out about this) you can also change it in the properties.schema for boxmenu... basically if it's not found in course.json's _globals object then the grunt task will copy it from boxmenu's properties.schema instead. The only thing to beware of is that the 'watch' task doesn't look for changes to these files, so if you're running $ grunt dev any changes won't be picked up automatically. You'll have either stop and restart $ grunt dev or use $ grunt build instead.

Picture of Guy Begin
Re: Box Menu durationLabel attribute
by Guy Begin - Tuesday, 19 July 2016, 7:07 PM
 

Thanks Matt!

My course.json file has been created by the authoring tool, so it is rather different.  Also, I was running $ grunt watch. I made the change and voilà!