Add WoltLab/WCF/Language
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 17 May 2015 17:23:48 +0000 (19:23 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 17 May 2015 17:31:32 +0000 (19:31 +0200)
com.woltlab.wcf/templates/headIncludeJavaScript.tpl
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/js/WoltLab/WCF/Bootstrap.js
wcfsetup/install/files/js/WoltLab/WCF/Language.js [new file with mode: 0644]

index 9c143ac40b70d2beefd8cfcb1f172afcc6dd978a..cc19269589bb958b16d0e3ccbc3764a86e378640 100644 (file)
 <script data-relocate="true">
        WCF.User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}');
        
-       WCF.Language.addObject({
-               '__days': [ '{lang}wcf.date.day.sunday{/lang}', '{lang}wcf.date.day.monday{/lang}', '{lang}wcf.date.day.tuesday{/lang}', '{lang}wcf.date.day.wednesday{/lang}', '{lang}wcf.date.day.thursday{/lang}', '{lang}wcf.date.day.friday{/lang}', '{lang}wcf.date.day.saturday{/lang}' ],
-               '__daysShort': [ '{lang}wcf.date.day.sun{/lang}', '{lang}wcf.date.day.mon{/lang}', '{lang}wcf.date.day.tue{/lang}', '{lang}wcf.date.day.wed{/lang}', '{lang}wcf.date.day.thu{/lang}', '{lang}wcf.date.day.fri{/lang}', '{lang}wcf.date.day.sat{/lang}' ],
-               '__months': [ '{lang}wcf.date.month.january{/lang}', '{lang}wcf.date.month.february{/lang}', '{lang}wcf.date.month.march{/lang}', '{lang}wcf.date.month.april{/lang}', '{lang}wcf.date.month.may{/lang}', '{lang}wcf.date.month.june{/lang}', '{lang}wcf.date.month.july{/lang}', '{lang}wcf.date.month.august{/lang}', '{lang}wcf.date.month.september{/lang}', '{lang}wcf.date.month.october{/lang}', '{lang}wcf.date.month.november{/lang}', '{lang}wcf.date.month.december{/lang}' ], 
-               '__monthsShort': [ '{lang}wcf.date.month.short.jan{/lang}', '{lang}wcf.date.month.short.feb{/lang}', '{lang}wcf.date.month.short.mar{/lang}', '{lang}wcf.date.month.short.apr{/lang}', '{lang}wcf.date.month.short.may{/lang}', '{lang}wcf.date.month.short.jun{/lang}', '{lang}wcf.date.month.short.jul{/lang}', '{lang}wcf.date.month.short.aug{/lang}', '{lang}wcf.date.month.short.sep{/lang}', '{lang}wcf.date.month.short.oct{/lang}', '{lang}wcf.date.month.short.nov{/lang}', '{lang}wcf.date.month.short.dec{/lang}' ],
-               'wcf.clipboard.item.unmarkAll': '{lang}wcf.clipboard.item.unmarkAll{/lang}',
-               'wcf.date.relative.now': '{lang}wcf.date.relative.now{/lang}',
-               'wcf.date.relative.minutes': '{capture assign=relativeMinutes}{lang}wcf.date.relative.minutes{/lang}{/capture}{@$relativeMinutes|encodeJS}',
-               'wcf.date.relative.hours': '{capture assign=relativeHours}{lang}wcf.date.relative.hours{/lang}{/capture}{@$relativeHours|encodeJS}',
-               'wcf.date.relative.pastDays': '{capture assign=relativePastDays}{lang}wcf.date.relative.pastDays{/lang}{/capture}{@$relativePastDays|encodeJS}',
-               'wcf.date.dateFormat': '{lang}wcf.date.dateFormat{/lang}',
-               'wcf.date.dateTimeFormat': '{lang}wcf.date.dateTimeFormat{/lang}',
-               'wcf.date.shortDateTimeFormat': '{lang}wcf.date.shortDateTimeFormat{/lang}',
-               'wcf.date.hour': '{lang}wcf.date.hour{/lang}',
-               'wcf.date.minute': '{lang}wcf.date.minute{/lang}',
-               'wcf.date.timeFormat': '{lang}wcf.date.timeFormat{/lang}',
-               'wcf.date.firstDayOfTheWeek': '{lang}wcf.date.firstDayOfTheWeek{/lang}',
-               'wcf.global.button.add': '{lang}wcf.global.button.add{/lang}',
-               'wcf.global.button.cancel': '{lang}wcf.global.button.cancel{/lang}',
-               'wcf.global.button.close': '{lang}wcf.global.button.close{/lang}',
-               'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}',
-               'wcf.global.button.delete': '{lang}wcf.global.button.delete{/lang}',
-               'wcf.global.button.disable': '{lang}wcf.global.button.disable{/lang}',
-               'wcf.global.button.disabledI18n': '{lang}wcf.global.button.disabledI18n{/lang}',
-               'wcf.global.button.edit': '{lang}wcf.global.button.edit{/lang}',
-               'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}',
-               'wcf.global.button.hide': '{lang}wcf.global.button.hide{/lang}',
-               'wcf.global.button.next': '{lang}wcf.global.button.next{/lang}',
-               'wcf.global.button.preview': '{lang}wcf.global.button.preview{/lang}',
-               'wcf.global.button.reset': '{lang}wcf.global.button.reset{/lang}',
-               'wcf.global.button.save': '{lang}wcf.global.button.save{/lang}',
-               'wcf.global.button.search': '{lang}wcf.global.button.search{/lang}',
-               'wcf.global.button.submit': '{lang}wcf.global.button.submit{/lang}',
-               'wcf.global.button.upload': '{lang}wcf.global.button.upload{/lang}',
-               'wcf.global.confirmation.cancel': '{lang}wcf.global.confirmation.cancel{/lang}',
-               'wcf.global.confirmation.confirm': '{lang}wcf.global.confirmation.confirm{/lang}',
-               'wcf.global.confirmation.title': '{lang}wcf.global.confirmation.title{/lang}',
-               'wcf.global.decimalPoint': '{capture assign=decimalPoint}{lang}wcf.global.decimalPoint{/lang}{/capture}{$decimalPoint|encodeJS}',
-               'wcf.global.error.timeout': '{lang}wcf.global.error.timeout{/lang}',
-               'wcf.global.form.error.empty': '{lang}wcf.global.form.error.empty{/lang}',
-               'wcf.global.form.error.greaterThan': '{lang __literal=true}wcf.global.form.error.greaterThan{/lang}',
-               'wcf.global.form.error.lessThan': '{lang __literal=true}wcf.global.form.error.lessThan{/lang}',
-               'wcf.global.language.noSelection': '{lang}wcf.global.language.noSelection{/lang}',
-               'wcf.global.loading': '{lang}wcf.global.loading{/lang}',
-               'wcf.global.page.jumpTo': '{lang}wcf.global.page.jumpTo{/lang}',
-               'wcf.global.page.jumpTo.description': '{lang}wcf.global.page.jumpTo.description{/lang}',
-               'wcf.global.page.pageNavigation': '{lang}wcf.global.page.pageNavigation{/lang}',
-               'wcf.global.page.next': '{capture assign=pageNext}{lang}wcf.global.page.next{/lang}{/capture}{@$pageNext|encodeJS}',
-               'wcf.global.page.previous': '{capture assign=pagePrevious}{lang}wcf.global.page.previous{/lang}{/capture}{@$pagePrevious|encodeJS}',
-               'wcf.global.pageDirection': '{lang}wcf.global.pageDirection{/lang}',
-               'wcf.global.reason': '{lang}wcf.global.reason{/lang}',
-               'wcf.global.sidebar.hideLeftSidebar': '{lang}wcf.global.sidebar.hideLeftSidebar{/lang}',
-               'wcf.global.sidebar.hideRightSidebar': '{lang}wcf.global.sidebar.hideRightSidebar{/lang}',
-               'wcf.global.sidebar.showLeftSidebar': '{lang}wcf.global.sidebar.showLeftSidebar{/lang}',
-               'wcf.global.sidebar.showRightSidebar': '{lang}wcf.global.sidebar.showRightSidebar{/lang}',
-               'wcf.global.success': '{lang}wcf.global.success{/lang}',
-               'wcf.global.success.add': '{lang}wcf.global.success.add{/lang}',
-               'wcf.global.success.edit': '{lang}wcf.global.success.edit{/lang}',
-               'wcf.global.thousandsSeparator': '{capture assign=thousandsSeparator}{lang}wcf.global.thousandsSeparator{/lang}{/capture}{@$thousandsSeparator|encodeJS}',
-               'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}',
-               'wcf.page.sitemap': '{lang}wcf.page.sitemap{/lang}',
-               'wcf.style.changeStyle': '{lang}wcf.style.changeStyle{/lang}',
-               'wcf.user.activityPoint': '{lang}wcf.user.activityPoint{/lang}',
-               'wcf.style.changeStyle': '{lang}wcf.style.changeStyle{/lang}',
-               'wcf.user.panel.markAllAsRead': '{lang}wcf.user.panel.markAllAsRead{/lang}',
-               'wcf.user.panel.markAsRead': '{lang}wcf.user.panel.markAsRead{/lang}',
-               'wcf.user.panel.settings': '{lang}wcf.user.panel.settings{/lang}',
-               'wcf.user.panel.showAll': '{lang}wcf.user.panel.showAll{/lang}'
-               {if MODULE_LIKE}
-                       ,'wcf.like.button.like': '{lang}wcf.like.button.like{/lang}',
-                       'wcf.like.button.dislike': '{lang}wcf.like.button.dislike{/lang}',
-                       'wcf.like.tooltip': '{lang}wcf.like.jsTooltip{/lang}',
-                       'wcf.like.summary': '{lang}wcf.like.summary{/lang}',
-                       'wcf.like.details': '{lang}wcf.like.details{/lang}'
-               {/if}
-               
-               {event name='javascriptLanguageImport'}
+       require(['WoltLab/WCF/Language'], function(Language) {
+               Language.addObject({
+                       '__days': [ '{lang}wcf.date.day.sunday{/lang}', '{lang}wcf.date.day.monday{/lang}', '{lang}wcf.date.day.tuesday{/lang}', '{lang}wcf.date.day.wednesday{/lang}', '{lang}wcf.date.day.thursday{/lang}', '{lang}wcf.date.day.friday{/lang}', '{lang}wcf.date.day.saturday{/lang}' ],
+                       '__daysShort': [ '{lang}wcf.date.day.sun{/lang}', '{lang}wcf.date.day.mon{/lang}', '{lang}wcf.date.day.tue{/lang}', '{lang}wcf.date.day.wed{/lang}', '{lang}wcf.date.day.thu{/lang}', '{lang}wcf.date.day.fri{/lang}', '{lang}wcf.date.day.sat{/lang}' ],
+                       '__months': [ '{lang}wcf.date.month.january{/lang}', '{lang}wcf.date.month.february{/lang}', '{lang}wcf.date.month.march{/lang}', '{lang}wcf.date.month.april{/lang}', '{lang}wcf.date.month.may{/lang}', '{lang}wcf.date.month.june{/lang}', '{lang}wcf.date.month.july{/lang}', '{lang}wcf.date.month.august{/lang}', '{lang}wcf.date.month.september{/lang}', '{lang}wcf.date.month.october{/lang}', '{lang}wcf.date.month.november{/lang}', '{lang}wcf.date.month.december{/lang}' ], 
+                       '__monthsShort': [ '{lang}wcf.date.month.short.jan{/lang}', '{lang}wcf.date.month.short.feb{/lang}', '{lang}wcf.date.month.short.mar{/lang}', '{lang}wcf.date.month.short.apr{/lang}', '{lang}wcf.date.month.short.may{/lang}', '{lang}wcf.date.month.short.jun{/lang}', '{lang}wcf.date.month.short.jul{/lang}', '{lang}wcf.date.month.short.aug{/lang}', '{lang}wcf.date.month.short.sep{/lang}', '{lang}wcf.date.month.short.oct{/lang}', '{lang}wcf.date.month.short.nov{/lang}', '{lang}wcf.date.month.short.dec{/lang}' ],
+                       'wcf.clipboard.item.unmarkAll': '{lang}wcf.clipboard.item.unmarkAll{/lang}',
+                       'wcf.date.relative.now': '{lang}wcf.date.relative.now{/lang}',
+                       'wcf.date.relative.minutes': '{capture assign=relativeMinutes}{lang}wcf.date.relative.minutes{/lang}{/capture}{@$relativeMinutes|encodeJS}',
+                       'wcf.date.relative.hours': '{capture assign=relativeHours}{lang}wcf.date.relative.hours{/lang}{/capture}{@$relativeHours|encodeJS}',
+                       'wcf.date.relative.pastDays': '{capture assign=relativePastDays}{lang}wcf.date.relative.pastDays{/lang}{/capture}{@$relativePastDays|encodeJS}',
+                       'wcf.date.dateFormat': '{lang}wcf.date.dateFormat{/lang}',
+                       'wcf.date.dateTimeFormat': '{lang}wcf.date.dateTimeFormat{/lang}',
+                       'wcf.date.shortDateTimeFormat': '{lang}wcf.date.shortDateTimeFormat{/lang}',
+                       'wcf.date.hour': '{lang}wcf.date.hour{/lang}',
+                       'wcf.date.minute': '{lang}wcf.date.minute{/lang}',
+                       'wcf.date.timeFormat': '{lang}wcf.date.timeFormat{/lang}',
+                       'wcf.date.firstDayOfTheWeek': '{lang}wcf.date.firstDayOfTheWeek{/lang}',
+                       'wcf.global.button.add': '{lang}wcf.global.button.add{/lang}',
+                       'wcf.global.button.cancel': '{lang}wcf.global.button.cancel{/lang}',
+                       'wcf.global.button.close': '{lang}wcf.global.button.close{/lang}',
+                       'wcf.global.button.collapsible': '{lang}wcf.global.button.collapsible{/lang}',
+                       'wcf.global.button.delete': '{lang}wcf.global.button.delete{/lang}',
+                       'wcf.global.button.disable': '{lang}wcf.global.button.disable{/lang}',
+                       'wcf.global.button.disabledI18n': '{lang}wcf.global.button.disabledI18n{/lang}',
+                       'wcf.global.button.edit': '{lang}wcf.global.button.edit{/lang}',
+                       'wcf.global.button.enable': '{lang}wcf.global.button.enable{/lang}',
+                       'wcf.global.button.hide': '{lang}wcf.global.button.hide{/lang}',
+                       'wcf.global.button.next': '{lang}wcf.global.button.next{/lang}',
+                       'wcf.global.button.preview': '{lang}wcf.global.button.preview{/lang}',
+                       'wcf.global.button.reset': '{lang}wcf.global.button.reset{/lang}',
+                       'wcf.global.button.save': '{lang}wcf.global.button.save{/lang}',
+                       'wcf.global.button.search': '{lang}wcf.global.button.search{/lang}',
+                       'wcf.global.button.submit': '{lang}wcf.global.button.submit{/lang}',
+                       'wcf.global.button.upload': '{lang}wcf.global.button.upload{/lang}',
+                       'wcf.global.confirmation.cancel': '{lang}wcf.global.confirmation.cancel{/lang}',
+                       'wcf.global.confirmation.confirm': '{lang}wcf.global.confirmation.confirm{/lang}',
+                       'wcf.global.confirmation.title': '{lang}wcf.global.confirmation.title{/lang}',
+                       'wcf.global.decimalPoint': '{capture assign=decimalPoint}{lang}wcf.global.decimalPoint{/lang}{/capture}{$decimalPoint|encodeJS}',
+                       'wcf.global.error.timeout': '{lang}wcf.global.error.timeout{/lang}',
+                       'wcf.global.form.error.empty': '{lang}wcf.global.form.error.empty{/lang}',
+                       'wcf.global.form.error.greaterThan': '{lang __literal=true}wcf.global.form.error.greaterThan{/lang}',
+                       'wcf.global.form.error.lessThan': '{lang __literal=true}wcf.global.form.error.lessThan{/lang}',
+                       'wcf.global.language.noSelection': '{lang}wcf.global.language.noSelection{/lang}',
+                       'wcf.global.loading': '{lang}wcf.global.loading{/lang}',
+                       'wcf.global.page.jumpTo': '{lang}wcf.global.page.jumpTo{/lang}',
+                       'wcf.global.page.jumpTo.description': '{lang}wcf.global.page.jumpTo.description{/lang}',
+                       'wcf.global.page.pageNavigation': '{lang}wcf.global.page.pageNavigation{/lang}',
+                       'wcf.global.page.next': '{capture assign=pageNext}{lang}wcf.global.page.next{/lang}{/capture}{@$pageNext|encodeJS}',
+                       'wcf.global.page.previous': '{capture assign=pagePrevious}{lang}wcf.global.page.previous{/lang}{/capture}{@$pagePrevious|encodeJS}',
+                       'wcf.global.pageDirection': '{lang}wcf.global.pageDirection{/lang}',
+                       'wcf.global.reason': '{lang}wcf.global.reason{/lang}',
+                       'wcf.global.sidebar.hideLeftSidebar': '{lang}wcf.global.sidebar.hideLeftSidebar{/lang}',
+                       'wcf.global.sidebar.hideRightSidebar': '{lang}wcf.global.sidebar.hideRightSidebar{/lang}',
+                       'wcf.global.sidebar.showLeftSidebar': '{lang}wcf.global.sidebar.showLeftSidebar{/lang}',
+                       'wcf.global.sidebar.showRightSidebar': '{lang}wcf.global.sidebar.showRightSidebar{/lang}',
+                       'wcf.global.success': '{lang}wcf.global.success{/lang}',
+                       'wcf.global.success.add': '{lang}wcf.global.success.add{/lang}',
+                       'wcf.global.success.edit': '{lang}wcf.global.success.edit{/lang}',
+                       'wcf.global.thousandsSeparator': '{capture assign=thousandsSeparator}{lang}wcf.global.thousandsSeparator{/lang}{/capture}{@$thousandsSeparator|encodeJS}',
+                       'wcf.page.pagePosition': '{lang __literal=true}wcf.page.pagePosition{/lang}',
+                       'wcf.page.sitemap': '{lang}wcf.page.sitemap{/lang}',
+                       'wcf.style.changeStyle': '{lang}wcf.style.changeStyle{/lang}',
+                       'wcf.user.activityPoint': '{lang}wcf.user.activityPoint{/lang}',
+                       'wcf.style.changeStyle': '{lang}wcf.style.changeStyle{/lang}',
+                       'wcf.user.panel.markAllAsRead': '{lang}wcf.user.panel.markAllAsRead{/lang}',
+                       'wcf.user.panel.markAsRead': '{lang}wcf.user.panel.markAsRead{/lang}',
+                       'wcf.user.panel.settings': '{lang}wcf.user.panel.settings{/lang}',
+                       'wcf.user.panel.showAll': '{lang}wcf.user.panel.showAll{/lang}'
+                       {if MODULE_LIKE}
+                               ,'wcf.like.button.like': '{lang}wcf.like.button.like{/lang}',
+                               'wcf.like.button.dislike': '{lang}wcf.like.button.dislike{/lang}',
+                               'wcf.like.tooltip': '{lang}wcf.like.jsTooltip{/lang}',
+                               'wcf.like.summary': '{lang}wcf.like.summary{/lang}',
+                               'wcf.like.details': '{lang}wcf.like.details{/lang}'
+                       {/if}
+                       
+                       {event name='javascriptLanguageImport'}
+               });
        });
 </script>
 
index b1bd2ef027b07818a22d3779435d21d30d477a6d..a8a6504740abb8326261828799823a2c9d9287cf 100755 (executable)
@@ -3376,54 +3376,24 @@ WCF.Dictionary = Class.extend({
 });
 
 /**
- * Global language storage.
- * 
- * @see        WCF.Dictionary
+ * @deprecated Use WoltLab/WCF/Language
  */
 WCF.Language = {
-       _variables: new WCF.Dictionary(),
-       
-       /**
-        * @see WCF.Dictionary.add()
-        */
        add: function(key, value) {
-               this._variables.add(key, value);
+               console.warn('Call to deprecated WCF.Language.add("' + key + '")');
+               require(['WoltLab/WCF/Language'], function(Language) {
+                       Language.add(key, value);
+               });
        },
-       
-       /**
-        * @see WCF.Dictionary.addObject()
-        */
        addObject: function(object) {
-               this._variables.addObject(object);
+               console.warn('Call to deprecated WCF.Language.addObject()');
+               require(['WoltLab/WCF/Language'], function(Language) {
+                       Language.addObject(object);
+               });
        },
-       
-       /**
-        * Retrieves a variable.
-        * 
-        * @param       string          key
-        * @return      mixed
-        */
        get: function(key, parameters) {
-               // initialize parameters with an empty object
-               if (parameters == null) var parameters = { };
-               
-               var value = this._variables.get(key);
-               
-               if (value === null) {
-                       // return key again
-                       return key;
-               }
-               else if (typeof value === 'string') {
-                       // transform strings into template and try to refetch
-                       this.add(key, new WCF.Template(value));
-                       return this.get(key, parameters);
-               }
-               else if (typeof value.fetch === 'function') {
-                       // evaluate templates
-                       value = value.fetch(parameters);
-               }
-               
-               return value;
+               // This cannot be sanely provided as a compatibility wrapper.
+               throw new Error('Call to deprecated WCF.Language.get("' + key + '")');
        }
 };
 
index 8cd286fee1a27c00383c427a1ad3bebe4e00941e..e0de36cc4222830b44320991e0b4c7086d7e7356 100644 (file)
@@ -12,18 +12,30 @@ define(
        [
                'jquery',            'favico',                 'enquire',                'WoltLab/WCF/Date/Time/Relative',
                'UI/SimpleDropdown', 'WoltLab/WCF/UI/Mobile',  'WoltLab/WCF/UI/TabMenu', 'WoltLab/WCF/UI/FlexibleMenu',
-               'UI/Dialog',         'WoltLab/WCF/UI/Tooltip'
+               'UI/Dialog',         'WoltLab/WCF/UI/Tooltip', 'WoltLab/WCF/Language'
        ], 
        function(
                 $,                   favico,                   enquire,                  relativeTime,
                 simpleDropdown,      UIMobile,                 UITabMenu,                UIFlexibleMenu,
-                UIDialog,            UITooltip
+                UIDialog,            UITooltip,                Language
        )
 {
        "use strict";
        
        window.Favico = favico;
        window.enquire = enquire;
+       window.WCF.Language.get = function(key, parameters) {
+               console.warn('Call to deprecated WCF.Language.get("' + key + '")');
+               return Language.get(key);
+       };
+       window.WCF.Language.add = function(key, value) {
+               console.warn('Call to deprecated WCF.Language.add("' + key + '")');
+               return Language.add(key, value);
+       };
+       window.WCF.Language.addObject = function(object) {
+               console.warn('Call to deprecated WCF.Language.addObject()');
+               return Language.addObject(object);
+       };
        
        /**
         * @constructor
diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Language.js b/wcfsetup/install/files/js/WoltLab/WCF/Language.js
new file mode 100644 (file)
index 0000000..bf87c6e
--- /dev/null
@@ -0,0 +1,72 @@
+/**
+ * Manages language items.
+ * 
+ * @author     Tim Duesterhus
+ * @copyright  2001-2015 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module     WoltLab/WCF/Language
+ */
+define(['Dictionary'], function(Dictionary) {
+       "use strict";
+       
+       var languageItems = new Dictionary();
+       
+       /**
+        * @constructor
+        */
+       function Language() { };
+       Language.prototype = {
+               /**
+                * Adds all the language items in the given object to the store.
+                * 
+                * @param       {Object.<string, string>}       object
+                */
+               addObject: function (object) {
+                       languageItems.merge(Dictionary.fromObject(object));
+               },
+               
+               /**
+                * Adds a single language item to the store.
+                * 
+                * @param       {string}        key
+                * @param       {string}        value
+                */
+               add: function(key, value) {
+                       languageItems.set(key, value);
+               },
+               
+               /**
+                * Fetches the language item specified by the given key.
+                * If the language item is a string it will be evaluated as
+                * WCF.Template with the given parameters.
+                * 
+                * @param       {string}        key             Language item to return.
+                * @param       {Object=}       parameters      Parameters to provide to WCF.Template.
+                * @return      {string}
+                */
+               get: function(key, parameters) {
+                       if (!parameters) parameters = { };
+                       
+                       var value = languageItems.get(key);
+                       
+                       if (value === undefined) {
+                               console.warn("Trying to get() undefined language item.");
+                               return key;
+                       }
+                       
+                       if (typeof value === 'string') {
+                               // lazily convert to WCF.Template
+                               languageItems.set(key, new WCF.Template(value));
+                               value = languageItems.get(key);
+                       }
+                       
+                       if (value instanceof WCF.Template) {
+                               value = value.fetch(parameters);
+                       }
+                       
+                       return value;
+               }
+       };
+       
+       return new Language();
+});