pari: trunk r697 - in /trunk/config: ./ scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Wed Apr 18 10:21:51 MST 2007


Author: pari
Date: Wed Apr 18 12:21:50 2007
New Revision: 697

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=697
Log:
Experimental - Multi Language support

Added:
    trunk/config/scripts/lang.js
Modified:
    trunk/config/scripts/tooltip.js
    trunk/config/users.html

Added: trunk/config/scripts/lang.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/lang.js?view=auto&rev=697
==============================================================================
--- trunk/config/scripts/lang.js (added)
+++ trunk/config/scripts/lang.js Wed Apr 18 12:21:50 2007
@@ -1,0 +1,20 @@
+// Localization
+
+var langs = new Object;
+
+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]] ;
+	} 
+}
+
+// localization for users.html in english
+	langs['users']= new Object;
+	langs['users'].en = new Array;
+	langs['users'].en[0] = "User and Phone Configuration";
+	langs['users'].en[1] = "";
+	langs['users'].en[2] = "";
+
+

Modified: trunk/config/scripts/tooltip.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/tooltip.js?view=diff&rev=697&r1=696&r2=697
==============================================================================
--- trunk/config/scripts/tooltip.js (original)
+++ trunk/config/scripts/tooltip.js Wed Apr 18 12:21:50 2007
@@ -1,6 +1,6 @@
 
 
-var lang = 'en';
+
 var tooltips = new Object;
 
 function show_tooltip(lang, file,tip){

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?view=diff&rev=697&r1=696&r2=697
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Wed Apr 18 12:21:50 2007
@@ -22,6 +22,7 @@
 <script src="scripts/prototype.js"></script>
 <script src="scripts/rico.js"></script>
 <script src="scripts/astman.js"></script>
+<script src="scripts/lang.js"></script>
 <script src="scripts/tooltip.js"></script>
 <link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
@@ -277,6 +278,8 @@
 		}
 	}
 	*/
+	apply_lang('en');
+
 	setWindowTitle("Users");
 	if(window.location.href.match("sortbynames") ){
 		sortbynames = true;
@@ -321,7 +324,7 @@
 </script>
 <body id="foo" onload="localajaxinit()"  bgcolor="#EFEFEF" onunload="free_mem()">
 <div class="mainscreenTitleBar">
-	<span style="margin-left: 4px;font-weight:bold;">User and Phone Configuration</span>
+	<span style="margin-left: 4px;font-weight:bold;"><span class="lclzn">users,0</span></span>
 	<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span>
 </div>
 <div class="mainscreenContentBox" id="userscontent">



More information about the asterisk-gui-commits mailing list