<

Go Premium for a chance to win a PS4. Enter to Win

x

Drupal Hebrew site tips

Published on
9,370 Points
3,270 Views
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!
   
collation.jpg
1
Comment
Author:HagayMandel
0 Comments

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month