PDA

View Full Version : [FIXED-694] Various localization issues



vog
9 Mar 2010, 6:59 AM
I'm a native german speaker and I ran across several issues with Ext's ext-lang-de.js. So I performed some corrections. The attached new ext-lang-de.js is based on Ext 3.1.1.

Moreover, I noted that the localization for Ext.util.Format.number is missing. It seems to be missing in all localization files. Didn't anyone notice that bug yet? In the attached file, I solved it this way:



var originalExtUtilFormatNumber = Ext.util.Format.number;
Ext.util.Format.number = function(v, format){
return originalExtUtilFormatNumber(v, format || "0.000,00/i");
};
If you consider this solution to be okay, I'd recommend to put a similar code block into all other localization files.



Note: I already wrote about this issue in the localization thread (http://www.extjs.com/forum/showthread.php?p=444117#post444117), but my work was ignored there. Also, some other contributions (http://www.extjs.com/forum/showthread.php?p=416670#post416670) in that thread didn't get any attention, either. This is not very motivating to contributers.

Jamie Avins
9 Mar 2010, 8:46 AM
I believe the NumberFormat issue was addressed in SVN for 3.2. Thank you for the language updates.

Jamie Avins
10 Mar 2010, 9:51 AM
[type]: fix
[module]: ext-lang-de
[id]: #694
[desc]: Fixes #694. Updates to default number format for and phrases.

mystix
10 Mar 2010, 10:07 AM
[type]: fix
[module]: ext-lang-de
[id]: #694
[desc]: Fixes #694. Updates to default number format for and phrases.
@vog / @jamie, that fix introduces a global variable originalExtUtilFormatNumber.

i suggest using this instead:


Ext.util.Format.__number = Ext.util.Format.number;
Ext.util.Format.number = function(v, format) {
return Ext.util.Format.__number(v, format || "0.000,00/i");
});

Jamie Avins
10 Mar 2010, 11:39 AM
Thanks, I'm just too used to working within the classes.

vog
10 Mar 2010, 2:06 PM
@mystix: Okay, so changed my ext-lang-de.js according to your proposal. The attached file also contains the bugfix I introduced in my second post in the localization thread (http://www.extjs.com/forum/showthread.php?p=445272#post445272).

However, just for the record I'd like to mention that the temporary variable originalExtUtilFormatNumber was local (within the if-clause), not global:



if(Ext.util.Format){
var originalExtUtilFormatNumber = Ext.util.Format.number;
Ext.util.Format.number = function(v, format){
return originalExtUtilFormatNumber(v, format || "0.000,00/i");
};
...
}
Nevertheless, I changed my ext-lang-de.js according to your proposal.

Jamie Avins
10 Mar 2010, 2:37 PM
The problem is we're in the global scope for the language overrides...

vog
10 Mar 2010, 4:06 PM
Ah, thanks for the explanation.

Meanwhile, I played around with the date field and noted that the altFormat patterns are way too strict, and don't cover many typical german date abbreviations.

The attached localization file fixes that, and it also contains all previous changes.