BIF3
[ class tree: BIF3 ] [ index: BIF3 ] [ all elements ]
Prev Next
I18n under BIFWhat is I18n?

I18n is short for internacionalization. Means several languages in one application.

Widgets have a special attribute LANG so you can define in which language are the made.

Lets see a simple example:
<titlebox lang="en" title="What is BIF?">
Build it Fast (BIF) is a PHP Framework.  It contains several classes
that help you develop complex Web applications in a short amount of
time. It brings the concept of the 'widget' to Web development. It
features Cascade Skins and transparent session management.
</titlebox>
<titlebox lang="es" title="¿Qué es BIF?">
Build it Fast (BIF) es un marco de trabajo (framework) escrito en PHP.
Contien varias clases que te ayudan a desarrollar aplicaciones web
complejas en un período de tiempo corto. Utiliza el concepto de 
'widget' en el desarrollo web. Hace uso de Pieles y manejo de
</titlebox>

As you can see lang="en" and lang="es" defines the language titlebox contents are in.

Configuring your application

In order to configure your application with this behaviour, you should include in your bifConfig.inc.php:
$bifcfg['i18n']['supported'] = array('English' => 'en',
                                     'Español' => 'es',
                                     );
$bifcfg['i18n']['default']   = 'en';

If you access that page with ?bif_lang=en or ?bif_lang=es you'll see diferent content. Showing one or other paragraph. You can include a language selector use 'BifLangSelector' widget.

In different files

If you need to split languages in diferent files -that's for example English and Spanish in two different files- you could use BifInclude in this way:
<BifInclude src="Content/index_en.bif" lang="en" />
<BifInclude src="Content/index_es.bif" lang="es" />
Note the directory is relative to $app_dir! and the language specific content will be in separated files.

Prev   Next
Using the SimpleWiki component Building a BIF Application

Documentation generated on Wed, 10 Nov 2004 19:41:19 -0300 by phpDocumentor 1.2.3