Colour Changer Localization in German Language

  • mru@p-didakt.com
  • Onderwerp Auteur
  • Offline
  • Nieuw lid
  • Nieuw lid
Meer
8 jaren 2 weken geleden #5200 door mru@p-didakt.com
Colour Changer Localization in German Language werd gestart door mru@p-didakt.com
Dear Xerte Community,

I am localizing the colour changer in German language (Button + corresponding dialog). The relevant texts for Button and Dialog are provided in the EN-GB engine, but apparently not in other languages engines. Even if I add text in the engine for another language, two lines of code seem to be missing in xenith.js for Xerte to fetch the relevant translation.

The following line seems to be missing in xenith.js in common_html5/js for Xerte to fetch the translation of the button:
label: x_getLangInfo(x_languageData.find("colourChanger")[0], "label", "Colour Changer"),

There seems to be no function to fetch/store the translation of the dialog. I am writing one function by hand, but it is quite complicated as I need to interfere with models_html5/colourChanger.html to replace the texts in the dialog itself.

Has anybody encountered this problem and how did you solve it? Thanks in advance!

Best regards,

Margot Reis

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
8 jaren 2 weken geleden - 8 jaren 2 weken geleden #5201 door tom
Beantwoord door tom in topic Colour Changer Localization in German Language
At least for the latest version of Xerte (3.6) this seems to work fine in Dutch:



So that indicates, that you only would need to change the German engine.xml file (languages/engine_de-DE.xml)

You might need to add nodes there, that are not there yet (but are in the English file):
Code:
<colourChanger label="Colour Changer" description="Change the colours." tooltip="Change Colours"> <closeButton label="" description="Close Colour Changer"/> <selectTxt label="Please select from the options below"/> <adviceTxt label="Need more advice? Visit the &lt;a target=&apos;_blank&apos; href=&apos;http://accessiblepractice.org/v/xerte/play_427&apos;&gt;Xerte Toolkits accessibility guide&lt;/a&gt;."/> <off label="Off"/> <noBg label="Remove Background Images"/> <invert label="Invert"/> <blackYellow label="Black on Yellow"/> </colourChanger>

The xenith.js lines that pick up this translation is on line 1028 and 1033 (in version 3.6):
Code:
x_dialogInfo.push({type:'colourChanger', built:false}); $x_colourChangerBtn .button({ icons: { primary: "x_colourChanger" }, label: x_getLangInfo(x_languageData.find("colourChanger")[0], "tooltip", "Change Colour"), text: false }) .attr("aria-label", $("#x_colourChangerBtn").attr("title") + " " + x_params.dialogTxt) .click(function() { x_openDialog("colourChanger", x_getLangInfo(x_languageData.find("colourChanger")[0], "label", "Colour Changer"), x_getLangInfo(x_languageData.find("colourChanger").find("closeButton")[0], "description", "Close Colour Changer")); $(this) .blur() .removeClass("ui-state-focus") .removeClass("ui-state-hover"); });

Hope this helps
Bijlagen:
Laatst bewerkt 8 jaren 2 weken geleden door tom.
De volgende gebruiker (s) zei dank u: mru@p-didakt.com

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • mru@p-didakt.com
  • Onderwerp Auteur
  • Offline
  • Nieuw lid
  • Nieuw lid
Meer
8 jaren 2 weken geleden #5203 door mru@p-didakt.com
Beantwoord door mru@p-didakt.com in topic Colour Changer Localization in German Language
Thank you very much for your help, Tom!

I added the node in languages/engine_de-DE.xml (same place and identifiers as in the English speaking XML document), but it doesn't seem to work.

Curiously, I see another text in xenith.js although version 36 is supposed to be installed on your server as well:
Code:
x_dialogInfo.push({type:'colourChanger', built:false}); $x_colourChangerBtn .button({ icons: { primary: "x_colourChanger" }, label: "Change Colours", text: false }) .click(function() { x_openDialog("colourChanger", x_getLangInfo(x_languageData.find("colourChanger")[0], "label", "Colour Changer"), x_getLangInfo(x_languageData.find("colourChanger").find("closeButton")[0], "description", "Close Colour Changer")); $(this) .blur() .removeClass("ui-state-focus") .removeClass("ui-state-hover"); });

The functions to fetch the translation for the button label and for the content of the dialog box seem to be missing in my version.

I replaced the code lines in xenith.js with your text, but it doesn't work for the dialog box content.

I think something mentionned here may be defined above in the document:
.attr("aria-label", $("#x_colourChangerBtn").attr("title") + " " + x_params.dialogTxt)

Would you mind sending me your xenith.js file? That would be great!

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
8 jaren 2 weken geleden #5210 door tom
Beantwoord door tom in topic Colour Changer Localization in German Language
You can find the latest 3.6 file here:
Code:
https://raw.githubusercontent.com/thexerteproject/xerteonlinetoolkits/master/modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js

But, please make sure you really have 3.6 installed (you can check by browsing to <url of xerte>/version.txt)

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ronmalimcn
Tijd voor maken pagina: 0.177 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo