{"id":21065628,"url":"https://github.com/adaptlearning/adapt-contrib-languagepicker","last_synced_at":"2025-07-15T04:32:44.434Z","repository":{"id":37470225,"uuid":"59643099","full_name":"adaptlearning/adapt-contrib-languagePicker","owner":"adaptlearning","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-12T13:00:56.000Z","size":421,"stargazers_count":2,"open_issues_count":6,"forks_count":20,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-06-12T14:20:00.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adaptlearning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-25T08:01:45.000Z","updated_at":"2025-06-05T08:14:36.000Z","dependencies_parsed_at":"2023-01-24T18:04:21.215Z","dependency_job_id":"c1979bcd-47e5-4f17-9142-7a42ce510700","html_url":"https://github.com/adaptlearning/adapt-contrib-languagePicker","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/adaptlearning/adapt-contrib-languagePicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-languagePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-languagePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-languagePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-languagePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adaptlearning","download_url":"https://codeload.github.com/adaptlearning/adapt-contrib-languagePicker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptlearning%2Fadapt-contrib-languagePicker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265402833,"owners_count":23759237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T17:55:50.372Z","updated_at":"2025-07-15T04:32:44.414Z","avatar_url":"https://github.com/adaptlearning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adapt-contrib-languagePicker\n\n**Language Picker** is an *extension* bundled with the [Adapt framework](https://github.com/adaptlearning/adapt_framework). It is not yet compatible with the Adapt Authoring Tool.\n\n**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.\n\n**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](https://github.com/adaptlearning/adapt_framework/wiki/Core-modules#drawer).\n\n[Visit the **Course Localisation** wiki](https://github.com/adaptlearning/adapt_framework/wiki/Course-Localisation) for more information about how to localise Adapt courses.\n\n\u003cimg src=\"https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/language-picker.gif\" alt=\"\" align=\"center\"\u003e\n\n## Installation\n\nAs one of Adapt's *[core extensions](https://github.com/adaptlearning/adapt_framework/wiki/Core-Plug-ins-in-the-Adapt-Learning-Framework#extensions),* **Language Picker** is included with the [installation of the Adapt framework](https://github.com/adaptlearning/adapt_framework/wiki/Manual-installation-of-the-Adapt-framework#installation).\n\n* If **Language Picker** has been uninstalled from the Adapt framework, it may be reinstalled.\nWith the [Adapt CLI](https://github.com/adaptlearning/adapt-cli) installed, run the following from the command line:\n    ```console\n    adapt install adapt-contrib-languagePicker\n    ```\n\n    Alternatively, this extension can also be installed by adding the following line of code to the *adapt.json* file:\n    ```json\n    \"adapt-contrib-languagePicker\": \"*\"\n    ```\n    Then running the command:\n    ```console\n    adapt install\n    ```\n    (This second method will reinstall all plug-ins listed in *adapt.json*.)\n\n\u003cdiv float align=right\u003e\u003ca href=\"#top\"\u003eBack to Top\u003c/a\u003e\u003c/div\u003e\n\n## Settings Overview\n\nThis extension is configured in *config.json* with the attributes that follow. The attributes are properly formatted as JSON in [*example.json*](https://github.com/adaptlearning/adapt-contrib-languagePicker/blob/master/example.json).\n\n## Attributes (config.json)\n\nThe following attributes are set within *config.json*.\n\n### \\_languagePicker (object):\nThe languagePicker object that contains values for `_isEnabled`, `title`, `displayTitle`, `body`, `_showOnCourseLoad`, `_languagePickerIconClass` and `_restoreStateOnLanguageChange` settings and the `_languages` array.\n\n#### \\_isEnabled (boolean):\nEnables/disables this extension. The default value is `false`. Set this to `true` to enable this extension.\n\n#### title (string):\nBrowser window title text. For example, \"Language selection\".\n\n#### displayTitle (string):\nHeader text. For example, \"Please select a language.\"\n\n#### body (string):\nIntroductory or explanatory text. For example, \"Welcome to ACME Learning. This course is available in several languages. Please make a selection.\"\n\n#### \\_showOnCourseLoad (boolean):\nDetermines 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. The default value is `true`.\n\n#### \\_languagePickerIconClass (string):\nDefines which icon will be displayed in the navigation bar. The [vanilla theme](https://github.com/adaptlearning/adapt-contrib-vanilla) supports the following icon styles: `\"icon-globe\"`, `\"icon-language-1\"`, `\"icon-language-2\"`. The default value for this setting is `\"icon-language-2\"`.\n\n#### \\_restoreStateOnLanguageChange (boolean):\nDetermines whether or not the language picker will try to restore the 'state' of the course when the user changes language. It is advised that you only set this to `true` if all course languages have exactly the same structure; if they do not, some loss of tracking data will occur. If set to `false`, all tracking data will be cleared when the user switches language - the warningMessage (see below) should be used to warn the user of this. The default value is `false`.\n\n#### \\_languages (array):\nThe languages array contains the list of the available languages and the various settings associated with each. Each entry in the array should be an object, containing the following settings:\n\n##### \\_language (string):\nThis 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](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).\n\n##### \\_direction (string):\nSpecifies 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). The default value is `\"ltr\"`.\n\n##### \\_isDisabled (boolean):\nSetting this to `true` allows the language to be shown in the list but in a 'disabled' state (so it cannot be selected). This can be useful in situations where localisation into a particular language has not yet been completed. The default value is `false`.\n\n##### displayName (string):\nThe display name of the language. This value is used as the button label.\n\n##### warningTitle (string):\nThis text appears as the header of the dialog confirming the learner's intent to change languages, for example, \"Change language?\".\n\n##### warningMessage (string):\nThis 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.\u0026lt;br\u0026gt;\u0026lt;br\u0026gt;Would you like to proceed?\".\n\n##### \\_buttons (object):\nThe buttons object contains the following settings:\n\n###### yes (string):\nLabel for the button that confirms the learner's intent to switch languages.\n\n###### no (string):\nLabel for the button that cancels the switch languages dialog.\n\n\u003cdiv float align=right\u003e\u003ca href=\"#top\"\u003eBack to Top\u003c/a\u003e\u003c/div\u003e\n\n## Attributes (course.json)\n\nThe following attributes should be added to _course.json_ under _\\_globals.\\_extensions_.\n\n### \\_languagePicker (object):\nThe languagePicker object that contains values for `navigationBarLabel`, `languageSelector` and `_navTooltip` that contains `_isEnabled`, `text`.\n\n#### navigationBarLabel (string):\nLabel shown next to the language picker button when navigation bar labels are enabled. Defaults to Language picker.\n\n#### languageSelector (string):\nAria label that appears at the top of the drawer displayed when language picker button is clicked. Defaults to Language selector.\n\n#### \\_navTooltip (object):\nThe _navTooltip object that contains values for `_isEnabled` and `text`.\n\n#### \\_isEnabled (boolean):\nEnables/disables tooltips for the language picker button in the navigation bar. The default value is `true`.\n\n#### text (string):\nText to be displayed in the tooltip when the user hovers over the language picker button in the navigation bar. Defaults to 'Language selector'\n\n## Limitations\n\n- If the [**Spoor**](https://github.com/adaptlearning/adapt-contrib-spoor) extension is disabled (or not installed), **Language Picker** will not remember the learner's language choice from the previous session.\n- Switching languages during an [**Assessment**](https://github.com/adaptlearning/adapt-contrib-assessment) will reset assessment attempts.\n- Language Picker is not yet compatible with the Adapt Authoring Tool.\n\n## Notes\n\nIf the [**Spoor**](https://github.com/adaptlearning/adapt-contrib-spoor) extension is enabled and the course is being run from an \u003cabbr title='Learning Management System'\u003eLMS\u003c/abbr\u003e that has support for the `cmi.student_preference.language` data model element, the spoor extension will record the learner's choice of language to that data model element. Note that this is for reporting purposes only: as support for that data model element is not mandatory in SCORM 1.2 it cannot be relied upon for saving/restoring the learner's choice of language - the `cmi.suspend_data` data model element will be used for that, even when `cmi.student_preference.language` is available.\n\nRequires [**Spoor**](https://github.com/adaptlearning/adapt-contrib-spoor) v5.1.0 or later for correct restore of state on language change.\n\n----------------------------\n\n\u003ca href=\"https://community.adaptlearning.org/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg\" alt=\"adapt learning logo\" align=\"right\"\u003e\u003c/a\u003e\n**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-bookmarking/graphs/contributors)\u003cbr\u003e\n**Accessibility support:** WAI AA\u003cbr\u003e\n**RTL support:** Yes\u003cbr\u003e\n**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, Safari for macOS/iOS/iPadOS, Opera\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptlearning%2Fadapt-contrib-languagepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadaptlearning%2Fadapt-contrib-languagepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptlearning%2Fadapt-contrib-languagepicker/lists"}