From f3c96e6de562c25693fb110b15cde5e76fa2cb17 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Sat, 24 Oct 2020 18:11:44 +0200 Subject: [PATCH] Use en instead of en-US as xAPI language tag According to the xAPI specification at https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#42-language-maps, the "shortest valid language code for each language string is generally preferred. [...] For example, if only the primary language is known (e.g., English) then use the top level language tag en, rather than en-US." --- js/h5p-x-api-event.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index a26b58b..5582d79 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -73,7 +73,7 @@ H5P.XAPIEvent.prototype.setVerb = function (verb) { this.data.statement.verb = { 'id': 'http://adlnet.gov/expapi/verbs/' + verb, 'display': { - 'en-US': verb + 'en': verb } }; } @@ -128,7 +128,7 @@ H5P.XAPIEvent.prototype.setObject = function (instance) { // Don't set titles on main content, title should come from publishing platform if (typeof instance.getTitle === 'function') { this.data.statement.object.definition.name = { - "en-US": instance.getTitle() + "en": instance.getTitle() }; } } @@ -136,7 +136,7 @@ H5P.XAPIEvent.prototype.setObject = function (instance) { var content = H5P.getContentForInstance(instance.contentId); if (content && content.metadata && content.metadata.title) { this.data.statement.object.definition.name = { - "en-US": H5P.createTitle(content.metadata.title) + "en": H5P.createTitle(content.metadata.title) }; } }