Converting Old Language Definitions to Locale Packs

Vanilla 2.0.11 added a new way for an application's locales to be managed to make it easier for site administrators to change the language of their sites. The new locale packs are very similar to the old way language definitions so converting them is quite straight forward.

Step 1: Create a New Locale Pack

Create an empty locale pack with the proper info array. There is a skeleton locale pack in the vanilla distribution that you can copy to start out. You can also just create a folder in /locales and add a definitions.phpfile with the following at the beginning:

$LocaleInfo['FolderName'] = array(   
   'Locale' => 'en-CA' // The code of the locale
   'Name' => 'The name of the locale.'
   'Description' => 'Locale description goes here.', // Be as descriptive as possible.
   'Version' => '1.0', // A version number compatible with php's version_compare().
   'Author' =>; 'Your name here.',
   'AuthorEmail' => 'Your email here', // optional
   'AuthorUrl' => 'Your url here' // optional
);

Step 2: Copy the Old Language Definitions to the Locale Pack

The old language definitions will either be in one file or scattered amongst a bunch of different files. To copy them into the new locale pack you can do one of the following:

  1. Copy all of them into the definitions.php file of the new locale pack below the info array you entered above.
  2. Copy all of the files into the folder of the locale pack. You will probably have to rename them because they will usually all be called definitions.php. You can rename to something like dashboard_definitions.php, vanilla_definitions.php etc. to keep your locale pack organized if you want.

You're done!

That's all you have to do. Your language definitions have been converted and are ready to use.

See Also

Edited November 2011 by Todd