hi people!
i'm on holiday..but i'm still working on aiki-framework.
In revision 891 i have added support for multiple languages. Basically:
1) table aiki_sites have three new field to define language:
site_default_language: use in home page for example.
site_languages: list of allowed languages separated by comas. (No limitation
of number, but probably with much work slowly)
widget_language: the language used in widgets.
Example 1:
site_default_language: en
site_languages: en,fr,de
widget_language: en
->means: the site is available in three languages: en (as default),fr,de.
The widgets is written in english.
Example 2:
(imagine a group of spanish typographers using open font for a new site:
site_detault_language: es (they will use spanish by default)
site_languages: en,es
widget_language: en (they are using widget originally written in english)
All configuration work using human logic ( also called fuzzy logic ;-) the
default language is added to site_language if don't appears. Default values
are "en" for all.
2) the are a new dictionary class added to $aiki object, and a first
implementation for a dictionaries. Terms are saved in tabla
aiki_dictionaries as "term, translateto, translatefrom, translation". It's
rude..but works.
Instead create a new directory for each auxiliary class, i have create
libs/class for this purpose.
(i have translated some terms in spanish)
3) language is defined in url.
Examples: default languages en, site_languages: fr,de,es,
www.openclipart.org ->home page in english
www.openclipart.org/browse ->browse page in english
www.openclipart.org/en/browse ->browse page in english
www.openclipart.org/es/browse ->browse page in spanish
www.openclipart.org/ww/browse ->page 404 ww/browse don't exists
Aiki try to determine the language using the first part of "url" (path). If
it is a allowed languages (including default language), set the language,
and 'shift' the url. In the example (url(0) is always browse).
4) Changed in widgets.
The problem is that [root] is always a url without language. You can use:
[language] or [root-language]
Example: (widget 16 of openclipart)
<li <php if (!(0)!)=browse then class='active' php> ><a title="Look for
clipart..." href="[root]/[language]/browse">Clipart</a></li>
<li <php if (!(0)!)=news then class='active' php> ><a title="Read News,
keep up to date" href="[root-language]/news">News</a></li>
5) Test:
edit aiki_site and added en as default language and es as site_languages and
then test:
URL/es/login
6) for aiki frameworks developers:
Use function __ for translate.
Example:
$aiki->message->ok( __("An email has been sent to your address. Please
follow the link to reset your password."),
7) TODO
- doc.
- edit site configuration for languages in aiki/admin
- edit dictionaries in aiki/admin.
- use __ function in all libraries.
8) others.
- I have make some minor improvements during developing (membership,
output..)
- Aiki_language and aiki_dictionary are now unused. L10 can be replaced by
this new system.
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp