Picture of Aga Labrador
Language Picker
by Aga Labrador - Wednesday, 2 May 2018, 3:00 PM
 

Hi Team,

I am trying to incorporate the Language Picker into an existing course via the Adapt Framework.  I tried to add the information provided in the example.json to my config.json and it showed up.  The issue though is that when i click on the buttons (e.g. English), it does not go directly to the course.  Also, the picker isn't showing fully with the top menu overlapping.

Attached herewith is the screenshot and the config.json file.

Language Picker

Picture of Matt Leathes
Re: Language Picker
by Matt Leathes - Wednesday, 2 May 2018, 3:50 PM
 

So, I'm guessing from the contents of config.json that the version of the framework you're using isn't v3.0.0... if so, it could be that you're trying to use the current release of languagePicker which requires the latest framework.

(Look in any plugin's bower.json to see what version of the framework it requires. You'll find the framework version in package.json).

If you are using an older version of the framework, please try v1.0.8 of the languagePicker to see if that makes a difference. But note that you need to have at least framework v2.0.14 (as that's the version where we added multilanguage support).

If that still doesn't work please reply explaining what you tried, what happened and giving any details of any errors in the console tab of your browser's developer tools and we'll do our best to help.

Picture of Aga Labrador
Re: Language Picker
by Aga Labrador - Thursday, 3 May 2018, 3:34 PM
 

Thanks Matt! I checked the package.json and the framework version is 2.2.5.  I went ahead and downloaded the v1.0.8 of the language picker and replaced the existing files inside the adapt-contrib-languagePicker folder.  When I ran the course again, it showed the language picker in full page.  However, upon clicking the buttons, (e.g. English & Deutsch), it doesn't go to the actual course itself.  By theory, it should show the full course after selecting the language.  

Also on the code presented in the example.json, it did not have any items linked to clicking of the button, like if English button is clicked, it will go to the English content.

Picture of Matt Leathes
Re: Language Picker
by Matt Leathes - Thursday, 3 May 2018, 4:28 PM
 

Have you also resolved the issue with config.json that Tom Greenfield pointed out?

it did not have any items linked to clicking of the button

it does - the _language attribute (example). This is the name of the folder that contains all the JSON for that language. You can name this folder anything you like so long as it matches the value of the _language attribute but the convention is to use the ISO 2-letter code as the folder name.

So, if I was building a course that had English and German, my 'src' folder would look like this:

 

Are you getting any errors in the console?

If you haven't already read the wiki page on localisation then you should definitely do that - along with the descriptions of the various settings for the languagePicker extension.

 

Picture of Tom Greenfield
Re: Language Picker
by Tom Greenfield - Wednesday, 2 May 2018, 4:24 PM
 

Looks like you may have accidently wrapped the remainder of your config JSON inside the _langugagePicker object?

Picture of Aga Labrador
Re: Language Picker
by Aga Labrador - Tuesday, 8 May 2018, 2:31 PM
 

Thanks Tom and Matt. The config.json isn't correct and I also missed out on the translation part.  It is working fine now.