Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Frank 8/16/2005 11:51 PM
It would be nice to also make the Admin section of Cuyahoga culture dependent. Currently the can only be done in hardcoded English (or am I missing somehtinghere?). Is anything planned for that?
# martijnb 8/17/2005 1:04 AM
I knew that that question would come sooner or later :).

Currently the administration is English-only. It shouldn't be too hard to make that culture-independent with resources, but is is a lot of stupid and boring work. I am definately not planning do to this myself in the near future, but anybody can pick it up it he or she wants.
# Frank 8/17/2005 2:10 AM
Main 'problem' seems to be to include inheritance from LocalizedUserControl. If that is done it's just configuring the resources, isn't it? If you can give some directions I can have look at it.
# martijnb 8/17/2005 2:30 AM
FrankMain 'problem' seems to be to include inheritance from LocalizedUserControl.

The admin pages are no user controls at all, but that doesn't matter much. LocalizedUsercontrol only provides convenient access to the resource manager but doesn't do anything special. You have to do the translation of labels, error messages etc by hand. See the Articles module as an example.
# Frank 8/17/2005 4:17 AM
I noticed that the LocalizeduserControl class is providing the GetText method that does the translation/reading form the resources. Therefore I thought about include inheritance of this control into the admin pages. If I do this what (supposed to be) subclass is the most appropiate one in the admin pages?
# martijnb 8/17/2005 1:17 PM
I think the /Web/UI/GenericBasePage.cs would be the appropriate place for that.
# Frank 8/19/2005 2:49 AM
I have included the code from LocalizedUserControl in GenericBasePage. (Adding inheritance only doesn't work because GenericBasePage because isn't a UserControl) and this works. I can call the GetText fucntion in all pages that inherite from GenerciBasePage. However, if I configure the culture for a site as Dutch and switch to the Admin section, culture is always reset to English. How can we make the culture in the Admin section variable,as we ca with the sites?
I wanted to upload the adjusted GenericBasePage.cs file into this post, but this seems not possible, at least I don't see any upload link or something like that.
# martijnb 8/19/2005 12:38 PM
FrankHow can we make the culture in the Admin section variable,as we ca with the sites?

That's a good one. Something like a default culture in the web.config and after selecting a different culture, a cookie is set for that culture. But perhaps you know of something better.
I wanted to upload the adjusted GenericBasePage.cs file into this post, but this seems not possible, at least I don't see any upload link or something like that.

That's true, you can't attach files in this forum. But you know my email address...;).
# Frank 8/20/2005 12:11 PM
Cookies? Maybe as our very last option.;)
How about this one:
When entering the admin section no site is selected yet (and a default culture can be used), but as soon as we pick one site to work on in the admin section, there should be a way to retrieve the preferred culture for that site and use that one instead of the default. (If this works we could also introduce a culture setting per site for the admin section in order to make it even more flexible).
If I have time I'll dig through the code to see how a site's culture can be retrieved from the db and assigned to the Thread.CurrentPrincipal.CurrentUICulture [?] but comments that prevent me from wasting time are always appreciated!
# martijnb 8/20/2005 12:33 PM
FrankCookies? Maybe as our very last option.;)

Non-persistant cookies. You know how much of those you receive everywhere don't you? ;)
When entering the admin section no site is selected yet (and a default culture can be used), but as soon as we pick one site to work on in the admin section, there should be a way to retrieve the preferred culture for that site and use that one instead of the default. (If this works we could also introduce a culture setting per site for the admin section in order to make it even more flexible).

Negative. I think the admin site should have a consistent culture, independent from the site.
Maybe it's interesting to introduce a prefered culture attribute to the User class. After logging in, you get the entire admin interface in the prefered language.
If I have time I'll dig through the code to see how a site's culture can be retrieved from the db and assigned to the Thread.CurrentPrincipal.CurrentUICulture [?] but comments that prevent me from wasting time are always appreciated!

Sites have a default culture so it's already available.
# Frank 8/21/2005 1:05 PM
Maybe it's interesting to introduce a prefered culture attribute to the User class. After logging in, you get the entire admin interface in the prefered language.
I agree, the idea of switching cultures in the admin section was just a very first thought, but adding this to the User class really is much better.
Still working out my first idea, I already created an overload if the GetText method by adding CultureInfo as additional parameter:
public string GetText(string key, CultureInfo cultureInfo)
{....}

This already helped to make the use of cultures more flexible, and we could also use this when a Culture property is added to the User class, by calling this method with the User.Culture property.
# martijnb 8/21/2005 3:07 PM
FrankI already created an overload if the GetText method by adding CultureInfo as additional parameter:
public string GetText(string key, CultureInfo cultureInfo)
{....}

This already helped to make the use of cultures more flexible, and we could also use this when a Culture property is added to the User class, by calling this method with the User.Culture property.

That won't be nessecary. You only have to set the culture to the current thread once and then resourcemanager knows about it.