PDA

View Full Version : [SOLVED]Localization - some of GUI's fields are not translate. [for 3.1.1 version]



Czapla
27 Feb 2010, 3:27 AM
I included ext-js-local-file, but some fileds are not translate. How can i overriding english names?

http://images45.fotosik.pl/266/72f05516a6f5e08bm.png (http://www.fotosik.pl/pokaz_obrazek/72f05516a6f5e08b.html)



if(Ext.ux.grid.GridFilters) {
Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
???
});
}


ty fay

fay
27 Feb 2010, 3:54 AM
As it's a user extension, it is not going to be in the standard locale/ext-lang-{?}.js file. There is a solution for this here (http://www.extjs.com/forum/showthread.php?t=67359).

Czapla
27 Feb 2010, 5:09 AM
The solution not work wth 3.1.1

i added followed code on the end of ext-lang-file


if(Ext.ux.grid.GridFilters){
Ext.override(Ext.grid.GridFilters, {
filtersText: 'Filtry'
});
}

if(Ext.ux.grid.filters){
if(Ext.ux.grid.filter.BooleanFilter){
Ext.override(Ext.grid.filter.BooleanFilter, {
yesText: 'Tak',
noText: 'Nie'
});
}
if(Ext.ux.grid.filter.DateFilter){
Ext.override(Ext.grid.filter.DateFilter, {
dateFormat: 'm/d/Y',
beforeText: 'Przed',
afterText: 'Po',
onText: 'w'
});
}
if(Ext.ux.grid.filter.ListFilter){
Ext.override(Ext.grid.filter.ListFilter, {
loadingText: 'Wczytuj?...'
});
}
}

i tried with ux, without ux, included ext-lang as the last file - still not working



<script type="text/javascript" src="js/ext-3.1.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/ext-all.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/menu/RangeMenu.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/menu/ListMenu.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/GridFilters.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/filter/Filter.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/filter/StringFilter.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/filter/DateFilter.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/filter/ListFilter.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/filter/NumericFilter.js"></script>
<script type="text/javascript" src="js/ext-3.1.1/examples/ux/gridfilters/filter/BooleanFilter.js"></script>
<script type="text/javascript" src="patterns/view/layout.js"></script>
<script type="text/javascript" src="patterns/view/ext-lang-pl.js"></script>


any idea why?

fay
27 Feb 2010, 5:19 AM
Re-read your code.


if(Ext.ux.grid.GridFilters){
Ext.override(Ext.grid.GridFilters, {

Notice anything about the override? It should be Ext.ux.grid.GridFilters.

The same is true throughout your code snippet. The namespace is "Ext.ux.grid"

You really need to install FireFox+FireBug and debug your code - you would have spotted this immediately "stepping into" it.

EDIT: For development/debugging purposes use ext-all-debug.js, not ext-all.js (which should only be specified when deploying).

Czapla
27 Feb 2010, 5:52 AM
sry that was miss typo, my code was fine i pasted wrong code... my mistake
Both codes neither work


if(Ext.ux.grid.GridFilters){
Ext.override(Ext.ux.grid.GridFilters, {
filtersText: 'Filtry'
});
}

if(Ext.ux.grid.filters){
if(Ext.ux.grid.filter.BooleanFilter){
Ext.override(Ext.ux.grid.filter.BooleanFilter, {
yesText: 'Tak',
noText: 'Nie'
});
}
if(Ext.ux.grid.filter.DateFilter){
Ext.override(Ext.ux.grid.filter.DateFilter, {
dateFormat: 'm/d/Y',
beforeText: 'Przed',
afterText: 'Po',
onText: 'w'
});
}
if(Ext.ux.grid.filter.ListFilter){
Ext.override(Ext.ux.grid.filter.ListFilter, {
loadingText: 'Wczytuj?...'
});
}
}



if(Ext.grid.GridFilters){
Ext.override(Ext.grid.GridFilters, {
filtersText: 'Filtry'
});
}

if(Ext.grid.filters){
if(Ext.grid.filter.BooleanFilter){
Ext.override(Ext.grid.filter.BooleanFilter, {
yesText: 'Tak',
noText: 'Nie'
});
}
if(Ext.grid.filter.DateFilter){
Ext.override(Ext.grid.filter.DateFilter, {
dateFormat: 'm/d/Y',
beforeText: 'Przed',
afterText: 'Po',
onText: 'w'
});
}
if(Ext.grid.filter.ListFilter){
Ext.override(Ext.grid.filter.ListFilter, {
loadingText: 'Wczytuj?...'
});
}
}

Each of them i paste on the end of my lang-file

Ty you @fay, it's working now :)

fay
27 Feb 2010, 7:10 AM
Ok, from a quick *debug* and look at the 3.1 translation files (and ux\gridfilters\?Filter files), you need to add the following - and don't put them in the ext-lang-pl.js file - create a ext-ux-lang-pl.js file:


if (Ext.ux.grid.GridFilters)
{
DateFilterMenuItems = ['before', 'after', '-', 'on']; //NOTE: Enter Polish translations

NumericFilterMenuItemCfgs = {
emptyText: 'Enter Filter Text...', //NOTE: Enter Polish translation
selectOnFocus: true,
width: 125
};

Ext.apply(Ext.ux.grid.GridFilters.prototype, {
menuFilterText: 'Filtry'
});

if(Ext.ux.grid.filter.BooleanFilter){
Ext.apply(Ext.ux.grid.filter.BooleanFilter.prototype, {
yesText: 'Tak',
noText: 'Nie'
});
}

if(Ext.ux.grid.filter.StringFilter){
Ext.apply(Ext.ux.grid.filter.BooleanFilter.prototype, {
emptyText: 'Enter Filter Text...' //NOTE: Enter Polish translations
});
}

if(Ext.ux.grid.filter.DateFilter){
Ext.apply(Ext.ux.grid.filter.DateFilter.prototype, {
dateFormat: 'm/d/Y',
beforeText: 'Przed',
afterText: 'Po',
onText: 'w',
menuItems: DateFilterMenuItems
});
}

if(Ext.ux.grid.filter.NumericFilter){
Ext.apply(Ext.ux.grid.filter.NumericFilter.prototype, {
menuItemCfgs: NumericFilterMenuItemCfgs
});
}
}

See the NOTEs in the above.