Forums / Developer / Adding a New Transformation Language File

Adding a New Transformation Language File

Author Message

Stéphane Cloutier

Saturday 26 March 2005 10:18:21 am

I created a new transformation file for the Inuktitut language. It transliterates from unicode to ASCII for nice urls.

I created an override transform.ini.append.php and added the following:

[Transformation]
# The inuktitut group
Charsets[]=utf-8;inuktitut

[inuktitut]
Files[]=inuktitut.tr

and placed - inuktitut.tr - in share/transformations folder.

I cleared ini, transformation and url alias caches.

Here's my transformation file:

# Rules related to Inuktitut
#
# The following charsets uses characters from inuktitut:
# utf-8
#
# See basic.tr for formatting options

# Transliteration of inuktitut,is used in URLs and identifiers

inuktitut_transliterate_ascii:

U+1449 = "p"
U+1466 = "t"
U+1483 = "k"
U+14A1 = "g"
U+14BB = "m"
U+14D0 = "n"
U+1505 = "s"
U+14EA = "l"
U+143E = "j"
U+155D = "v"
U+1550 = "r"
U+1585 = "q"
U+1595 = "ng"
U+1596 = "nng"
U+15A6 = "lh"

U+1403 = "i"
U+1404 = "ii"
U+1405 = "u"
U+1406 = "uu"
U+140A = "a"
U+140B = "aa"

U+1431 = "pi"
U+1432 = "pii"
U+1433 = "pu"
U+1434 = "puu"
U+1438 = "pa"
U+1439 = "paa"

U+144E = "ti"
U+144F = "tii"
U+1450 = "tu"
U+1451 = "tuu"
U+1455 = "ta"
U+1456 = "taa"

U+146D = "ki"
U+146E = "kii"
U+146F = "ku"
U+1470 = "kuu"
U+1472 = "ka"
U+1473 = "kaa"

U+148B = "gi"
U+148C = "gii"
U+148D = "gu"
U+148E = "guu"
U+1490 = "ga"
U+1491 = "gaa"

U+14A5 = "mi"
U+14A6 = "mii"
U+14A7 = "mu"
U+14A8 = "muu"
U+14AA = "ma"
U+14AB = "maa"

U+14C2 = "ni"
U+14C3 = "nii"
U+14C4 = "nu"
U+14C5 = "nuu"
U+14C7 = "na"
U+14C8 = "naa"

U+14EF = "si"
U+14F0 = "sii"
U+14F1 = "su"
U+14F2 = "suu"
U+14F4 = "sa"
U+14F5 = "saa"

U+14D5 = "li"
U+14D6 = "lii"
U+14D7 = "lu"
U+14D8 = "luu"
U+14DA = "la"
U+14DB = "laa"

U+1528 = "ji"
U+1529 = "jii"
U+152A = "ju"
U+152B = "juu"
U+152D = "ja"
U+152E = "jaa"

U+1555 = "vi"
U+1556 = "vii"
U+1557 = "vu"
U+1558 = "vuu"
U+1559 = "va"
U+155A = "vaa"

U+1546 = "ri"
U+1547 = "rii"
U+1548 = "ru"
U+1549 = "ruu"
U+154B = "ra"
U+154C = "raa"

U+157F = "qi"
U+1580 = "qii"
U+1581 = "qu"
U+1582 = "quu"
U+1583 = "qa"
U+1584 = "qaa"

U+158F = "ngi"
U+1590 = "ngii"
U+1591 = "ngu"
U+1592 = "nguu"
U+1593 = "nga"
U+1594 = "ngaa"

U+1671 = "nngi"
U+1672 = "nngii"
U+1673 = "nngu"
U+1674 = "nnguu"
U+1675 = "nnga"
U+1676 = "nngaa"

U+15A0 = "lhi"
U+15A1 = "lhii"
U+15A2 = "lhu"
U+15A3 = "lhuu"
U+15A4 = "lha"
U+15A5 = "lhaa"

U+157C + "H"

Qupanuaq - Snow bunting

Stéphane Cloutier

Sunday 27 March 2005 4:28:22 am

Is there a way to have content transliterated, depending on user's preferences?

Qupanuaq - Snow bunting

Stéphane Cloutier

Sunday 27 March 2005 7:33:19 am

I need some assisance. How do you associate two unicode characters and have the combination checked first (avoiding duplication with single unicode characters), but if no match found, try to match the single unicode characters.

I have to associate
U+1585 = "q"

With the following:
U+1585 - U+146D = "qqi"
U+1585 - U+146E = "qqii"
U+1585 - U+146F = "qqu"
U+1585 - U+1470 = "qquu"
U+1585 - U+1472 = "qqa"
U+1585 - U+1473 = "qqaa"

When typing in unicode "ta - q - ki - q"
I should be able to get "taqqiq" and not "taqkiq". Any combination of "q followed by k(i,u,a)" should produce double "qq(i,u,a)".

How do you set such rules in the transformation system?

Qupanuaq - Snow bunting

eZ debug

Timing: Jan 18 2025 11:15:35
Script start
Timing: Jan 18 2025 11:15:35
Module start 'content'
Timing: Jan 18 2025 11:15:36
Module end 'content'
Timing: Jan 18 2025 11:15:36
Script end

Main resources:

Total runtime1.1608 sec
Peak memory usage4,096.0000 KB
Database Queries192

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.9609180.8125
Module start 'content' 0.00681.0063 769.7734553.5859
Module end 'content' 1.01300.1477 1,323.3594336.7422
Script end 1.1608  1,660.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3585210.0002
Check MTime0.00140.1248210.0001
Mysql Total
Database connection0.00070.060310.0007
Mysqli_queries1.060091.31191920.0055
Looping result0.00230.19421900.0000
Template Total1.125697.020.5628
Template load0.00170.149520.0009
Template processing1.123996.815720.5619
Template load and register function0.00010.009010.0001
states
state_id_array0.00120.104110.0012
state_identifier_array0.00140.118420.0007
Override
Cache load0.00170.14751520.0000
Sytem overhead
Fetch class attribute can translate value0.00220.188820.0011
Fetch class attribute name0.00170.144640.0004
XML
Image XML parsing0.00070.061220.0004
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00350.3048270.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
26content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
23content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 57
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs