Skip to content

Commit

Permalink
changed hardcoded button names for translation (parameters)
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerZarth committed Oct 11, 2023
1 parent 85ae27b commit f073e81
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
15 changes: 9 additions & 6 deletions plugins/h5p-drawing-board/drawing-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ H5P.DrawingBoard = (function (_$) {
* @param {string | undefined} options.backgroundColor
* @param {string} options.fileName
* @param {boolean} options.devMode
* @param {string} options.buttonNew
* @param {string} options.buttonSave
* @param {string} options.buttonFulls
* @param {number} id
*/
function C(options, id) {
Expand Down Expand Up @@ -95,7 +98,7 @@ H5P.DrawingBoard = (function (_$) {
const {majorVersion, minorVersion} = this.libraryInfo;
this.log(`initializing H5P Drawing Board (v${version} | ${majorVersion}.${minorVersion})`);
$container.addClass('h5p-drawing-board');
const {header, description, hideText} = this.options;
const {header, description, hideText, buttonNew, buttonSave, buttonFulls, buttonFullsExit} = this.options;
const {id} = this;
const {hostname} = window.location;
const LOCAL_STORAGE_KEY = `h5p-drawing-board-canvas-storage-${version}-${hostname}-${id}`;
Expand Down Expand Up @@ -386,9 +389,9 @@ H5P.DrawingBoard = (function (_$) {

$container.append(`
<div class="bottom-controls-container">
<button id="clear-button-${id}" class="bottom-button">Neu</button>
<button id="save-button-${id}" class="bottom-button">Speichern</button>
<button id="fullscreen-button-${id}" class="bottom-button">Vollbild</button>
<button id="clear-button-${id}" class="bottom-button">${buttonNew}</button>
<button id="save-button-${id}" class="bottom-button">${buttonSave}</button>
<button id="fullscreen-button-${id}" class="bottom-button">${buttonFulls}</button>
</div>
`);

Expand All @@ -411,13 +414,13 @@ H5P.DrawingBoard = (function (_$) {

this.on('enterFullScreen', () => {
this.log('entering fullscreen');
fullscreenButton.innerHTML = 'Vollbildmodus beenden';
fullscreenButton.innerHTML = buttonFullsExit;
title.style.display = 'none';
descr.style.display = 'none';
});
this.on('exitFullScreen', () => {
this.log('exiting fullscreen');
fullscreenButton.innerHTML = 'Vollbildmodus';
fullscreenButton.innerHTML = buttonFulls;
title.style.display = 'block';
descr.style.display = 'block';
});
Expand Down
2 changes: 1 addition & 1 deletion plugins/h5p-drawing-board/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Displays a simple drawing board",
"majorVersion": 1,
"minorVersion": 3,
"patchVersion": 12,
"patchVersion": 14,
"runnable": 1,
"author": "Stefan Wintergerst",
"license": "MIT",
Expand Down
28 changes: 28 additions & 0 deletions plugins/h5p-drawing-board/semantics.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,33 @@
"type": "boolean",
"default": false,
"description": "Do not touch!"
},
{
"label": "Bezeichung Button Neu",
"name": "buttonNew",
"type": "text",
"default": "Neu",
"description": "rename the Button New"
},
{
"label": "Bezeichung Button Speichern",
"name": "buttonSave",
"type": "text",
"default": "Speichern",
"description": "rename the Button Save"
},
{
"label": "Bezeichung Button Vollbild",
"name": "buttonFulls",
"type": "text",
"default": "Vollbild",
"description": "rename the Button Fullscreen"
},
{
"label": "Bezeichung Button Vollbild beenden",
"name": "buttonFullsExit",
"type": "text",
"default": "Vollbild beenden",
"description": "rename the Button exit Fullscreen"
}
]

0 comments on commit f073e81

Please sign in to comment.