Skip to content

An adapt extension to allow language picking from a drop down in the Navigation bar. With flags.

License

Notifications You must be signed in to change notification settings

theodi/adapt-contrib-languagePickerNavFlags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adapt-contrib-languagePickerNavFlags

Language Picker (NavFlags) Provides a drop down from the navigation bar to choose a language. All the rest is the same as the existing language picker in Adapt.

Language Picker (adapt)

Language Picker is intended to be used with courses that provide content in more than one language. Prior to entering the course, the learner is presented with a group of buttons. Each button is labelled with a language. Clicking a language button loads content in the chosen language.

Language Picker allows the learner to switch languages while the course is in progress. Clicking the icon in the navigation bar reveals the Language Picker in the Drawer.

Visit the Course Localisation wiki for more information about how to localise Adapt courses.

Installation

As one of Adapt's core extensions, Language Picker is included with the installation of the Adapt framework.

  • If Language Picker has been uninstalled from the Adapt framework, it may be reinstalled. With the Adapt CLI installed, run the following from the command line:
    adapt install adapt-contrib-languagePicker

    Alternatively, this extension can also be installed by adding the following line of code to the adapt.json file:
    "adapt-contrib-languagePickerNavFlags": "*"
    Then running the command:
    adapt install
    (This second method will reinstall all plug-ins listed in adapt.json.)

Settings Overview

Language Picker is configured in config.json with the attributes that follow. The attributes are properly formatted as JSON in example.json.

Attributes

The following attributes are set within config.json.

_languagePicker (object): The languagePicker object that contains values for _isEnabled, displayTitle, body, and _languages.

_isEnabled (boolean): Turns the Language Picker extension on and off. Acceptable values are true and false.

title (string): Browser window title text. For example, "Language selection".

displayTitle (string): Header text. For example, "Please select a language."

body (string): Introductory or explanatory text. For example, "Welcome to ACME Learning. This course is available in several languages. Please make a selection. "

_showOnCourseLoad (boolean): Determines whether the language picker will be displayed on course load. If set to false, the course will load with the default language selected and the user will need to use the icon in the navigation bar to change languages.

_languagePickerIconClass (string): The class defined here will define the icon of the language-picker in the navigation bar. The vanilla theme supports the following class-names by default: "icon-globe", "icon-language-1", "icon-language-2". The default value for this attribute is "icon-language-2".

_languages (object): The languages attribute group contains properties related to the available languages. It contains values for _language, _direction, displayName, warningTitle, warningMessage, and _buttons.

_language (string): This text must match the name of the language-specific folder located in the course root, for example, "en" from course/en. It is used as the value for the HTML lang attribute. It is highly recommended that codes for web languages be used. Reference a source such as the IANA Language Subtag Registry.

_direction (string): Specifies the value of the HTML dir attribute and, consequently, the base direction of text. Acceptable values are "rtl" (right-to-left) and "ltr" (left-to-right).

displayName (string): Use this text to identify the full name of the language. This value is used as the button label.

warningTitle (string): This text appears as the header of the dialog confirming the learner's intent to change languages, for example, "Change language?".

warningMessage (string): This text appears as the body of the dialog confirming the learner's intent to change languages, for example, "Changing the language will reset course progress.<br><br>Would you like to proceed?".

_buttons (object): The buttons attribute group stores the label values for the dialog buttons. It contains values for yes and no.

yes (string): Label for button that confirms the learner's intent to switch languages.

no (string): Label for button that cancels the switch languages dialog.

_accessibility (object): The accessibility attribute group stores the text of labels employed with Adapt's accessibility feature. It contains values for _accessibilityToggleTextOn, _accessibilityToggleTextOff, and _accessibilityInstructions.

accessibilityToggleTextOn (string): Label to confirm the learner's intent to enable the accessibility feature.

accessibilityToggleTextOff (string): Label to confirm the learner's intent to disable the accessibility feature.

_accessibilityInstructions (object): The accessibilityInstructions attribute group stores the text of navigation instructions for various types of devices when Adapt's accessibility feature is enabled. It contains values for touch, notouch, and ipad.

touch (string): Instruction text for navigating by gestures.

notouch (string): Instruction text for navigating with the keyboard.

ipad (string): Instruction text for navigating on iPads both by gestures and with the keyboard.

Limitations

  • If the Spoor extension is disabled (or not installed), Language Picker will not remember the learner's language choice from the previous session.

  • Switching languages will reset course progress in the LMS.

  • Switching languages during an Assessment will reset assessment attempts.

  • Language Picker is not yet compatible with the Adapt Authoring Tool.

Dependencies

As well as requiring Adapt Framework v2.0.14 (or better) you will need v2.0.4 (or better) of the Vanilla theme and, if you need your course to be SCORM conformant, v2.0.13 (or better) of the Spoor extension.


Version number: 1.0.7 Framework versions: 2.0.14+
Author / maintainer: David Tarrant & Adapt Core Team with contributors
Accessibility support: WAI AA
RTL support: yes
Cross-platform coverage: Chrome, Chrome for Android, Firefox (ESR + latest version), Edge 12, IE 11, IE10, IE9, IE8, IE Mobile 11, Safari iOS 9+10, Safari OS X 9+10, Opera

About

An adapt extension to allow language picking from a drop down in the Navigation bar. With flags.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published