Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
The Future improvements

Future

Internationalization(i18n)

These are the plans for supporting internationalisation. When Internationalization is turned off, all documents published are considered to be in the default language.

When internationalization is turned on, the default language setting becomes mandatory. Also mandatory is the list of locales that are served to visitors. All documents that are unconfigured regarding i18n are considered to be in the default language.

To create a translation of an existing document, or to create a new document in a language other than the default one, the user has to use the admin interface.

The i18n configuration for a file is located in the file's config. Each content file can have a config file with the same name located in the .config directory. The i18n configuration directives are:

The language of the document requested by the user is the first part of the path in the URL. For example: /nl_BE/bedrijven/presentatie.html

When this request is received, the language is first extracted: lang = nl_BE then the path is passed to eat_path: node = eat_path("/bedrijven/presentatie.html", "nl_BE");

Let's say the content was first published in english, and the default language is set to english. We have this directory structure:

-companies +-.config +-properties +-presentation.html.json +-presentatie.html.json +-presentation.html +-__sd_presentation.html +-__ld_presentation.html +-presentatie.html +-__sd_presentatie.fhtml +-__ld_presentatie.fhtml

The i18n content of properties is: nl_BE : title: bedrijven this tells us that the name of the directory "companies" in the locale nl_BE is "bedrijven".

When the directory structure is crawled, all this info is put in the nodes. I18n information stored in the nodes gives the name of the node in other languages. So in the node for the directory companies, we have the info: nl_BE: bedrijven

The node needs to provide the method getChildByName that can be called to get the child handling i18n: root.getChildByName("bedrijven", "nl_BE")

and then get to the file node: dir_node.getChildByName("presentatie.html", "nl_BE")

once we have the node, we have access to its description in the language: node.getShortDescription("nl_BE") node.getLongDescription("nl_BE")

The short and long descriptions of each file is put in the same directory with the following naming convention:

A request for /companies/presentation.html would also be routed correctly: if no locale is present in the URL, we use the default language. For search engine friendlyness (no duplicate content), we should redirect /en_US/companies/presentation.html to /companies/presentation.html with a 301 status.

Questions/remarks:

Git Integration

TODO