IIntegration
object (to make sure the language is also used in iframes).H5PEditor.render(contentId, language, ...)
with the language code you need.H5PEditor.render(contentId, language, ...)
with the language code you need.translationCallback
of type ITranslationFunction
to the constructor of H5PEditor
H5PError
and AggregateH5PError
and localize the message property yourself.H5PEditor
set the option enableHubLocalization
to true and load the namespace hub
in your localization system. Call H5PEditor.getContentTypeCache()
with a language or make sure that req.language
is set in the GET AJAX route when using h5p-express
.H5PEditor
set the option enableLibraryNameLocalization
to true and load the namespace library-metadata
in your localization system. Call H5PEditor.getLibraryOverview()
with a language or make sure that req.language
is set in the POST AJAX route when using h5p-express
.t(...)
function to be added to the req
object.translationCallback
to H5PEditor
(case 3, 5 and 6) and add the required t(...)
function to req
(case 4).H5PEditor.contentLanguage
property like this to localize the libraries when the editor is initialized :languageOverride
parameter, it is best to use a language detector, which makes sure the req.t method uses the required target language. The easiest way is to implement your own language detector in i18next as explained in their documentation. Initialize i18next with this detector (which can also simply return a hard-coded language if you want to only support one), and the Express adapter will translate to this language./packages/h5p-server/assets/translations/
. In there, each namespace (group of language strings) has it own directory, which in turn contains the language files, which are named like this en.json
, de.json
etc.server
.