Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example

Localization change

Method

Architecture

SharpDevelop

runtime

  • .NET ResourceManager

Paint.NET

restart

  • .NET ResourceManager

MonoDevelop

?

  • written in C/C++
  • getText instead of Resources.
    This allows MonoDevelop to take advantage of
    GNOME translators' familiarity with getText.

?

Spring.Net

runtime
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="86a658c78699f2e1-533a9879-4e0f4539-9b5d968b-eadfe41450c2d1488e1b2771"><ac:plain-text-body><![CDATA[[web, just 1 page to refresh]

  • [Follows Globalization Architecture .NET

http://msdn2.microsoft.com/en-us/library/aa478974.aspx]]]></ac:plain-text-body></ac:structured-macro>

  • Automatic Localization Using Localizers ("Push" Localization)
  • Working with Localizers $this (form/usercontrol) or $resource_namespace
  • Applying Resources Manually ("Pull" Localization) like getMessage("labelName");

-

MonoRail

runtime
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ab9b2913d5877312-56746455-4bfd4497-a4f881d6-fabf89cd8ae887e125c932fd"><ac:plain-text-body><![CDATA[[web, just 1 page to refresh]

  • .NET ResourceManager
  • [Facade ResourceManager

^Architecture_MonoRail_Resources.png]]]></ac:plain-text-body></ac:structured-macro>

...

  • In C#, Singleton class as the name implies creates only one instance of the class and its member, whereas, static class creates a new instance of the static members everytime it is being accessed.
  • Adds a level of indirection. This allows the creation of more than one instance of the class at a later date without breaking client code.
  • Encapsulates data and methods into a separate namespace, the singleton class.
  • Allows sub-classing.
  • Provides access control to the single instance.
  • Thread safe.

Gena, would you like to comment/check "Singleton versus Static Class"? Thanks, Alex.

Overview Methods


Method

Maintenance

Remarks

Resources (.NET)

Satellite assembly: editors -Zeta Resource Editor,Resource Builder

  • Resources (.NET) not only text, also images, files etc.
  • Resources (.NET) can also be used for redesign/culture (location/Size)
  • Resources (.NET) indexed on labels or control names

gettext

kbabel gettext editor

The main differences between the common .NET resources approach and the
GNU gettext approach are:

  • In the .NET resource approach, the keys are abstract textual shortcuts. In the GNU gettext approach, the keys are the English/ASCII version of the messages.
  • In the .NET resource approach, the translation files are called "Resource.locale.resx" and are UTF-8 encoded XML files. In the GNU gettext approach, the translation files are called "Resource.locale.po" and are in the encoding the translator has chosen. There are at least three GUI translating tools (Emacs PO mode, KDE KBabel, GNOME gtranslator).
  • In the .NET resource approach, the function ResourceManager.GetString returns an empty string or throws an InvalidOperationException when no translation is found. In the GNU gettext approach, the GetString function returns the (English) message key in that case.
  • In the .NET resource approach, there is no support for plural handling.In the GNU gettext approach, we have the GetPluralString function.
  • In the .NET resource approach, there is no support for context specific translations. In the GNU gettext approach, we have the GetParticularString function.
    To compile GNU gettext message catalogs into C# assemblies, the msgfmt/msgunfmt program can be used.
  • gettext generate a indexlist at runtime
  • indexed on content (hard coded)
  • gettext generate a indexlist on 'run'

DelftLanguage

text-files(lng)

  • dll
  • parsing all controls of forms
  • indexed on content

Suggestion


Architecture
Work method

...

  • Class (Form/UserControl) languagecode-country/regioncode
  • Class (Form/UserControl) languagecode
  • Application (Plugin) languagecode-country/regioncode
  • Application (Plugin) languagecode
  • DelftShell (DelftShell.Resource, a new project in DelftShell for all common translations like save, delete, remove etc.) languagecode-country/regioncode
  • DelftShell (DelftShell.Resource, a new project in DelftShell for all common translations like save, delete, remove etc.) languagecode

Maintenance

...

Points of interest


  • Resources and WPF: msd2 (still based on Satellite Resource.dll's]