TR files for Chinese?

|
|
Next topic
 »
Author Message

Guillaume Marty

Wednesday 11 May 2011 8:30:19 am

I've not been able to find an elegant way to display URLs in Chinese.

Deactivating URL translation or using urlalias_iri transform group doesn't really help.

I'm wondering if it's possible to use the translation file for Chinese that is in Derick Rethans's Transliteration extension (http://pecl.php.net/package/translit).

The file is here:
http://svn.php.net/viewvc/pecl/translit/trunk/data/han_transliterate.tr?view=markup

If we can use this file to transform URL, what else needs to be set up?

Chen Xiongjie

Thursday 12 May 2011 12:42:30 am

Hi, Guillaume,

As far as I know the urlalias_iri works well. Example: http://ezcn.org/chi/文档/eZ-Publish/基本概念/内容与界面

But there is one issue here - when copying the url, it's encoded, which is not user-friendly.

I'm not sure what's result of the Transliteration extension. But for Chinese specific, alternatively I would prefer to have latinized Pinyin mapped to Chinese characters. I think an extension for this will be welcome. In Pinyin, that url will be http://ezcn.org/chi/wendang/eZ-Publish/jibengainian/neirongyujiemian

eZ Comments: http://projects.ez.no/ezcomments
twitter: http://twitter.com/xiongjie

Guillaume Marty

Monday 30 May 2011 9:12:22 am

Hi!

I've successfully created a .tr file to transliterate the Chinese characters, but I've not been able to make it work properly.

The file /share/transformations/han.tr looks like this (and has 25,326 lines):

han:
U+5416 = "a"
U+5475 = "a"
U+9312 = "a"
U+9515 = "a"
U+963F = "a"
U+55C4 = "a"
U+554A = "a"
U+54C0 = "ai"
...
U+8444 = "zuo"
U+888F = "zuo"
U+9162 = "zuo"
U+963C = "zuo"

I set up /setting/override/transform.ini.append.php:

[Transformation]
Charsets[]=utf-8;han

[han]
Files[]=han.tr
Extensions[]

When I launch updateniceurls.php,everything looks fine, but my URL are still using the node_* pattern.

Did I miss something? Is it OK to send a pull request to the github repo even if it's not completely working?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 00:53:21
Script start
Timing: Jan 30 2025 00:53:21
Module start 'layout'
Timing: Jan 30 2025 00:53:21
Module start 'content'
Timing: Jan 30 2025 00:53:21
Module end 'content'
Timing: Jan 30 2025 00:53:21
Script end

Main resources:

Total runtime0.0182 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.2813151.2266
Module start 'layout' 0.00620.0031 739.507836.6875
Module start 'content' 0.00930.0073 776.195391.5000
Module end 'content' 0.01660.0015 867.695333.9766
Script end 0.0182  901.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002413.1799140.0002
Check MTime0.00116.1958140.0001
Mysql Total
Database connection0.00084.392910.0008
Mysqli_queries0.003921.545330.0013
Looping result0.00000.055010.0000
Template Total0.00116.210.0011
Template load0.00094.783010.0009
Template processing0.00031.404910.0003
Override
Cache load0.00063.141110.0006
General
dbfile0.003720.137780.0005
String conversion0.00000.051140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs