Drupal Hebrew site tips

Published on
9,388 Points
1 Endorsement
Last Modified:
RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages.

The main difference lies of course in the writing direction of these languages, and usually, web applications and several development environments, are capable of solving the directional issue with reasonable results.

Another difficulty in web applications is the encoding issue which affects several issues in a application:
Sure, presenting site's pages in the right encoding is not much of an issue, and the right html declaration will do the trick, but what about the back side of the site - the MySQL database?

Drupal is no different, it was Hebraized by an Israeli team, and it generally functions well.
However, several issues are not well solved or were put aside, small annoying issues, that prevent building a complete Hebrew based Drupal site,
This article will provide possible solutions to 2 of these annoying issues.

We'll start with the installation:
Drupal's installation script is excellent, and it does everything for you, except for the creation of the MySQL database of the server. Prior to the installation process.
You need to generate a new database which will be filled with content by Drupal automatically.
Well here is the first issue: selecting the right collation; failing doing so, will not harm the Drupal application, or prevent it from functioning, however, when the site operator / administrator will look at the MySQL tables (through a management tool such as phpMyAdmin), the content of all MySQL tables, will be a collection of question marks or complete Gibberish.
The solution is to select the 'utf8_general_ci’ collation on the database creation, this will cause all MySQL tables to display correct Hebrew content.
(see illustration below).

The second issue relates to Hebrew names of uploaded files:
When a user uploads a file (for example an image file) that has a Hebrew file name, the upload process changes the Hebrew characters to Latin ones.
When the image file is later on displayed on a page, or when the operator/administrator checks the files directory, all files carry Gibberish instead of Hebrew names.

A possible solution would be using the Transliteration module (http://drupal.org/project/transliteration).
This module replaces non Latin characters with equivalent Latin ones based on a replacement international convention.
This solves the Gibberish issue, but still files names lack significance!

My solution is a comprehensive one, and allows maintaining the actual Hebrew names!
The solution is to make a change in Drupal’s unicode.inc file (located in the ‘includes’ directory):
At line #42 (in Drupal 6.20) you’ll find:
// Set the standard C locale to ensure consistent, ASCII-only string handling.
  setlocale(LC_CTYPE, 'C');

Open in new window

This should be replaced by:
setlocale(LC_CTYPE, 'he_IL.UTF-8');

Open in new window

This can be changed to any RTL language!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month