Skip to content
Browse files

Merge branch 'master' of github.com:mitchellsimoens/Ux.locale.Manager

Conflicts:
	Ux/locale/override/st/field/Field.js
  • Loading branch information...
2 parents 6fad0a3 + c353d36 commit 377da896e874eaee938db28314f59b77b18a1b62 @mitchellsimoens mitchellsimoens committed Apr 10, 2012
Showing with 68 additions and 5 deletions.
  1. +4 −0 Ux/locale/Manager.js
  2. +20 −5 Ux/locale/override/st/field/Field.js
  3. +44 −0 Ux/locale/override/st/form/FieldSet.js
View
4 Ux/locale/Manager.js
@@ -151,5 +151,9 @@ Ext.define('Ux.locale.Manager', {
this._language = locale;
this.init();
+ },
+
+ getLanguage : function(){
+ return this._language;
}
});
View
25 Ux/locale/override/st/field/Field.js
@@ -6,11 +6,13 @@ Ext.define('Ux.locale.override.st.field.Field', {
],
setLocale : function(locale) {
- var me = this,
- locales = me.locales || me.getInitialConfig().locales,
- label = locales.label,
- manager = me.locale,
- defaultLabel = '';
+ var me = this,
+ locales = me.locales || me.getInitialConfig().locales,
+ label = locales.label,
+ placeholder = locales.placeHolder,
+ manager = me.locale,
+ defaultPlaceholder = '',
+ defaultLabel = '';
if (label) {
if (Ext.isObject(label)) {
@@ -25,6 +27,19 @@ Ext.define('Ux.locale.override.st.field.Field', {
}
}
+ if (placeholder) {
+ if (Ext.isObject(placeholder)) {
+ defaultPlaceholder = label.defaultPlaceholder;
+ placeholder = placeholder.key;
+ }
+
+ placeholder = manager.get(placeholder, defaultPlaceholder);
+
+ if (Ext.isString(placeholder)) {
+ me.setPlaceHolder(placeholder);
+ }
+ }
+
me.callOverridden(arguments);
}
});
View
44 Ux/locale/override/st/form/FieldSet.js
@@ -0,0 +1,44 @@
+Ext.define('Ux.locale.override.st.form.FieldSet', {
+ override: 'Ext.form.FieldSet',
+
+ requires: [
+ 'Ux.locale.override.st.Component'
+ ],
+
+ setLocale: function(locale) {
+ var me = this,
+ locales = me.locales || me.getInitialConfig().locales,
+ title = locales.title,
+ instructions = locales.instructions,
+ manager = me.locale,
+ defaultText = '',
+ defaultInstructions = '';
+
+ if (title) {
+ if (Ext.isObject(title)) {
+ defaultText = title.defaultText;
+ title = title.key;
+ }
+
+ title = manager.get(title, defaultText);
+
+ if (Ext.isString(title)) {
+ me.setTitle(title);
+ }
+ }
+
+ if (instructions) {
+ if (Ext.isObject(instructions)) {
+ defaultInstructions = instructions.defaultText;
+ instructions = instructions.key;
+ }
+ instructions = manager.get(instructions, defaultInstructions);
+
+ if (Ext.isString(instructions)) {
+ me.setInstructions(instructions);
+ }
+ }
+
+ me.callOverridden(arguments);
+ }
+});

0 comments on commit 377da89

Please sign in to comment.
Something went wrong with that request. Please try again.