Results 1 to 7 of 7

Thread: Localization and UserControl/Web designer

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    18

    Default Localization and UserControl/Web designer

    Hi!

    In the example of the localization, there are link buttons to change the language put on child screen aspx (UserRegistration.aspx).

    Now, I have my master page composed of small UserControls. There are placeholders for TopMenuUserControl, LeftSideUserControl, BottomuserControl, and the placeHolder for the main content.
    So in the main content there would come for example DocumentsTree.aspx. If I put link buttons to change the language on that child aspx DocumentsTree.aspx, everything is ok, because I can set:

    this.UserCulture = new CultureInfo((string) e.CommandArgument);
    UserCulture is inherited from Spring-Page.

    Now my problem: My Web designer wants me to put the links in a part of the page where menus are. So I have to put my links into TopMenuUserControl which inherits Spring-UserControl. But then I do not have this.UserCulture to set. how do I resolve that? Is it possible to change the language localization only in child pages?

    Lp
    Sebastijan

  2. #2
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    You should still be able to do it.

    Spring UserControl also exposes UserCulture property and simply delegates it to the page that contains it, so everything should work fine.

    Later,

    Aleks

  3. #3
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    18

    Default

    Hi

    The current version of Spring UserControl in cvs does not support setter for UserCulture (only read). And it also does not expose CultureResolver.

    Is there a way to get that correct version with those features?

    Lp
    S

  4. #4
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    18

    Default

    Hi!

    Is there any progress in having Spring.UserControl a setter for UserCulture and to expose CultureResolver? I thing this is a very important issue? Thank you for the kind answer.

    Lp
    S

  5. #5
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Hi Sebastijan,

    Sorry it took so long... I saw your message and was gonna fix the problem, but then I got sidetracked and completely forgot about it.

    I just checked in modified UserControl class that implements UserCulture setter as well, so you can get it from CVS. I didn't expose CultureResolver though, as it is only used internally by the UserCulture property within the Page class. If you have a good reason to expose it let me know and I'll do it, although I really can't see why it would be useful.

    BTW, UserControl's Page property is overriden to return Spring.Web.UI.Page instance instead of System.Web.UI.Page, so you can access all Spring Page properties through it as well.

    Regards,

    Aleks

  6. #6
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    18

    Default

    Hi

    I used UserControl's Page property:

    public void SetLanguage(object sender, CommandEventArgs e)
    {
    Page.UserCulture = new CultureInfo((string) e.CommandArgument);
    ...
    }

    It is working correctly!

    But UserCulture is still as readonly in cvs! Is there some delay between checksin or something. Or do I have to use something else to get the latest version? I used:
    cvs -dserver:anonymous@cvs.sourceforge.net:/cvsroot/springnet login

    cvs -z3 -dserver:anonymous@cvs.sourceforge.net:/cvsroot/springnet co -P Spring.Net

    Lp
    S

  7. #7
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Yeah, there might be some delay between development and anonymous CVS. Not sure how long it takes for them to synch up...

    - Aleks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •