Permalink
Browse files

added minified version to be included in downloaded tarball; added so…

…me tests
  • Loading branch information...
1 parent 7293f12 commit a050c9a0c9905478b76d88e28f91dd137e97c292 @flosse committed Feb 13, 2011
Showing with 271 additions and 40 deletions.
  1. +4 −3 README.txt
  2. +15 −0 build/scaleApp.min.js
  3. +29 −13 src/scaleApp.i18n.js
  4. +181 −17 src/scaleApp.js
  5. +4 −1 src/scaleApp.log.js
  6. +38 −6 test/scaleApp.apiTest.js
View
@@ -1,9 +1,10 @@
# scaleApp
-scaleApp is a tiny JavaScript framework for One-Page-Applications.
-It is inspired by the talk of Nicholas C. Zakas — "Scalable JavaScript Application Architecture".
+scaleApp is a tiny JavaScript framework for scalable One-Page-Applications.
+It is inspired by the talk of Nicholas C. Zakas —
+"Scalable JavaScript Application Architecture" (http://developer.yahoo.com/yui/theater/video.php?v=zakas-architecture).
Unlike his recommendations to abstract DOM manipulations and separating the framework from the base library,
-scaleApp explicitly ueses jQuery as base library. Therefore you can use the full power of jQuery in every layer.
+scaleApp explicitly ueses jQuery as base library. Therefore you can use the full power of jQuery on every layer.
scaleApp is licensed under the MIT license.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -9,19 +9,10 @@
* It is licensed under the MIT licence.
*/
+/**
+ * Class: scaleApp.i18n
+ */
scaleApp.i18n = (function( core ){
-
- var lang = "en";
-
- /**
- * Function: getLanguage
- *
- * Returns:
- * (String) the current language code, that is used globally
- */
- var getLanguage = function(){
- return lang;
- }
/**
* Function: getBrowserLanguage
@@ -33,6 +24,21 @@ scaleApp.i18n = (function( core ){
return navigator.language || navigator.browserLanguage;
};
+ /**
+ * Holds the current global language code.
+ * By default the browsers language is used.
+ */
+ var lang = getBrowserLanguage();
+
+ /**
+ * Function: getLanguage
+ *
+ * Returns:
+ * (String) the current language code, that is used globally.
+ */
+ var getLanguage = function(){
+ return lang;
+ };
/**
* Function: setLanguage
@@ -52,9 +58,19 @@ scaleApp.i18n = (function( core ){
return false;
};
+ /**
+ * Function: _
+ *
+ * Parameters:
+ * (String) instanceId
+ * (String) textId
+ *
+ * Returns
+ * (String) the localized string.
+ */
var _ = function( instanceId, textId ){
var inst = core.getInstance( instanceId );
- core.log.debug(inst)
+
if( inst.opt ){
if( inst.opt.i18n ){
return inst.opt.i18n[ lang ][ textId ];
Oops, something went wrong.

0 comments on commit a050c9a

Please sign in to comment.