Non ASCII-7 characters in URL (article alias)

General questions regarding the use of languages in Joomla! 1.5.

Moderator: General Support Moderators

Locked
grayz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Tue Dec 12, 2006 8:37 pm

Non ASCII-7 characters in URL (article alias)

Post by grayz » Wed Jan 16, 2008 4:36 pm

I've been looking for a solution allowing creation/saving of article aliases having non-ASCII-7 characters.

Currently all non-ASCII-7 characters are being cleaned-up by transliterate() and stringURLSafe() functions.

As far as I understood, having non-ANCII letters in the URL will not create problems for SEF engine and the article could be opened. I'm I right? If yes, how could I acooplish the task?

Thanks.
www.justPHP.net - HACKS for Hot Property, Custom 404 Error Pages, Templates for Joomla etc.
Developing: www.zerno.org.ua

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Wed Jan 16, 2008 5:48 pm

No way to do this anymore with Joomla.
Any url with utf8 glyphs is translated (also with simple latin-1).
If you don't, you get that kind:
http://zh.wikipedia.org/w/index.php?tit ... iant=zh-tw

and it gets very looooooooong when one is getting to a category item with a very long title

To use Ascii 7 is a simple and secure solution.

Note: to get the older behaviour means a lot of changes in core.
Last edited by infograf768 on Wed Jan 16, 2008 5:50 pm, edited 1 time in total.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

grayz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Tue Dec 12, 2006 8:37 pm

Re: Non ASCII-7 characters in URL (article alias)

Post by grayz » Wed Jan 16, 2008 6:04 pm

Thanks for the reply. Not good news, of cause... 

Even if I convert the title from UTF-8 into ISO-8859-5 and try to make the alias - it will not help?

Also, if you could provide more info/links about the question, I'll appreciate it very much. I'll help me to study the quesion in details, as technically it seems to be possible (http://ru.wikipedia.org/wiki/Кодировка this page is in UTF-8 encoding).
www.justPHP.net - HACKS for Hot Property, Custom 404 Error Pages, Templates for Joomla etc.
Developing: www.zerno.org.ua

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Wed Jan 16, 2008 6:15 pm

Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

grayz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Tue Dec 12, 2006 8:37 pm

Re: Non ASCII-7 characters in URL (article alias)

Post by grayz » Thu Jan 17, 2008 10:55 am

Hm... It seems that only translit (http://translit.us/) could be used in the URLs.
As far as I understood some of the "non-ASCII" search engines take into cosideration of the URLs as they can decode them back into original language.

Thanks, infograf768.
www.justPHP.net - HACKS for Hot Property, Custom 404 Error Pages, Templates for Joomla etc.
Developing: www.zerno.org.ua

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Thu Jan 17, 2008 1:43 pm

np
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gerilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Oct 22, 2008 11:36 am

Re: Non ASCII-7 characters in URL (article alias)

Post by gerilla » Wed Oct 22, 2008 11:44 am

grayz wrote:I've been looking for a solution allowing creation/saving of article aliases having non-ASCII-7 characters.

Currently all non-ASCII-7 characters are being cleaned-up by transliterate() and stringURLSafe() functions.

As far as I understood, having non-ANCII letters in the URL will not create problems for SEF engine and the article could be opened. I'm I right? If yes, how could I acooplish the task?

Thanks.
hi,
which page the title converting alias. i mean where the transliterate() and stringURLSafe() functions used. i wanna add a alias code before them but i couldnt find them.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Wed Oct 22, 2008 3:34 pm

libraries/joomla/language/language.php

and

libraries/joomla/filter/filteroutput.php
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gerilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Oct 22, 2008 11:36 am

Re: Non ASCII-7 characters in URL (article alias)

Post by gerilla » Wed Oct 22, 2008 6:34 pm

infograf768 wrote:libraries/joomla/language/language.php

and

libraries/joomla/filter/filteroutput.php
i made it. thank you very very much...

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Thu Oct 23, 2008 6:10 am

Out of pure curiosity, what did you change in order to get what?
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gerilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Oct 22, 2008 11:36 am

Re: Non ASCII-7 characters in URL (article alias)

Post by gerilla » Thu Oct 23, 2008 8:24 pm

infograf768 wrote:Out of pure curiosity, what did you change in order to get what?
i added replace codes for some Non ASCII-7 Turkish characters which joomla cant convert them latin correctly. now the titles which contain Non ASCII-7 characters converted to alias automatically.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Fri Oct 24, 2008 4:15 am

Could you share more?
What are the Turkish non-latin characters involved and the code you added or changed in the 2 files?
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gerilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Oct 22, 2008 11:36 am

Re: Non ASCII-7 characters in URL (article alias)

Post by gerilla » Fri Oct 24, 2008 11:13 am

infograf768 wrote:Could you share more?
What are the Turkish non-latin characters involved and the code you added or changed in the 2 files?
sorry my fault...

the characters are : ş ı ü ö ğ ç

i added the code in transliterate() function at libraries/joomla/language/language.php file (i do not made any change at libraries/joomla/filter/filteroutput.php)

her is the code i added:

Code: Select all

		$string = JString::strtolower($string);
		$tr = array('ğ','ü','ş','ö','ç', 'ı');
		$en = array('g','u','s','o','c', 'i');
		$string = JString::str_ireplace($tr, $en, $string);
so, the string converted to ASCII-7 characters first and then converted to alias correctly. (i saved the file utf-8 format).

User avatar
gencom
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 29, 2007 5:41 pm
Location: Türkiye
Contact:

Re: Non ASCII-7 characters in URL (article alias)

Post by gencom » Sat Jul 25, 2009 9:28 pm

thanks i need this

glimbeek
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 146
Joined: Wed Mar 25, 2009 8:08 am
Location: Europe

Re: Non ASCII-7 characters in URL (article alias)

Post by glimbeek » Fri Oct 23, 2009 9:24 am

What's the verdict on this? Is this a good solution? Has this been fixed in a newer version off Joomla? All I can find is, is that a solution is planned for 1.6.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Fri Oct 23, 2009 10:17 am

The solution is implemented in 1.6.
Plugins are available for 1.5.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

glimbeek
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 146
Joined: Wed Mar 25, 2009 8:08 am
Location: Europe

Re: Non ASCII-7 characters in URL (article alias)

Post by glimbeek » Fri Oct 23, 2009 10:31 am

Thanks for the fast reply.

With the risk off asking something I might find myself....
I looked into the plugins, but I couldn't find 1 that could accomplish what I'm looking for. I found 1 that came close: http://extensions.joomla.org/extensions ... t/sef/7132 but that doesn't support the Turkish language.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Fri Oct 23, 2009 3:19 pm

glimbeek wrote:Thanks for the fast reply.

With the risk off asking something I might find myself....
I looked into the plugins, but I couldn't find 1 that could accomplish what I'm looking for. I found 1 that came close: http://extensions.joomla.org/extensions ... t/sef/7132 but that doesn't support the Turkish language.
This one should do.
It can be customized for any language.
plgTurkceAlias12.txt
Change suffix .txt to .zip to install.
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
gencom
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 29, 2007 5:41 pm
Location: Türkiye
Contact:

Re: Non ASCII-7 characters in URL (article alias)

Post by gencom » Tue Oct 27, 2009 7:43 am

i konw im used more ago thanks

glimbeek
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 146
Joined: Wed Mar 25, 2009 8:08 am
Location: Europe

Re: Non ASCII-7 characters in URL (article alias)

Post by glimbeek » Tue Oct 27, 2009 7:53 am

So what does this plugin do? My site has a fair few language that use "odd" characters, can I be sure that nothing will change and that it will only "function" for the Turkish language?

Do I need to use/install something else to make this work? Like a Turkish front-end language?

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Tue Oct 27, 2009 9:19 am

This plugin just adds plain transliteration for some Latin Extended-A characters out of the box when you create a new article. It does not modify existing aliases, nor does it forces you to do anyhting as you can control the alias.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

glimbeek
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 146
Joined: Wed Mar 25, 2009 8:08 am
Location: Europe

Re: Non ASCII-7 characters in URL (article alias)

Post by glimbeek » Tue Oct 27, 2009 12:45 pm

Thank you for your great support infograf768, I installed the plugin and tested it and it seems to be working.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Tue Oct 27, 2009 2:08 pm

In fact, folks, some people WANT utf8 in the slugs.
I have provided a plugin to just do that.

http://extensions.joomla.org/extensions ... /sef/10275

Enjoy!
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

TiMmy19
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Apr 26, 2010 12:47 pm

Re: Non ASCII-7 characters in URL (article alias)

Post by TiMmy19 » Mon Apr 26, 2010 12:53 pm

this code doesnt works or something wrong...

marcgpx
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Nov 18, 2008 5:47 pm

Re: Non ASCII-7 characters in URL (article alias)

Post by marcgpx » Sun Jan 02, 2011 8:43 am

gerilla thank you very much for this useful lang modification.
I use it for my native language
you save a lot of time

User avatar
burek
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Fri Nov 17, 2006 12:20 pm

Re: Non ASCII-7 characters in URL (article alias)

Post by burek » Sat Jul 16, 2011 9:41 am

I know this is an old thread, but still, someone could find this useful.
I've did the same thing for Serbian language (which also had problems converting accented letters).
The code is completely the same as for the Turkish letters, only file names are changed (to reflect the usage) and of course, the accented letters themselves (š, đ, č, ć, ž) => (s, dj, c, c, z).
You do not have the required permissions to view the files attached to this post.

tbarbone
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Sep 01, 2011 1:10 am

Re: Non ASCII-7 characters in URL (article alias)

Post by tbarbone » Thu Sep 01, 2011 1:17 am

Found this forum very useful. Thanks everybody.
thanks,
Tino

zarvan
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Aug 29, 2011 12:55 pm

Re: Non ASCII-7 characters in URL (article alias)

Post by zarvan » Thu Sep 01, 2011 5:24 am

i have a question about it
is it usefull for seo ?

bbb16
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Mar 09, 2012 9:42 am

Re: Non ASCII-7 characters in URL (article alias)

Post by bbb16 » Fri Mar 09, 2012 11:09 am

Hi all!
I tried to make the same thing for Hungarian language but this plugin (as the original -turkish- one) broke the whole site (backend & frontend).
Joomla! 2.5.0 Stable

Any ideas?

thanks
-bbb-

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 18869
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Non ASCII-7 characters in URL (article alias)

Post by infograf768 » Fri Mar 09, 2012 3:59 pm

bbb16 wrote:Hi all!
I tried to make the same thing for Hungarian language but this plugin (as the original -turkish- one) broke the whole site (backend & frontend).
Joomla! 2.5.0 Stable

Any ideas?

thanks
-bbb-
2.5 is totally different.

There is a default transliterate file which does transliterate Turkish as well as Hungarian characters.
If someone wants only specific ascii aliases, a function has to be added in the xx-XX.localise.php of the language folder.

These plugins are useless in 2.5.

If you have a question concerning 2.5, please post in 2.5 forums.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Locked

Return to “Language - Joomla! 1.5”