Andreas Rydberg

Home

Add translation during the installation - the proper way

Andreas — Sat, 2009-07-04 12:38

I've written before about this: Add language and import translations through profile in Drupal 6 (give it a quick read!). Why I did that way before was due to a bug, or maybe an error on my behalf, in earlier Drupal-version that made the imported language overwrite english. So that english was impossible to to switch to or recover.

Anyhow, this how you should do it.

Installation

What you need is basic installation of Drupal. It's good if you have a basic understanding of Drupal's installation profiles.

Get the translation

Download one or more translations from drupal.org and extract them in your root directory for Drupal.

I'm going to use the swedish translation and the latest version is 6.x-1.2, at the time of writing, and other translations can vary in which files are there.

$ wget http://ftp.drupal.org/files/projects/sv-6.x-1.2.tar.gz
$ tar -xf sv-6.x-1.2.tar.gz

I did this through the terminal, wget to get the file and tar to extract the file. You can do it the way you prefer.

Files

The files and directories that are included are:

  • LICENSE.sv.txt
  • modules
  • profiles
  • STATUS.sv.txt
  • themes

If you extracted the files elsewhere then copy the directories modules, profiles and themes to the root of you installation. You will most likely to be prompted about overwriting files and directories, just go ahead and overwrite.

You can now try it out, Drupal handles the rest for us. You should now get to choose between english and the translations you installed.

NOTE: that the installation process will also be in the language that you choose. So if you want to have a language on your site that you don't know so well, then maybe you should add the translation when Drupal is installed. But you still need the files in place. You can add languages in admin/settings/language/add (in your web browser) on your site.

Custom install profiles

The Drupal standard install profile is only one file and it's location on the file system is profiles/default/default.profile. If you have a custom profile it might be something like this: profiles/custom/custom.profile.

You can also download publicly shared install profiles from drupal.org.

To be able to choose translation when using your custom profile I recommend to create a symbolic link to the profiles/default/translations like ln -s ../default/translations. You could copy the directory and all of it's files, but you would have to do this every time you update you translation files.

  • Drupal

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

More information about formatting options

Blog posts

2009.12.11
Ubuntu 9.10 might very well be the best release yet
2009.07.04
Add translation during the installation - the proper way
2009.01.10
PHP best practice tip: commas in arrays
2009.01.03
Add language and import translations through profile in Drupal 6
2008.10.14
Very useful articles about javascript
  •  
  • 1 of 2
  • ››
Syndicate content

Powered by Drupal, an open source content management system