[asterisk-gui] Opinion, what do you want in the gui for users?

Pari Nannapaneni pari at digium.com
Wed Apr 18 10:59:28 MST 2007


Hello all,

getting back to our discussions with localization of the GUI,

Because we are not generating the page on the server - we have to update
the content in the page  into the users language after the page has been
rendered by the browser. I have tried a couple of Javascript templating libraries
and found that they are too confusing or requires far many changes in our gui or
that they are not working at all (with prototype.js).

So I am thinking of sticking back to the old trick I initially though of - using span tags

I have just added a simple example to illustrate this.
http://svn.digium.com/view/asterisk-gui?view=rev&rev=697

This might not be the best solution -
but far better than using - eval's or document.write during page load.

So basically what we do is replace our localization strings in the HTML with a span element
like - <span class='lclzn'>users,x</span>
and we just need to call the "apply_lang(lang)" on page load. Ex: apply_lang('en')

function apply_lang(lang){
	var f = document.getElementsByClassName('lclzn');
	for(var i=0; i < f.length ; i++){
		var tmp = f[i].innerHTML.strip().split(",");
		f[i].innerHTML = langs[tmp[0]][lang][tmp[1]] ;
	}
}

and all the localization strings are defined in lang.js, just like tooltips.js
We may even merge the two files if we decide so.
The user's preferred language is stored in the gui preferences file (asterisk_guiConfigFile).

Please let me know if you can think of any alternative solutions
or if you can get the GUI work with any of the templating libraries
we discussed before.

thanks,
-Pari



Pari Nannapaneni wrote:
> Alexandre,
> 
> also check out the Trimpath JST 
> (http://trimpath.com/project/wiki/JavaScriptTemplates)
> mentioned on the MJT homepage.
> 
> lets try MJT and Trimpath, and pick one which is simpler/faster and
> works on both IE and FF.
> 
> thanks
> -Pari
> 
> 
> Alexandre Moutinho Santos wrote:
>> The first (MJT) seems very simple and fast on my Firefox 1.5 Linux
>> version. The second is tested on IE7as it says on the website and has
>> some problems on my Firefox.
>>
>> What do you think we should do on this?
>>
>> Pari Nannapaneni escreveu:
>>> People have been asking for multi language support since forever.
>>> I'll try to work on this today.
>>>
>>> One way is to add a whole lot of
>>> <SPAN> elements and update them with js variables on page load.
>>> but I saw some cool JavaScript Templating libraries last week,
>>> http://mjtemplate.org/
>>> http://ballz.ababa.net/raid_ox/#home
>>>
>>> regards,
>>> -Pari
>>>
>>>
>>>
>>> Facundo Ameal wrote:
>>>> Brandon, it would be and excelent feature. Apart from that it 'd make
>>>> the GUI more extensible and flexible.
>>>>
>>>> On 4/12/07, Alexandre Moutinho Santos
>>>> <alex.moutinho at alexandre-santos.com> wrote:
>>>>> Is there already an idea of how the multi language feature will be
>>>>> implemented? A text file for each language? A function on each html
>>>>> file
>>>>> with arrays, something like $advanced = array ( en => "Advanced", 
>>>>> pt =>
>>>>> "Avançado")?
>>>>>
>>>>> Brandon Kruse escreveu:
>>>>>> I agree, great to see the community getting involved.
>>>>>>
>>>>>>
>>>>>> Well, I have my work cut out for me (especially pari)
>>>>>>
>>>>>> *goes to get redbull and cranks techno music, again*
>>>>>>
>>>>>>
>>>>>>
>>>>>> Facundo Ameal wrote:
>>>>>>> I agree with the file editor.
>>>>>>>
>>>>>>> On 4/11/07, Alexandre Moutinho Santos
>>>>>>> <alex.moutinho at alexandre-santos.com> wrote:
>>>>>>>> Hi again,
>>>>>>>> In my opinion, the file editor is a better solution because it
>>>>> gives us
>>>>>>>> admins the possibility of changing or adding whatever we want.
>>>>> I'm very
>>>>>>>> used to text files because I'm a Linux admin but the windows
>>>>> users or
>>>>>>>> admins will want a GUI with everything on it.
>>>>>>>> I'm installing PBX's connected to a SIP VoIP provider only with the
>>>>>>>> basic menu options. Since the availability of the advanced
>>>>> options for
>>>>>>>> the providers that I don't need to go to the linux console. Of
>>>>> course
>>>>>>>> that if I want a XPTO installation with several servers
>>>>> interconnected,
>>>>>>>> redundancy, Mysql, etc, there is the necessity to go to the
>>>>> console.
>>>>>>>> But
>>>>>>>> an expert is also needed in this situation.
>>>>>>>>
>>>>>>>> Pari Nannapaneni escreveu:
>>>>>>>>>> I think that you might me right, but sometimes it's faster and
>>>>>>>> easier
>>>>>>>>>> for us to change options from a web interface and not ssh and
>>>>>>>> use vim.
>>>>>>>>>> The GUI already has and "Advanced Mode", so it would be good to
>>>>>>>>>> implement advance options in the advanced mode.
>>>>>>>>> The file editor was added to the  advanced menu for the
>>>>>>>>> same reason, i don't know how far that would be helpful.
>>>>>>>>>
>>>>>>>>> -Pari
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Facundo Ameal wrote:
>>>>>>>>>> I think that you might me right, but sometimes it's faster and
>>>>>>>> easier
>>>>>>>>>> for us to change options from a web interface and not ssh and
>>>>> use
>>>>>>>> vim.
>>>>>>>>>> The GUI already has and "Advanced Mode", so it would be good to
>>>>>>>>>> implement advance options in the advanced mode. Besides that,
>>>>> NAT is
>>>>>>>>>> not a complicated feature, don't you agree?
>>>>>>>>>>
>>>>>>>>>> On 4/11/07, santosam at alexandre-santos.com
>>>>>>>>>> <santosam at alexandre-santos.com> wrote:
>>>>>>>>>>> I've been configuring routers and other embedded system from
>>>>> some
>>>>>>>>>>> time now
>>>>>>>>>>> and thinking how things are already done in those cases,
>>>>> here is my
>>>>>>>>>>> opinion: I think that only the options that are more frequently
>>>>>>>> used
>>>>>>>>>>> and
>>>>>>>>>>> more widelly known to the general user should go to the gui. I
>>>>>>>> think
>>>>>>>>>>> that
>>>>>>>>>>> giving to much options to the normal user / newbie is a pandora
>>>>>>>> box.
>>>>>>>>>>> Let
>>>>>>>>>>> me warn you guys that i'm on here also as a professional :-)
>>>>> and
>>>>>>>> those
>>>>>>>>>>> more tricky options should be left for the guys that know
>>>>> how to
>>>>>>>> ssh
>>>>>>>>>>> and
>>>>>>>>>>> sudo and use vim :-)
>>>>>>>>>>>
>>>>>>>>>>>> Hey guys,
>>>>>>>>>>>>
>>>>>>>>>>>> I want to know your opinion on what features and options
>>>>>>>>>>>> do you want to have availible (SIP/IAX/ZAP) to be able to
>>>>> check
>>>>>>>>>>>> mark or change from the gui.
>>>>>>>>>>>>
>>>>>>>>>>>> For example, having nat=yes and a qualify for your NAT on one
>>>>>>>>>>>> side of the asterisk box or anything like that.
>>>>>>>>>>>>
>>>>>>>>>>>> OR having the codecs allow and disallow for what you want
>>>>> on the
>>>>>>>>>>>> specific user.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Give me some ideas! whats important, whats not, how do you
>>>>>>>> want the
>>>>>>>>>>>> options
>>>>>>>>>>>> arranged if you did it.
>>>>>>>>>>>> _______________________________________________



More information about the asterisk-gui mailing list