You are here

README.txt in Transliteration 7.3

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. 6.2 README.txt
CONTENTS OF THIS FILE
---------------------
   
 * Introduction
 * Requirements
 * Installation
 * Configuration
 * 3rd Party Integration
 * Language Specific Replacements
 * Credits
 * Maintainers
 * Useful Resources


INTRODUCTION
------------

Provides a central transliteration service to other Drupal modules, and
sanitizes file names while uploading.

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


REQUIREMENTS
------------

No special requirements


INSTALLATION
------------

Install as you would normally install a contributed Drupal module. See:
https://drupal.org/documentation/install/modules-themes/modules-7 for further
information.

If you are installing to an existing Drupal site, you might want to fix
existing file names after installation, which will update all file names
containing non-ASCII characters. However, if you have manually entered links
to those files in any contents, these links will break since the original
files are renamed. Therefore it is a good idea to test the conversion
first on a copy of your web site. You'll find the retroactive conversion at
Configuration and modules >> Media >> File system >> Transliteration.


CONFIGURATION
-------------

 * This project doesn't require special permissions.

 * This project can be configured from the File system configuration page
   (Configuration and modules » Media » File system » Settings).

   - Transliterate file names during upload: If you need more control over the
     resulting file names you might want to disable this feature here and
     install the FileField Paths  (http://drupal.org/project/filefield_paths)
     instead.

   - Lowercase transliterated file names: It is recommended to enable this
     option to prevent issues with case-insensitive file systems.


3RD PARTY INTEGRATION
---------------------

Third party developers seeking an easy way to transliterate text or file names
may use transliteration functions as follows:

if (function_exists('transliteration_get')) {
  $transliterated = transliteration_get($text, $unknown, $source_langcode);
}

or, in case of file names:

if (function_exists('transliteration_clean_filename')) {
  $transliterated = transliteration_clean_filename($filename, $source_langcode);
}

Note that the optional $source_langcode parameter specifies the language code
of the input. If the source language is not known at the time of transliter-
ation, it is recommended to set this argument to the site default language:

  $output = transliteration_get($text, '?', language_default('language'));

Otherwise the current display language will be used, which might produce
inconsistent results.


LANGUAGE SPECIFIC REPLACEMENTS
------------------------------

This project supports language specific variations in addition to the basic
transliteration 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
   string:

     $variant['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
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


MAINTAINERS
-----------
* Stefan M. Kudwien (smk-ka) - http://drupal.org/user/48898
* Renato Gonçalves (RenatoG) - https://www.drupal.org/user/3326031
* Daniel F. Kudwien (sun) - http://drupal.org/user/54136
* Andrei Mateescu (amateescu) - http://drupal.org/user/729614

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).


USEFUL RESOURCES
----------------

Unicode Code Converter:
http://people.w3.org/rishida/tools/conversion/

UTF-8 encoding table and Unicode characters:
http://www.utf8-chartable.de/unicode-utf8-table.pl

Country codes:
http://www.loc.gov/standards/iso639-2/php/code_list.php

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Configuration
  7. * 3rd Party Integration
  8. * Language Specific Replacements
  9. * Credits
  10. * Maintainers
  11. * Useful Resources
  12. INTRODUCTION
  13. ------------
  14. Provides a central transliteration service to other Drupal modules, and
  15. sanitizes file names while uploading.
  16. For a full description visit the project page:
  17. http://drupal.org/project/transliteration
  18. Bug reports, feature suggestions and latest developments:
  19. http://drupal.org/project/issues/transliteration
  20. REQUIREMENTS
  21. ------------
  22. No special requirements
  23. INSTALLATION
  24. ------------
  25. Install as you would normally install a contributed Drupal module. See:
  26. https://drupal.org/documentation/install/modules-themes/modules-7 for further
  27. information.
  28. If you are installing to an existing Drupal site, you might want to fix
  29. existing file names after installation, which will update all file names
  30. containing non-ASCII characters. However, if you have manually entered links
  31. to those files in any contents, these links will break since the original
  32. files are renamed. Therefore it is a good idea to test the conversion
  33. first on a copy of your web site. You'll find the retroactive conversion at
  34. Configuration and modules >> Media >> File system >> Transliteration.
  35. CONFIGURATION
  36. -------------
  37. * This project doesn't require special permissions.
  38. * This project can be configured from the File system configuration page
  39. (Configuration and modules » Media » File system » Settings).
  40. - Transliterate file names during upload: If you need more control over the
  41. resulting file names you might want to disable this feature here and
  42. install the FileField Paths (http://drupal.org/project/filefield_paths)
  43. instead.
  44. - Lowercase transliterated file names: It is recommended to enable this
  45. option to prevent issues with case-insensitive file systems.
  46. 3RD PARTY INTEGRATION
  47. ---------------------
  48. Third party developers seeking an easy way to transliterate text or file names
  49. may use transliteration functions as follows:
  50. if (function_exists('transliteration_get')) {
  51. $transliterated = transliteration_get($text, $unknown, $source_langcode);
  52. }
  53. or, in case of file names:
  54. if (function_exists('transliteration_clean_filename')) {
  55. $transliterated = transliteration_clean_filename($filename, $source_langcode);
  56. }
  57. Note that the optional $source_langcode parameter specifies the language code
  58. of the input. If the source language is not known at the time of transliter-
  59. ation, it is recommended to set this argument to the site default language:
  60. $output = transliteration_get($text, '?', language_default('language'));
  61. Otherwise the current display language will be used, which might produce
  62. inconsistent results.
  63. LANGUAGE SPECIFIC REPLACEMENTS
  64. ------------------------------
  65. This project supports language specific variations in addition to the basic
  66. transliteration replacements. The following guide explains how to add them:
  67. 1. First find the Unicode character code you want to replace. As an example,
  68. we'll be adding a custom transliteration for the cyrillic character 'г'
  69. (hexadecimal code 0x0433) using the ASCII character 'q' for Azerbaijani
  70. input.
  71. 2. Transliteration stores its mappings in banks with 256 characters each. The
  72. first two digits of the character code (04) tell you in which file you'll
  73. find the corresponding mapping. In our case it is data/x04.php.
  74. 3. If you open that file in an editor, you'll find the base replacement matrix
  75. consisting of 16 lines with 16 characters on each line, and zero or more
  76. additional language-specific variants. To add our custom replacement, we need
  77. to do two things: first, we need to create a new transliteration variant
  78. for Azerbaijani since it doesn't exist yet, and second, we need to map the
  79. last two digits of the hexadecimal character code (33) to the desired output
  80. string:
  81. $variant['az'] = array(0x33 => 'q');
  82. (see http://people.w3.org/rishida/names/languages.html for a list of
  83. language codes).
  84. Any Azerbaijani input will now use the appropriate variant.
  85. Also take a look at data/x00.php which already contains a bunch of language
  86. specific replacements. If you think your overrides are useful for others please
  87. file a patch at http://drupal.org/project/issues/transliteration.
  88. CREDITS
  89. -------
  90. Authors:
  91. * Stefan M. Kudwien (smk-ka) - http://drupal.org/user/48898
  92. * Daniel F. Kudwien (sun) - http://drupal.org/user/54136
  93. MAINTAINERS
  94. -----------
  95. * Stefan M. Kudwien (smk-ka) - http://drupal.org/user/48898
  96. * Renato Gonçalves (RenatoG) - https://www.drupal.org/user/3326031
  97. * Daniel F. Kudwien (sun) - http://drupal.org/user/54136
  98. * Andrei Mateescu (amateescu) - http://drupal.org/user/729614
  99. UTF-8 normalization is based on UtfNormal.php from MediaWiki
  100. (http://www.mediawiki.org) and transliteration uses data from Sean M. Burke's
  101. Text::Unidecode CPAN module
  102. (http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm).
  103. USEFUL RESOURCES
  104. ----------------
  105. Unicode Code Converter:
  106. http://people.w3.org/rishida/tools/conversion/
  107. UTF-8 encoding table and Unicode characters:
  108. http://www.utf8-chartable.de/unicode-utf8-table.pl
  109. Country codes:
  110. http://www.loc.gov/standards/iso639-2/php/code_list.php