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."
pull/93/head
Oliver Tacke 2020-10-24 18:11:44 +02:00
parent 1a644dda11
commit f3c96e6de5
1 changed files with 3 additions and 3 deletions

View File

@ -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)
};
}
}