Mohammed Nasman Posted October 30, 2017 Share Posted October 30, 2017 Hi All, Can I change the hints that shown on the TUniHTMLMemo tool bar, as attached image? If I want to change the text of Font Color to another thing? What I want to do to be able to translate the text of these hints, because I'm developing multi lang app using TsiLang, and I was not able to access to these strings. Regards, Quote Link to comment Share on other sites More sharing options...
Mohammed Nasman Posted November 2, 2017 Author Share Posted November 2, 2017 Any clue? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 2, 2017 Share Posted November 2, 2017 Hi, How many languages do you intend to use ? We will try to give you a solution Quote Link to comment Share on other sites More sharing options...
Mohammed Nasman Posted November 2, 2017 Author Share Posted November 2, 2017 currently two languages, but it may increase to 5 later. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 4, 2017 Share Posted November 4, 2017 Hi, I'm working on it Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 4, 2017 Share Posted November 4, 2017 Hi, One of the possible solutions, Can you try to use this approach for now ?!: 1. MainForm -> Script: changeLang2HtmlMemo = function(htmlMemo, url, lang) { Ext.Loader.loadScript({ url: "/ext-" + url + "/locale/ext-lang-" + lang + ".js", onLoad: function() { var me = htmlMemo; var i = 0; me.toolbar.items.items.forEach(function(item) { if (item.hasOwnProperty('tooltip')) { item.setTooltip(me.buttonTips[item.itemId]); me.toolbar.items.map[item.itemId] = item; if (me.toolbar.items.map[item.itemId].overflowClone) { me.toolbar.items.map[item.itemId].setTooltip(me.buttonTips[item.itemId]); }; me.toolbar.initialConfig.items[i].text = me.buttonTips[item.itemId].text; me.toolbar.initialConfig.items[i].tooltip.title = me.buttonTips[item.itemId].title; me.toolbar.initialConfig.items[i].tooltip.text = me.buttonTips[item.itemId].text; i++; } else { i++ } }); var menu = Ext.getCmp(me.toolbar.id + '-menu-trigger').menu; if (menu) { if (!menu.hidden) { menu.hide(); Ext.defer(function() { menu.show(); }, 100) } } } }) } 2. How to use, for example: uses .. ServerModule; procedure TMainForm.UniButton1Click(Sender: TObject); var Lang: string; begin Lang := 'fr'; UniSession.AddJS('changeLang2HtmlMemo('+UniHTMLMemo1.JSName+',"' +UniServerModule.ExtJSVersion+'","' +Lang+ '")' ); end; ** "available languages", you can find in the folder "...\FMSoft\Framework\uniGUI\ext-[version]\locale\" for example: ext-lang-fr.js -> 'fr' ext-lang-ru.js -> 'ru' Try, Best regards, Quote Link to comment Share on other sites More sharing options...
Mohammed Nasman Posted November 5, 2017 Author Share Posted November 5, 2017 Delphi Developer, Thank you very much, that's did it :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.