Permalink
Browse files

Moved broke.i18n to broke.utils.translation

  • Loading branch information...
1 parent 30d32d6 commit 6ff69a4c4ddd821e6ee0db285469be6669b9788b @brokenseal committed Feb 22, 2010
View
@@ -205,7 +205,7 @@ var broke= {},
localePaths.populate(getattr(broke.BROKE_SETTINGS_OBJECT).LOCALE_PATHS);
localePaths.each(function(){
- broke.i18n.init({
+ broke.utils.translation.init({
url: this + localePath
});
});
@@ -283,7 +283,7 @@ var broke= {},
/****************************** INIT *********************************/
init: function(){
- var gettext= broke.i18n.gettext,
+ var gettext= broke.utils.translation.gettext,
settings;
if(_isReady) {
View
@@ -1,16 +0,0 @@
-(function(){
- broke.extend(broke.i18n, {
- init: function(args) {
- domain= 'broke';
- url= args.url;
-
- if(url) {
- gettext.tryLoadLangPo(url);
- } else {
- gettext.tryLoadLang();
- }
- },
- gettext: gettext.gettext,
- ngettext: gettext.ngettext
- });
-})();
@@ -3,7 +3,7 @@
/****************************************************************************/
(function(){
- var gettext= broke.i18n.gettext,
+ var gettext= broke.utils.translation.gettext,
NoReverseMatch= broke.exceptions.NoReverseMatch;
broke.extend({
View
@@ -6,8 +6,6 @@
*/
(function(){
- var gettext= broke.i18n.gettext;
-
broke.extend(window, {
forEach: function(obj, fn){
var key;
@@ -47,8 +45,8 @@
return value.join();
},
// a better getattr that actually cycle through all the attributes
- // e.g.: getattr('href', window.location) => location.href
- // e.g.: getattr('location.href') => location.href
+ // e.g.: getattr('href', window.location) => window.location.href
+ // e.g.: getattr('location.href') => window.location.href
// e.g.: getattr('broke.template.defaultFilters') => broke.template.defaultFilters
// e.g.: getattr('defaultFilters', broke.template) => broke.template.defaultFilters
getattr: function(str, obj){
@@ -202,7 +200,7 @@
key: function(key){
throw {
name: "NotImplemented",
- description: gettext("Sorry, this version of localStorage is a fake and does not support key() method.")
+ description: "Sorry, this version of localStorage is a fake and does not support key() method."
};
},
setItem: function(key, value){
File renamed without changes.
@@ -1,5 +1,5 @@
(function(){
- var gettext= broke.i18n.gettext,
+ var gettext= broke.utils.translation.gettext,
module= "broke.db.models.fields",
GenericError= broke.exceptions.GenericError,
validators= broke.core.validators,
@@ -1,5 +1,5 @@
(function(){
- var gettext= broke.i18n.gettext;
+ var gettext= broke.utils.translation.gettext;
/*************************************************************************/
/******************************* MODEL ***********************************/
View
@@ -1,5 +1,5 @@
(function(){
- var gettext= broke.i18n.gettext;
+ var gettext= broke.utils.translation.gettext;
/*************************************************************************/
/************************** BASE QUERYSET CLASS **************************/
@@ -1,6 +1,6 @@
(function(){
- var ngettext= broke.i18n.ngettext,
- gettext= broke.i18n.gettext,
+ var ngettext= broke.utils.translation.ngettext,
+ gettext= broke.utils.translation.gettext,
defaultFilters= {
add: function(value){
return value.asInt() + value.asInt();
@@ -2,7 +2,7 @@
var tpl= broke.template,
register= tpl.register,
TemplateSyntaxError= broke.exceptions.TemplateSyntaxError,
- gettext= broke.i18n.gettext;
+ gettext= broke.utils.translation.gettext;
register.tag('if', function(parser, token){
var bits = token.content.split(/\s+/),
View
@@ -1,6 +1,6 @@
(function(){
var tpl= broke.template,
- gettext= broke.i18n.gettext,
+ gettext= broke.utils.translation.gettext,
TemplateSyntaxError= broke.exceptions.TemplateSyntaxError;
broke.Class.extend("broke.template.Parser", {
View
@@ -0,0 +1,18 @@
+(function(){
+ broke.extend(broke.utils, {
+ translation: {
+ init: function(args) {
+ domain= 'broke';
+ url= args.url;
+
+ if(url) {
+ gettext.tryLoadLangPo(url);
+ } else {
+ gettext.tryLoadLang();
+ }
+ },
+ gettext: gettext.gettext,
+ ngettext: gettext.ngettext
+ }
+ });
+})();
View
@@ -0,0 +1,5 @@
+(function(){
+ broke.extend({
+ utils: {}
+ });
+})();
View
@@ -3,7 +3,7 @@
/*************************************************************************/
(function(){
- var gettext= broke.i18n.gettext;
+ var gettext= broke.utils.translation.gettext;
broke.views= {
setLanguage: function(request){

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 6ff69a4

Please sign in to comment.