Colour Changer Localization in German Language

  • mru@p-didakt.com
  • Auteur du sujet
  • Hors Ligne
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 2 semaines #5200 par mru@p-didakt.com
Colour Changer Localization in German Language a été créé par 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 2 semaines - il y a 8 ans 2 semaines #5201 par tom
Réponse de tom sur le sujet 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
Pièces jointes :
Dernière édition: il y a 8 ans 2 semaines par tom.
Les utilisateur(s) suivant ont remercié: mru@p-didakt.com

Connexion ou Créer un compte pour participer à la conversation.

  • mru@p-didakt.com
  • Auteur du sujet
  • Hors Ligne
  • Nouveau membre
  • Nouveau membre
Plus d'informations
il y a 8 ans 2 semaines #5203 par mru@p-didakt.com
Réponse de mru@p-didakt.com sur le sujet 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!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 8 ans 2 semaines #5210 par tom
Réponse de tom sur le sujet 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)

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ronmalimcn
Temps de génération de la page : 0.170 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo