jQWidgets Forums

jQuery UI Widgets Forums Grid Localization

This topic contains 14 replies, has 3 voices, and was last updated by  zibotaz 12 years, 11 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Localization Posts
  • Localization #2253

    Adrian K.
    Member

    Hi,

    at first, I have to say that jqwidgets is a very awesome framework. Good Work, really! (:

    My Question: Is there an overview with localizations-strings in grids which I can set? (Reference)

    Best Regards,
    Adrian

    Localization #2257

    Peter Stoev
    Keymaster

    Hi Adrian,

    Here’s the full list of localization strings:

    firstDay: 0,
    days: {
    // full day names
    names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    // abbreviated day names
    namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    // shortest day names
    namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
    },
    months: {
    // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
    names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""],
    // abbreviated month names
    namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""]
    },
    // AM and PM designators in one of these forms:
    // The usual view, and the upper and lower case versions
    // [standard,lowercase,uppercase]
    // The culture does not use AM or PM (likely all standard date formats use 24 hour time)
    // null
    AM: ["AM", "am", "AM"],
    PM: ["PM", "pm", "PM"],
    eras: [
    // eras in reverse chronological order.
    // name: the name of the era in this culture (e.g. A.D., C.E.)
    // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
    // offset: offset in years from gregorian calendar
    {"name": "A.D.", "start": null, "offset": 0 }
    ],
    twoDigitYearMax: 2029,
    patterns: {
    // short date pattern
    d: "M/d/yyyy",
    // long date pattern
    D: "dddd, MMMM dd, yyyy",
    // short time pattern
    t: "h:mm tt",
    // long time pattern
    T: "h:mm:ss tt",
    // long date, short time pattern
    f: "dddd, MMMM dd, yyyy h:mm tt",
    // long date, long time pattern
    F: "dddd, MMMM dd, yyyy h:mm:ss tt",
    // month/day pattern
    M: "MMMM dd",
    // month/year pattern
    Y: "yyyy MMMM",
    // S is a sortable format that does not vary by culture
    S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
    },
    percentsymbol: "%",
    currencysymbol: "$",
    currencysymbolposition: "before",
    decimalseparator: '.',
    thousandsseparator: ',',
    pagergotopagestring: "Go to:",
    pagershowrowsstring: "Show rows:",
    pagerrangestring: " of ",
    pagerpreviousbuttonstring: "previous",
    pagernextbuttonstring: "next",
    groupsheaderstring: "Drag a column and drop it here to group by that column",
    sortascendingstring: "Sort Ascending",
    sortdescendingstring: "Sort Descending",
    sortremovestring: "Remove Sort",
    groupbystring: "Group By this column",
    groupremovestring: "Remove from groups",
    filterclearstring: "Clear",
    filterstring: "Filter",
    filtershowrowstring: "Show rows where:",
    filterorconditionstring: "Or",
    filterandconditionstring: "And",
    filterstringcomparisonoperators: ['empty', 'not empty', 'contains', 'contains(match case)',
    'does not contain', 'does not contain(match case)', 'starts with', 'starts with(match case)',
    'ends with', 'ends with(match case)', 'equal', 'equal(match case)', 'null', 'not null'],
    filternumericcomparisonoperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'],
    filterdatecomparisonoperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null']

    This topic describes how to apply the strings: localization.htm

    Best Regards,
    Peter Stoev

    http://www.jqwidgets.com
    jQWidgets Team

    Localization #3311

    zibotaz
    Member

    When i use this code with the 2.0 version :
    $(“#jqxgrid”).bind(“bindingcomplete”, function (event) {
    var localizationobj = {};
    localizationobj.pagergotopagestring = “Gehe zu:”;
    localizationobj.pagershowrowsstring = “Zeige Zeile:”;
    localizationobj.pagerrangestring = ” von “;
    localizationobj.pagernextbuttonstring = “voriger”;
    localizationobj.pagerpreviousbuttonstring = “nächster”;
    localizationobj.sortascendingstring = “Sortiere aufsteigend”;
    localizationobj.sortdescendingstring = “Sortiere absteigend”;
    localizationobj.sortremovestring = “Entferne Sortierung”;
    // apply localization.
    $(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);
    });

    line: 7
    I have the javascript error : Impossible the value of the property « visiblerecords » : object null or undefined

    And all the lines of my grid are empty.

    Why ??

    Steve

    Localization #3313

    Peter Stoev
    Keymaster

    Hi Steve,

    I’m afraid that I’m not sure what may be the cause for the behavior you have described. Therefore, providing a sample in which this can be observed locally will be appreciated. We currently have an Online Localization Demo which does exactly the same with version 2.0 so I guess there’s something else.

    Looking forward for your sample.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Localization #3338

    zibotaz
    Member

    Hello,

    I have just added the code :
    var localizationobj = {};
    localizationobj.pagergotopagestring = “Gehe zu:”;
    localizationobj.pagershowrowsstring = “Zeige Zeile:”;
    localizationobj.pagerrangestring = ” von “;
    localizationobj.pagernextbuttonstring = “voriger”;
    localizationobj.pagerpreviousbuttonstring = “nächster”;
    localizationobj.sortascendingstring = “Sortiere aufsteigend”;
    localizationobj.sortdescendingstring = “Sortiere absteigend”;
    localizationobj.sortremovestring = “Entferne Sortierung”;
    // apply localization.
    $(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);

    in the function : $(“#jqxgrid”).bind(“bindingcomplete”, function() {
    of the demo : nestedgrids.htm

    and i have :

    the javascript error : (line: 7) Impossible the value of the property « visiblerecords » : object null or undefined

    And all the lines of my grid are empty.

    When i sort a column all the lines of my grid are complete.

    Regards,

    Steve

    Localization #3339

    zibotaz
    Member

    The same problem append with the demo file : rowdetails.htm

    Steve

    Localization #3340

    Peter Stoev
    Keymaster

    I’ve reproduced it in the nestedgrids demo. The issue occurs when the method is called and the data is still not loaded.

    You can use this workaround:

    $("#jqxgrid").bind('bindingcomplete', function () {
    var localizationobj = $("#jqxgrid").jqxGrid('gridlocalization');
    localizationobj.pagergotopagestring = "Gehe zu:";
    localizationobj.pagershowrowsstring = "Zeige Zeile:";
    localizationobj.pagerrangestring = " von ";
    localizationobj.pagernextbuttonstring = "voriger";
    localizationobj.pagerpreviousbuttonstring = "nächster";
    localizationobj.sortascendingstring = "Sortiere aufsteigend";
    localizationobj.sortdescendingstring = "Sortiere absteigend";
    localizationobj.sortremovestring = "Entferne Sortierung";
    // apply localization.
    $("#jqxgrid").jqxGrid('render');
    });

    Best regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Localization #3341

    zibotaz
    Member

    I’m sorry but your solution don’t run.

    I’have no error but nothing appends all text stay in english.

    Steve

    Localization #3342

    Peter Stoev
    Keymaster

    Hi Steve,

    Its my fault, I should have posted the full web page’s code:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <link rel="stylesheet" href="styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="scripts/jqxcore.js"></script>
    <script type="text/javascript" src="scripts/jqxdata.js"></script>
    <script type="text/javascript" src="scripts/jqxbuttons.js"></script>
    <script type="text/javascript" src="scripts/jqxscrollbar.js"></script>
    <script type="text/javascript" src="scripts/jqxmenu.js"></script>
    <script type="text/javascript" src="scripts/jqxgrid.js"></script>
    <script type="text/javascript" src="scripts/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="scripts/jqxgrid.columnsresize.js"></script>
    <script type="text/javascript" src="scripts/jqxlistbox.js"></script>
    <script type="text/javascript" src="scripts/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="scripts/jqxgrid.pager.js"></script>
    <script type="text/javascript" src="scripts/jqxgrid.sort.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    // prepare the data
    var source =
    {
    datatype: "json",
    datafields: [
    { name: 'name' },
    { name: 'type' },
    { name: 'calories', type: 'int' },
    { name: 'totalfat' },
    { name: 'protein' },
    ],
    id: 'id',
    url: 'beverages.txt',
    async: false
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").bind('bindingcomplete', function()
    {
    var localizationobj = $("#jqxgrid").jqxGrid('gridlocalization');
    localizationobj.pagergotopagestring = "Gehe zu:";
    localizationobj.pagershowrowsstring = "Zeige Zeile:";
    localizationobj.pagerrangestring = " von ";
    localizationobj.pagernextbuttonstring = "voriger";
    localizationobj.pagerpreviousbuttonstring = "nächster";
    localizationobj.sortascendingstring = "Sortiere aufsteigend";
    localizationobj.sortdescendingstring = "Sortiere absteigend";
    localizationobj.sortremovestring = "Entferne Sortierung";
    // apply localization.
    $("#jqxgrid").jqxGrid('render');
    });
    $("#jqxgrid").jqxGrid(
    {
    source: dataAdapter,
    columnsresize: true,
    pageable: true,
    sortable: true,
    autoheight: true,
    columns: [
    { text: 'Name', datafield: 'name', width: 250 },
    { text: 'Beverage Type', datafield: 'type', width: 250 },
    { text: 'Calories', datafield: 'calories', width: 180 },
    { text: 'Total Fat', datafield: 'totalfat', width: 120 },
    { text: 'Protein', datafield: 'protein', minwidth: 120 }
    ]
    });
    });
    </script>
    </head>
    <body style="overflow: hidden;" class='default'>
    <div id="jqxgrid"></div>
    </body>
    </html>

    Hope this helps.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Localization #3343

    zibotaz
    Member

    Thanks,

    but the fourlabels :

    localizationobj.pagergotopagestring = “Gehe zu:”;
    localizationobj.pagershowrowsstring = “Zeige Zeile:”;
    localizationobj.pagernextbuttonstring = “voriger”;
    localizationobj.pagerpreviousbuttonstring = “nächster”;

    don’t work and

    localizationobj.pagerrangestring = ” von “;
    localizationobj.sortascendingstring = “Sortiere aufsteigend”;
    localizationobj.sortdescendingstring = “Sortiere absteigend”;
    localizationobj.sortremovestring = “Entferne Sortierung”;

    work

    Steve

    Localization #3344

    Peter Stoev
    Keymaster

    I uploaded the sample and you can see it working Online: Localization

    Hope it helps.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Localization #3346

    zibotaz
    Member

    I use the same code in the demo file bindingtojson.htm and i have the previous problem :

    the four labels :

    localizationobj.pagergotopagestring = “Gehe zu:”;
    localizationobj.pagershowrowsstring = “Zeige Zeile:”;
    localizationobj.pagernextbuttonstring = “voriger”;
    localizationobj.pagerpreviousbuttonstring = “nächster”;

    don’t work and

    localizationobj.pagerrangestring = ” von “;
    localizationobj.sortascendingstring = “Sortiere aufsteigend”;
    localizationobj.sortdescendingstring = “Sortiere absteigend”;
    localizationobj.sortremovestring = “Entferne Sortierung”;

    work.

    Maybe it’s append only when source type is json ???

    Steve

    Localization #3347

    Peter Stoev
    Keymaster

    Hi Steve,

    You can tell me what’s the datatype that you use and I will prepare a demo for you with that specific datatype. The demo I posted is with JSON. It does not matter whether the datatype is json, xml, array, csv or tsv. However, I think that it would be easier, if you send us a small sample to support@jqwidgets.com so we can debug the specific scenario.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Localization #3348

    Peter Stoev
    Keymaster

    Hi Steve,

    If your loading json data, it is important to set the datatype to ‘json’.

    For example:

                var source =
    {
    datatype: "json",
    datafields: [
    { name: 'name' },
    { name: 'type' },
    { name: 'calories', type: 'int' },
    { name: 'totalfat' },
    { name: 'protein' },
    ],
    id: 'id',
    url: 'beverages.txt',
    async: false
    };

    jQWidgets Team
    http://www.jqwidgets.com

    Localization #3350

    zibotaz
    Member

    It’s work fine

    Thanks

    Steve

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.