Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Colour Changer Localization in German Language 6 years 4 months ago #5200

  • mru@p-didakt.com
  • mru@p-didakt.com's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
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

Please Inloggen or Create an account to join the conversation.

Colour Changer Localization in German Language 6 years 4 months ago #5201

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1286
  • Thank you received: 324
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):
<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):
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
Attachments:
The following user(s) said Thank You: mru@p-didakt.com

Please Inloggen or Create an account to join the conversation.

Last edit: by tom.

Colour Changer Localization in German Language 6 years 4 months ago #5203

  • mru@p-didakt.com
  • mru@p-didakt.com's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
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:
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!

Please Inloggen or Create an account to join the conversation.

Colour Changer Localization in German Language 6 years 4 months ago #5210

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 1286
  • Thank you received: 324
You can find the latest 3.6 file here:
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)

Please Inloggen or Create an account to join the conversation.

  • Page:
  • 1
Moderators: alimcnronm
Time to create page: 0.107 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search