Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

Language Switcher - 2 questions Options
eylenh
Posted: Wednesday, July 23, 2008 1:57:37 PM
Rank: Member
Groups: Member

Joined: 7/11/2007
Posts: 11
Points: 33
Location: Belgium
I'd like to implement the Language switcher and would like to know two things :

- I need to implement a language which is not in the standard list : Kreyòl (official language in Haïti, next to French). How do I go about adding this?
- I understand that I need to create a new root node for every language that I need and set the culture accordingly. I already created the first root node with an entire structure below. Is there a way to copy the structure from that first root node to the new ones? That would save me some time. I would have to edit the text but at least the structure would already be there.

thanks

Hans
martijnb
Posted: Thursday, July 24, 2008 4:38:43 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
eylenh wrote:

- I need to implement a language which is not in the standard list : Kreyòl (official language in Haïti, next to French). How do I go about adding this?

Hmmm, I don't think it's possible. Cuyahoga uses languages provided by the .NET runtime. I always thought this was a pretty complete list, but it's not so it seems.

Quote:

- I understand that I need to create a new root node for every language that I need and set the culture accordingly. I already created the first root node with an entire structure below. Is there a way to copy the structure from that first root node to the new ones?

Unfortunately, this is not possible in Cuyahoga. But in the past there have been people that did this with a SQL script.

YKS
Posted: Friday, July 25, 2008 4:46:22 AM

Rank: Advanced Member
Groups: Member

Joined: 7/12/2007
Posts: 61
Points: 183
martijnb you can share/obtain SQL Script for copy nodes structures¿?

Cuyahoga.Core.Domain.User YKS= new Cuyahoga.Core.Domain.User();
eylenh
Posted: Wednesday, July 30, 2008 2:48:35 PM
Rank: Member
Groups: Member

Joined: 7/11/2007
Posts: 11
Points: 33
Location: Belgium
For the culture, I found some information on creating custom cultures (just one example : http://moiashvin-tech.blogspot.com/2008/07/creating-custom-culture-in-net.html). I'll try this out and keep you updated.

For the node structure : I made some quick & dirty queries to transfer my current structure. Writing a general query would take a bit more time since it has to deal with hierarchies and problems do occur if you have for example 2 sections with the same name.

Hans
eylenh
Posted: Tuesday, August 5, 2008 10:00:59 PM
Rank: Member
Groups: Member

Joined: 7/11/2007
Posts: 11
Points: 33
Location: Belgium
For those interested in custom cultures, this is how I got it working :

I asked my provider to run this little program (don't forget to put a reference to sysglobl in your project):

using System.Globalization;

namespace CreateCustomCultureKreyol
{
class Program
{
static void Main(string[] args)
{
CultureAndRegionInfoBuilder builder = new CultureAndRegionInfoBuilder("ht-HT", CultureAndRegionModifiers.Neutral);

builder.Parent = CultureInfo.InvariantCulture;
builder.CultureEnglishName = "Kreyòl (Haiti)";
builder.CultureNativeName = "Kreyòl (Ayiti)";
builder.ThreeLetterISOLanguageName = "hat";
builder.ThreeLetterWindowsLanguageName = "hat";
builder.TwoLetterISOLanguageName = "ht";
builder.IetfLanguageTag = "ht-HT";
//builder.KeyboardLayoutId = 1107;
builder.TextInfo = CultureInfo.InvariantCulture.TextInfo;
builder.CompareInfo = CultureInfo.InvariantCulture.CompareInfo;

// Register the culture
builder.Register();
}
}
}

You'll have to convince your provider to do this if your on a server hosting many other sites though, because it adds a .NLP file in the C:\Windows\Globalization folder and one registry entry.

After this, the custom culture still didn't show up in Cuyahoga's list, so I had to modify Globalization.cs in Cuyahoga.Core.Util :

public static SortedList GetOrderedCultures()
{
SortedList orderedCultures = new SortedList();
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
orderedCultures.Add(ci.Name, ci.DisplayName);
}
return (orderedCultures);
}

More specifically replace CultureTypes.SpecificCultures by CultureTypes.AllCultures.

After that I could use the culture Kreyòl (Ayiti).
martijnb
Posted: Wednesday, August 6, 2008 1:17:27 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Thanks a bunch! Really didn't think it was possible happy.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.