Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Feb 2010
    Posts
    1
    Vote Rating
    0
    Iron Bull is on a distinguished road

      0  

    Default [FNR] Change the language of PagingToolBarMessages

    [FNR] Change the language of PagingToolBarMessages


    Hi,

    I'm using a PagingToolBar and I have to change the language of the messages, but setMessages(PagingToolBarMessages messages) don't actualize them.

    GXT 2.1.1

  2. #2
    Ext User
    Join Date
    Mar 2008
    Location
    Berlin, Germany
    Posts
    58
    Vote Rating
    0
    HerrB is on a distinguished road

      0  

    Default


    IMHO the PagingToolBar can't be translated without extending/overriding the class (bug). The constructor uses a "fresh" object of PagingToolBarMessages:
    Code:
    public PagingToolBar(final int pageSize) {
        this.pageSize = pageSize;
        msgs = new PagingToolBarMessages();
    
        first = new Button();
    All elements, which are not updated later, won't recognize, that setMessages was used to store your own PagingToolBarMessages object. This applies to all elements created in the constructor only and not updated in onLoad, especially all tooltip messages and beforePageText ("Page").

    Workaround:
    You may override the onLoad method with code that updates all tooltip messages and labels. Or set the not-updated texts "from the outside". e.g.:
    Code:
    PagingToolBar toolBar = new PagingToolBar(50);
    		PagingToolBarMessages toolBarMessages = toolBar.new PagingToolBarMessages();
    		toolBarMessages.setAfterPageText("von {0}");
    		toolBarMessages.setBeforePageText("Seite");
    		toolBarMessages.setDisplayMsg("Zeige {0} - {1} von {2}");
    		toolBarMessages.setEmptyMsg("Keine Teilnehmer");
    		toolBarMessages.setFirstText("Erste Seite");
    		toolBarMessages.setLastText("Letzte Seite");
    		toolBarMessages.setNextText("Nächste Seite");
    		toolBarMessages.setPrevText("Vorherige Seite");
    		toolBarMessages.setRefreshText("Aktualisieren");
    		toolBar.setMessages(toolBarMessages);
    		
    		// Now fix text
    		if (toolBar.isShowToolTips()) {
    			// 0: First
    			((Button)toolBar.getItem(0)).setToolTip(toolBarMessages.getFirstText());
    			// 1: Prev
    			((Button)toolBar.getItem(1)).setToolTip(toolBarMessages.getPrevText());
    		    // 2: Separator
    			// 3: BeforePage (no tooltip, see below for text fix)
    			// 4: Textbox (no tooltip)
    		    // 5: After (no tooltip, text updated by onload)
    		    // 6: Separator
    			// 7: Next
    			((Button)toolBar.getItem(7)).setToolTip(toolBarMessages.getNextText());
    			// 8: Last
    			((Button)toolBar.getItem(8)).setToolTip(toolBarMessages.getLastText());
    		    // 9: Seperator
    			// 10: Refresh
    			((Button)toolBar.getItem(10)).setToolTip(toolBarMessages.getRefreshText());
    			// 11: Fill
    			// 12: Display text (no tooltip, text updated by onload)
    		}
    
    		// Allways fix beforePage text
    		((LabelToolItem)toolBar.getItem(3)).setLabel(toolBarMessages.getBeforePageText());
    Fixed the problem for me. Note, that the numbers may change with never GXT versions/more elements in the PagingToolBar class (this code has been tested with V2.1.2).

    Regards,

    HerrB
    Last edited by HerrB; 23 May 2010 at 4:09 PM. Reason: Code tested

  3. #3
    Sencha User robertlight's Avatar
    Join Date
    Nov 2009
    Location
    Boston area
    Posts
    19
    Vote Rating
    0
    robertlight is on a distinguished road

      0  

    Default


    There has to be a better way...clearly the architect felt it necessary to have this customizable.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Fixed in SVN as of revision 2126.

Similar Threads

  1. Change Grid language
    By flashed in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 27 Apr 2009, 1:21 AM
  2. Change language of default-messages
    By wuschba in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 21 Apr 2008, 5:00 AM
  3. change language without reload the page
    By gimler in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 3 Feb 2008, 4:11 AM
  4. Change language errors-messages
    By ec-cts in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 21 Dec 2007, 9:25 AM
  5. change language
    By paulofernandesjr in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 3 Dec 2007, 8:46 AM

Thread Participants: 3

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar