Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-09-24 14:09:55

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Translated (non-ASCII) terms in URLs

There are at least two cases that I’ve found where translated terms show up as part of Textpattern-genereated URLs:

  • <txp:author link="y" /> generates links that end with i.e. /Χρήστης/Μήτσος+Παπαδόπουλος.
  • <txp:comments_invite /> appends to the URL the translated word for comments, i.e. #σχόλιο.

The problems with non-ASCII characters in the URLs have been discussed extensively in these forums. Thankfully, “dirifying” for URL titles, and category and section titles have provided effective remedies for article, category and section URLs, respectfully.

When it comes to <txp:comments_invite />, my opinion is that “#comment” should be appended untranslated to the URL, and the default templates/form shipped with Textpattern should default to <a name="comment"> too.

As for the link to the author’s articles, either the i18n-ascii.txt mechanism could be employed, or (preferably) links could just end with “/author/username”.

Offline

#2 2005-09-24 14:59:49

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Translated (non-ASCII) terms in URLs

Etz Haim wrote:
When it comes to <txp:comments_invite />, my opinion is that “#comment” should be appended untranslated to the URL, and the default templates/form shipped with Textpattern should default to <a name="comment"> too.

I disagree. In my case (french is still readable with ascii-only glyphs) I need to be able to localize it.

And more, imo it’s bad policy to change a basic URL’s portion just like that, because bookmarks and spider bots relies on it. This should be restricted to the very needed/important issues.

Offline

#3 2005-09-24 18:10:38

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: Translated (non-ASCII) terms in URLs

Would you disagree to add an option to change the <txp:comments_invite /> to append to the URL whatever the individual webmaster considers fit for his cause? Or would you suggest something different?

Last edited by Etz Haim (2005-09-24 18:18:26)

Offline

#4 2005-09-24 20:03:48

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Translated (non-ASCII) terms in URLs

That would be nicer for everyone, yes.

Offline

#5 2005-09-26 22:47:18

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: Translated (non-ASCII) terms in URLs

“Category” also appears translated in URLs.

Offline

#6 2005-10-08 12:29:46

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: Translated (non-ASCII) terms in URLs

I’ve produced a patched version of TXP where substituting urlencode() with dumbDown() in certain places in publish.php, taghandlers.php and txplib_misc.php has made it possible to dirify the translated words for “category”, “author”, “comment” etc. when they appear in URLs.

However, I did not submit a patch for it as it would:

  • fail to work for alphabets not included in i18n-ascii.txt, e.g. chinese, and
  • it would affect backwards combatibility.

Therefore, as a first step, I propose for every translation to include the following strings:

  • section_ascii
  • category_ascii
  • author_ascii
  • comment_ascii

Then an option in the admin interface to extend dirifying to these kind of URLs could be added, with publish.php, taghandlers.php and txplib_misc.php modified accordingly.

Offline

Board footer

Powered by FluxBB