|
|
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
|
|
 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.
|
|
 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();
|
|
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
|
|
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).
|
|
 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  .
|
|
|
Guest |