Specification of language files

From Joomla! Documentation

Revision as of 10:18, 15 February 2010 by Akede (Talk | contribs)

This page explains the changes of the language file specification from version 1.5 to 1.6. As this is currently under development it is not merged back to the central specification page.

The 1.5 specification is described in Creating a language definition file.

==Overview of changes in Joomla 1.6== Joomla 1.6

  1. The KEY is now defined to be
    1. without any whitespace. All whitespace shall be converted into a underscore '_'
    2. All KEY's in the frontend shall include a prefix of the extension

Additional information from a new thread

So, the implications on ini file format:

  1. As previously mentioned, our keys will have to change. Spaces are not allowed. The general practice will be to use underscores for spacing. Also, the plan is to name space strings, so that you would end up with something like COM_EXAMPLE_MYKEY for your key. According to the php manual, The characters {}|&~![()^" cannot be used in keys. There are also reserved words for keys: null, yes, no, true, false, on, off, none.
  2. The syntax for the value will also change. According to the PHP manual, if a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes ("). That will basically mean all of our values will have to be enclosed in quotes, as a space is non alpha numeric. From what I gather, if you want to include a double-quote in your string, you use two double-quotes. Finally, according to the PHP manual, the {}|&~![()^" characters have a special meaning in the value. Unfortunately, they don't really unpack what that special meaning is - anybody have experience in this area?
  3. Comment syntax will change, as we are typically using pound signs (#) and the standard parser requires semi colons (;).

Problems are related to the different behavior of PHP 5.2 and 5.3 related the build in ini-parser. Current idea is to move to a JSON based format like:

The difference would be something like:



{ 'JDISABLED': 'Disabled', 'JENABLED': 'Enabled', 'JNO': 'No', 'JYES': 'Yes' }

Decisions are not made yet - please follow the thread.

Related discussion threads in the development mailing list