Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Sueetie Localizer Ready to Rock in Gummy Bear 1.3

Localization support was never a high priority for me in Sueetie, especially when you consider that each of the apps in Sueetie already supports it. But there are non-English Sueetie Communities out there and it was time, so Gummy Bear 1.3 will have full localization support and a new ASPNET Control called <SUEETIE:SueetieLocal />.  The class that supports code-behind localization is called the SueetieLocalizer, and who won’t like using “SueetieLocalizer.GetString()?” Win, win.

Localization isn’t sexy, so I’ll make the lead-in to the repost of the Sueetie Localization Wiki Page brief. Suffice it to say that the Sueetie implementation of multi-language support is simple, flexible, economical to use, and I think you’ll like it a lot.

__________________________


The SueetieLocal ASPNET Control

The typical use of the SueetieLocal control is simply

<SUEETIE:SueetieLocal Key="demo_string" runat="server" />

Each localized string has a unique key. Sueetie language files are located in /utils/languages/[LANG].

Image

The default language file is /utils/language/LANG/sueetie.xml. SueetieLocal supports using the current application language files as well as custom files you specify using SueetieLocal properties.

SueetieLocal Control Properties

Key - We saw the typical use of the SueetieLocal control above where each string has a unique Key property.

LanguageFile - Use this property to specify a custom /utils/languages/[LANG]/[somefile].xml. As in LanguageFile=”DBVT.xml”

Anchor - The Anchor property refers to the HTML wrapping of the string. If no “anchor” property is specified, NO HTML is added to the string when written to the page. Supported Anchor elements are displayed with Intellisense in Visual Studio.

Image

LocalCSSID - Use this property to add an "id=" property to the HTML wrapped string. Only applicable if an Anchor property is specified.

UseCurrentApplicationFile - As we mentioned earlier, you have the option of storing your Localization terms in the applicationtype-defined language file of the current application. The Application Types are Blog, Forum, Marketplace, Wiki, and MediaGallery. The UseCurrentApplicationFile boolean property provides a quick way to use it.

Image

SueetieLocalizer Class

The SueetieLocalizer Core Class supports custom and code-behind localization. It contains a single GetString() method with 2 overloads. Below is the outline of the SueetieLocalizer, which as you can see is very basic.

Image

Sueetie Localization Administration

You specify the language for your community in Sueetie Administration under Site Settings -> General Site Settings. Enter the name of the /utils/languages/[LANG]/ folder as shown.

Image

Comments (0) | Post RSS RSS comment feed

Posted on 4/26/2010 4:46:59 PM by Dave Burke
Categories: Sueetie
Tags: no tags for this item

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke