From 0e5052385375ed6b180f40ad814d68fedd9a9249 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Fri, 15 Apr 2016 12:49:09 +0200 Subject: [PATCH] Moved copyright question labels inside the common interface texts. HFJ-1746 --- js/questionset.js | 8 ++++---- language/ar.json | 8 ++++---- language/de.json | 8 ++++---- language/fr.json | 8 ++++---- language/it.json | 8 ++++---- language/nb.json | 8 ++++---- language/nn.json | 8 ++++---- semantics.json | 12 ++++++------ upgrades.js | 10 ++++++++++ 9 files changed, 44 insertions(+), 34 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index cdfde73..0a84928 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -80,7 +80,8 @@ H5P.QuestionSet = function (options, contentId) { nextButton: 'Next question', finishButton: 'Finish', textualProgress: 'Question: @current of @total questions', - jumpToQuestion: 'Jump to question %d' + jumpToQuestion: 'Jump to question %d', + questionLabel: 'Question' }, endGame: { showResultPage: true, @@ -94,8 +95,7 @@ H5P.QuestionSet = function (options, contentId) { solutionButtonText: 'Show solution', retryButtonText: 'Retry', showAnimations: false - }, - questionLabel: 'Question' + } }; var template = new EJS({text: texttemplate}); @@ -574,7 +574,7 @@ H5P.QuestionSet = function (options, contentId) { } // Determine label - var label = (params.questionLabel + ' ' + (i + 1)); + var label = (params.texts.questionLabel + ' ' + (i + 1)); if (qParams.contentName !== undefined) { label += ': ' + qParams.contentName; } diff --git a/language/ar.json b/language/ar.json index b7b49ef..168b643 100644 --- a/language/ar.json +++ b/language/ar.json @@ -79,6 +79,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -170,10 +174,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/de.json b/language/de.json index 9db9662..31b2515 100644 --- a/language/de.json +++ b/language/de.json @@ -84,6 +84,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -185,10 +189,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/fr.json b/language/fr.json index 084511f..5b00c62 100644 --- a/language/fr.json +++ b/language/fr.json @@ -79,6 +79,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -170,10 +174,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/it.json b/language/it.json index 9110c82..14c342f 100644 --- a/language/it.json +++ b/language/it.json @@ -79,6 +79,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -170,10 +174,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/nb.json b/language/nb.json index a091f7b..158c440 100644 --- a/language/nb.json +++ b/language/nb.json @@ -81,6 +81,10 @@ "label": "Merkelapp ved hopping til spørsmål", "description": "Du må bruke plassholderen '%d' istedenfor spørsmålsnummeret.", "default": "Hopp til spørsmål %d" + }, + { + "label": "Opphavsrett spørsmål-etikett", + "default": "Spørsmål" } ] }, @@ -182,10 +186,6 @@ ] } ] - }, - { - "label": "Opphavsrett spørsmål-etikett", - "default": "Spørsmål" } ] } diff --git a/language/nn.json b/language/nn.json index ed50b0a..2549dee 100644 --- a/language/nn.json +++ b/language/nn.json @@ -81,6 +81,10 @@ "label": "Merkelapp ved hopping til spørsmål", "description": "Du må bruke plassholderen '%d' istedenfor spørsmålstalet.", "default": "Hopp til spørsmål %d" + }, + { + "label": "Opphavsrett spørsmål-etikett", + "default": "Spørsmål" } ] }, @@ -182,10 +186,6 @@ ] } ] - }, - { - "label": "Opphavsrett spørsmål-etikett", - "default": "Spørsmål" } ] } diff --git a/semantics.json b/semantics.json index 75cce84..2265924 100644 --- a/semantics.json +++ b/semantics.json @@ -159,6 +159,12 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "name": "questionLabel", + "type": "text", + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -345,11 +351,5 @@ ] } ] - }, - { - "name": "questionLabel", - "type": "text", - "label": "Copyright dialog question label", - "default": "Question" } ] diff --git a/upgrades.js b/upgrades.js index 210d1ac..03c3b56 100644 --- a/upgrades.js +++ b/upgrades.js @@ -41,6 +41,16 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) { delete parameters.override.overrideShowSolutionButton; delete parameters.override.overrideRetry; + // Move copyright dialog question label + if (parameters.questionLabel) { + parameters.texts = parameters.texts || {}; + parameters.texts.questionLabel = parameters.questionLabel; + } + + // Remove old copyright dialog question label + delete parameters.questionLabel; + + finished(null, parameters); } }