You are here

README.txt in Transliteration 6.2

Same filename and directory in other branches
  1. 5.2 README.txt
  2. 5 README.txt
  3. 6.3 README.txt
  4. 6 README.txt
  5. 7.3 README.txt
/* $Id$ */

-- SUMMARY --

The purpose of this module is to provide a central transliteration service for
other Drupal modules, as well as sanitizing file names while uploading files
to Drupal.

For a full description visit the project page:
  http://drupal.org/project/transliteration
Bug reports, feature suggestions and latest developments:
  http://drupal.org/project/issues/transliteration


-- INSTALLATION --

1. Copy the transliteration folder to your modules directory.

2. If you are installing to an existing Drupal site, you might want to enable
   retroactive transliteration during installation of this module. This will
   update all file names containing non-ASCII characters. However, if you have
   hard-coded links in your contents these will be broken and require manual
   fixing. Therefore you have to manually enable this feature by editing
   transliteration.install and change the following line at the top of the file:

     define('TRANSLITERATION_RETROACTIVE', FALSE);

   to

     define('TRANSLITERATION_RETROACTIVE', TRUE);

   If you already installed the module and would like to execute retroactive
   transliteration afterwards, you can rerun update.php and manually select
   update #1.

3. Install as usual, see http://drupal.org/node/70151 for further information.


-- CONFIGURATION --

This module has no settings that can be customized.


-- 3RD PARTY INTEGRATION --

Third party developers who are seeking an easy way to transliterate strings may
use the transliteration_get() helper function:

if (module_exists('transliteration')) {
  $transliterated = transliteration_get($string);
}

You might want to take a look at the PHPDoc for an explanation of additional
function parameters.


-- LANGUAGE SPECIFIC REPLACEMENTS --

This module uses transliteration data collected from various sources which might
be incomplete or inaccurate for your specific language. Therefore,
transliteration supports language specific alterations to the basic
replacements. The following guide explains how to add them:

1. First find the Unicode character code you want to replace. As an example,
   we'll be adding a custom transliteration for the cyrillic character 'г'
   (hexadecimal code 0x0433) using the ASCII character 'q' for Azerbaijani
   input.

2. Transliteration stores its mappings in banks with 256 characters each. The
   first two digits of the character code (04) tell you in which file you'll
   find the corresponding mapping. In our case it is data/x04.php.

3. If you open that file in an editor, you'll find the base replacement matrix
   consisting of 16 lines with 16 characters on each line, and zero or more
   additional language-specific variants. To add our custom replacement, we need
   to do two things: first, we need to create a new transliteration variant
   for Azerbaijani since it doesn't exist yet, and second, we need to map the
   last two digits of the hexadecimal character code (33) to the desired output.
   To do this, add a new key right before the last closing bracket:

     'az' => array(0x33 => 'q'),

   (see http://people.w3.org/rishida/names/languages.html for a list of
   language codes).

   Any Azerbaijani input will now use the appropriate variant.

Also take a look at data/x00.php which already contains a bunch of language
specific replacements. If you think your overrides are useful for others please
create and file a patch at http://drupal.org/project/issues/transliteration.


-- CREDITS --

Authors:
* Stefan M. Kudwien (smk-ka) - http://drupal.org/user/48898
* Daniel F. Kudwien (sun) - http://drupal.org/user/54136

UTF-8 normalization is based on UtfNormal.php from MediaWiki
(http://www.mediawiki.org) and transliteration uses data from Sean M. Burke's
Text::Unidecode CPAN module
(http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm).

This project has been sponsored by UNLEASHED MIND
Specialized in consulting and planning of Drupal powered sites, UNLEASHED
MIND offers installation, development, theming, customization, and hosting
to get you started. Visit http://www.unleashedmind.com for more information.

File

README.txt
View source
  1. /* $Id$ */
  2. -- SUMMARY --
  3. The purpose of this module is to provide a central transliteration service for
  4. other Drupal modules, as well as sanitizing file names while uploading files
  5. to Drupal.
  6. For a full description visit the project page:
  7. http://drupal.org/project/transliteration
  8. Bug reports, feature suggestions and latest developments:
  9. http://drupal.org/project/issues/transliteration
  10. -- INSTALLATION --
  11. 1. Copy the transliteration folder to your modules directory.
  12. 2. If you are installing to an existing Drupal site, you might want to enable
  13. retroactive transliteration during installation of this module. This will
  14. update all file names containing non-ASCII characters. However, if you have
  15. hard-coded links in your contents these will be broken and require manual
  16. fixing. Therefore you have to manually enable this feature by editing
  17. transliteration.install and change the following line at the top of the file:
  18. define('TRANSLITERATION_RETROACTIVE', FALSE);
  19. to
  20. define('TRANSLITERATION_RETROACTIVE', TRUE);
  21. If you already installed the module and would like to execute retroactive
  22. transliteration afterwards, you can rerun update.php and manually select
  23. update #1.
  24. 3. Install as usual, see http://drupal.org/node/70151 for further information.
  25. -- CONFIGURATION --
  26. This module has no settings that can be customized.
  27. -- 3RD PARTY INTEGRATION --
  28. Third party developers who are seeking an easy way to transliterate strings may
  29. use the transliteration_get() helper function:
  30. if (module_exists('transliteration')) {
  31. $transliterated = transliteration_get($string);
  32. }
  33. You might want to take a look at the PHPDoc for an explanation of additional
  34. function parameters.
  35. -- LANGUAGE SPECIFIC REPLACEMENTS --
  36. This module uses transliteration data collected from various sources which might
  37. be incomplete or inaccurate for your specific language. Therefore,
  38. transliteration supports language specific alterations to the basic
  39. replacements. The following guide explains how to add them:
  40. 1. First find the Unicode character code you want to replace. As an example,
  41. we'll be adding a custom transliteration for the cyrillic character 'г'
  42. (hexadecimal code 0x0433) using the ASCII character 'q' for Azerbaijani
  43. input.
  44. 2. Transliteration stores its mappings in banks with 256 characters each. The
  45. first two digits of the character code (04) tell you in which file you'll
  46. find the corresponding mapping. In our case it is data/x04.php.
  47. 3. If you open that file in an editor, you'll find the base replacement matrix
  48. consisting of 16 lines with 16 characters on each line, and zero or more
  49. additional language-specific variants. To add our custom replacement, we need
  50. to do two things: first, we need to create a new transliteration variant
  51. for Azerbaijani since it doesn't exist yet, and second, we need to map the
  52. last two digits of the hexadecimal character code (33) to the desired output.
  53. To do this, add a new key right before the last closing bracket:
  54. 'az' => array(0x33 => 'q'),
  55. (see http://people.w3.org/rishida/names/languages.html for a list of
  56. language codes).
  57. Any Azerbaijani input will now use the appropriate variant.
  58. Also take a look at data/x00.php which already contains a bunch of language
  59. specific replacements. If you think your overrides are useful for others please
  60. create and file a patch at http://drupal.org/project/issues/transliteration.
  61. -- CREDITS --
  62. Authors:
  63. * Stefan M. Kudwien (smk-ka) - http://drupal.org/user/48898
  64. * Daniel F. Kudwien (sun) - http://drupal.org/user/54136
  65. UTF-8 normalization is based on UtfNormal.php from MediaWiki
  66. (http://www.mediawiki.org) and transliteration uses data from Sean M. Burke's
  67. Text::Unidecode CPAN module
  68. (http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm).
  69. This project has been sponsored by UNLEASHED MIND
  70. Specialized in consulting and planning of Drupal powered sites, UNLEASHED
  71. MIND offers installation, development, theming, customization, and hosting
  72. to get you started. Visit http://www.unleashedmind.com for more information.