Page 1 of 1

Using custom properties for localization: how to for Navigation Bar Widget

Posted: Tue Apr 20, 2021 1:57 pm
by simon.schvartzman
Hi humans (robots are not welcomed)...

I'm using Custom Properties to localize my script (thanks to @trevix for showing me the way) and is working fine for Labels and Buttons but can't make it work for changing the labels of a Navigation Bar Widget.

I set up a Custom property like this:

Code: Select all

cREVGeneral
   profileList
      Master
      Spanish
for a label:

Code: Select all

cREVDivergedSpanish
   htmlText
      <p>Español</p>
and for a button:

Code: Select all

cREVDivergedSpanish
   label
      Boton Español
and when revSetStackFileProfile "Spanish", "myCard" is called they magically change from English (which is the original language) to Spanish

Question, how should I set up the custom property for a Navigation Bar Widget in order to change the Navigation data labels?

Would it be possible? How?

Human here says thanks!

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Tue Apr 20, 2021 4:06 pm
by jmburnod
Hi Simon,
You can get/set itemnames property of your widget.
Best regards
Jean-Marc

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Tue Apr 20, 2021 4:21 pm
by simon.schvartzman
Hi Jean-Marc, I guess I was not clear enough with my question. I'm aware I can set/get item names of widgets my question is how to do it using customProperties...

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Tue Apr 20, 2021 7:14 pm
by jmburnod
As far i know widget doesn't have custom properties but you can use custom properties of others controls
Jean-Marc

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Tue Apr 20, 2021 10:16 pm
by simon.schvartzman
Jean-Marc I'm humble opinion widgets do have custom properties.

I hope someone with better knowledge than myself will enter the conversation to clarify...

Anyway many thanks for your replies

Best

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Tue Apr 20, 2021 10:37 pm
by jmburnod
Sorry I was wrong, widgets have custom properties indeed
I understand you want change itemnames of widget when user change langage Correct ?

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Wed Apr 21, 2021 12:31 pm
by simon.schvartzman
I understand you want change itemnames of widget when user change langage Correct ?
Yes this is what I want to accomplish, I know how to do it from a stack, my doubt is if it is doable using custom properties.

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Wed Apr 21, 2021 5:44 pm
by jmburnod
Hi Simon,
Here is a little stack that change labels of widget using custom prop of a widget.
SetLabelsWidget.zip
(2.38 KiB) Downloaded 235 times

Code: Select all

on menupick pItemName
   put the  pItemName of widget 1 into tVar
   set the itemlabels of widget 1 to tVar
end menupick
Jean-Marc

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Wed Apr 21, 2021 5:51 pm
by simon.schvartzman
Thanks Jean-Marc.

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Thu Apr 22, 2021 1:14 pm
by bwmilby
What you are actually running up against is the fact that the profile manager library has not been updated to handle widgets. That is probably one reason that the UI for it was not included in the IDE update.

Re: Using custom properties for localization: how to for Navigation Bar Widget

Posted: Thu Apr 22, 2021 1:19 pm
by simon.schvartzman
Thanks Brian, I guess somehow I already knew that would be the answer to my question...

Anyway I developed a small function to handle the localization through a stack. Not ideal but does the job

Best