-Up to-Home/Products/Fardel
-Site Map|-Text version

Design Notes

[Motivation] [Design Goals/Requirements] [The Name 'Fardel'] [Structure] [Resource Names - The Programmer's View] [Locales - The Translator's View] [Fardel Resource-Scripts]


Motivation

While extending some small windows applications in C++, it became apparent that Microsoft Developer Studio (version 5) didn't have particularly good multi-language support:

A quick search found several approaches for C++/Java:

Design Goals/Requirements

Once the decision to create a language library was made, the following aims/requirements were adopted:

The Name 'Fardel'

The name chosen for the library was 'Fardel' - an archaic word meaning bundle or burden, from an Arabic word fard(a) meaning 'camel-load'.

Structure

Components in the system are:

Resource Names - The Programmer's View

The idea behind multilanguage resources from a programmer's point of view is to hide the language-specific details of resources; the programmer tells the computer: "Display the 'file-not-found' error message in the local language".

Fardel provides a hierachical system of Resource Names which allows resources to be re-used in a number of projects. Resource Names have the following pattern:

Some examples of Resource Names are:

The restrictions on the module.name patterns in Fardel resource-scripts are that they contain only printable unicode characters and use no ASCII punctutation characters apart from '-' (minus) and '_' (underscore). If you intend to generate code fragments to embed the resources within a program, the each pattern should be a valid, non-reserved identifier in the target programming language(s).

Locales - The Translator's View

From a translator's point of view, the task is to take resources - traditionally strings, but possibly also icons/images/sounds - given in one or more source languages and to produce their equivalents in a new language.

Fardel borrows the notion of a locale - a combined language-code and optional region-code - to capture the concept of a particular language. Locales are used many programming languages and operating systems. Some examples of locales are:

Local CodeLocale DescriptionSome example resources for the locale
""No particular language or localProductName="FooBar"
ProductVersion="1.42"
ProductURL="www.foobar.com"
"de"German - no particular regionProductName="FüBar"
greeting="Bonjour!"
biscuit="Keks"
scone="Teegebäck"
"en"English - no particular regiongreeting="Hello!"
scone="Scone"
biscuit="Biscuit"
"en-US"English - USAgreeting="Hi!"
biscuit="Cookie"
scone="Biscuit"
"en-GB"English - Great Britain 
"en-AU"English - Australiagreeting="G'day!"
biscuit="Bikkie"

Locales can be used as a convenient way of providing defaults, with more specific language setting overriding more general settings. Using this, the resource list above becomes the following for Australian English:

Resource Name"" (universal) locale entry"en" locale entry"en-AU" locale entryresult for "en-AU" locale
ProductName"FooBar"  "FooBar"
ProductVersion"1.42"  "1.42"
ProductURL"www.foobar.com"  "www.foobar.com"
greeting "Hello!""G'day!""G'day!"
biscuit "Biscuit""Bikkie""Bikkie"
scone "Scone" "Scone"

Fardel Resource-Scripts

xyz


-This page
last changed:
21 May 2003
[Validate HTML]
-Donate free
food & land
 
-
|Feedback by email
or Web form