Topic: [1.3] New PHP URL rewrite system: localization

A little feature request on the new rewrite system (and by the way, thanks for it... it should be much more robust on various platform for a number of people?including me, I was never able to fully debug the old one with Apache 1.3 and/or mod_ort).

Would it be possible to have the rewrite_rules.php file tied to the main language of the forum, and included in the (future) language pack?

That would:

- help non geek and newcomers, as they don't have to take the extra step after installing the lang pack (replacing the rewrite_rules.php by a new one, or worst, translate it themselves)
- ensure some consistency across forums sharing the same language
- ensure a good localization
- diminish issues with upgrades (as the major lang pack would be updated as soon as PunBB's core is updated)

But, to keep it neat and clean, an Admin option to use a custom rewrite_rules.php file in the backend would be nice (again, to keep the core native file untouched).

Re: [1.3] New PHP URL rewrite system: localization

I guess language packs could always come with an extension that replaces the rewrite rules if needed. Localization could break older links if changed by, say, a language pack update though.

Re: [1.3] New PHP URL rewrite system: localization

Currently, the rewrite rules are not locale specific. If someone wanted to make rewrite rules that are, that would be an extension. The only situation I can envision under which someone would want locale specific rules would be if they're running a forum using only a language that's not English (otherwise, you would have URLs that don't make sense to some of the people on the board). However, as Bekko said, tying rewrite rules to language packs would break old links when a language pack is changed.
I guess I'm just really not seeing why localized rewrite rules are something PunBB should support out of the box tongue

Re: [1.3] New PHP URL rewrite system: localization

Well, URL are part of a software/website. If one localizes the website, one would also localizes the URL. It seems quite logical to me... I know I would, and in fact I will.

As for breaking links of course, that's the responsibility of the localization team to get it right the first time (post beta and RC). But I don't see why a locale should change in that area, unless it also changes in English.

Re: [1.3] New PHP URL rewrite system: localization

The problem with that is that in rewrite.php, we have yet to log the user in, so we have no idea what language to use. There's also the issue of users running different languages pasting links (they won't work for anyone using a different language).

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [1.3] New PHP URL rewrite system: localization

Ok; just thinking out loud here:

- first scenario: a PunBB install has only one (non English) language installed. In that case it's simple, PunBB knows it has to use the German (for example) lang pack, and it uses the German rewrite scheme.

- second scenario: a PunBB install has multiple languages. Either use the English (aka international) rewrite scheme (simpler to code, I think) or allow the admin to select which rewrite scheme he wants to use (slightly more complex, but better for example is someone has an Italian & German forum... English would have no meaning there).

In any case, there would be only one scheme running (allowing multiple scheme would lead to huge complex system to avoid content redundancy), but that's ok I think. True multiple languages forum are, on top of that, quite rare from my experience.

Re: [1.3] New PHP URL rewrite system: localization

It still won't work. I doubt a link full of special characters, which are translated to their ASCII/UTF-8 values, is clearer than obvious english words.

Re: [1.3] New PHP URL rewrite system: localization

elbekko wrote:

It still won't work. I doubt a link full of special characters, which are translated to their ASCII/UTF-8 values, is clearer than obvious english words.

Hence the localization word I was using, instead of translation.

A lot of language are understandable when romanized into URL's ASCII (Spanish, Portuguese, French, Italian, German, Wallon, probably Polish, and a lot more I don't know), of course that's what need to be done.

Re: [1.3] New PHP URL rewrite system: localization

Although I like the idea of using the default language as a basis for which rewrite rules to use, there is another issue to consider. Extensions can modify and extend the rewrite scheme. However, if a forum was running a non-English rewrite scheme, any extension that tries to modify the rules is likely to fail.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

10 (edited by Jérémie 2008-01-02 09:02)

Re: [1.3] New PHP URL rewrite system: localization

Extension writers would have to internationalize their plugin anyway, wouldn't they? Or more exactly, they either would (and in that case, if they can account for specific lang string, I think they can account for specific localized clean URL string... they are all strings after all) or wouldn't in the first place (and in that case, it doesn't really matter).

I understand this is a little more work, and you want to get 1.3 out of your system right now, but as a forum user and/or a forum owner, how would you feel if the punbb.org URL where in Euskara, or Chinese? See what I mean?

Beside, even if it's not a PunBB core capability, I believe a lot of non English forum owner will edit their rewrite file to localize them (it doesn't require any PHP skill), and some lang pack author would provide them anyway. So if that would break extension because it was not planned from the start, well, they will break for some people anyway sad

Re: [1.3] New PHP URL rewrite system: localization

Tell you what, I'll bring it up with the other guys on the dev team.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [1.3] New PHP URL rewrite system: localization

We've discussed this and here's what I think we'll do. The localization of URL's is still a very rare phenomenon and we're not so sure it's something people would want. Instead, we'll provide a simple extension that loads any set of localized rules (if available).

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: [1.3] New PHP URL rewrite system: localization

Rickard wrote:

We've discussed this and here's what I think we'll do. The localization of URL's is still a very rare phenomenon and we're not so sure it's something people would want.

Textpattern and Mediawiki have it in core, to name just two software I use frequently; I'm sure there are a lot other ones.

Instead, we'll provide a simple extension that loads any set of localized rules (if available).

Seems perfect. Thanks.

14

Re: [1.3] New PHP URL rewrite system: localization

So much & even all need the Location url rewrite!
Why you don't do it in core,and just txp do.
I'm chinese using forum.

Re: [1.3] New PHP URL rewrite system: localization

Because it should be the administrator's choice, not the language pack author's. Offering that choice via an extension is simpler than putting in yet another feature, especially when that feature is not necessarily going to be useful for many forums.

16 (edited by Jérémie 2008-01-19 01:06)

Re: [1.3] New PHP URL rewrite system: localization

Extension also offer much more flexibility, and less overhead for for core dev team, less support.

I disagree with Rickard on the need and importance of such a feature (and a few other, such as multigroup), however having a semi-official extenstion doing it is quite ok if there's a good tool to deploy, manage, and update extenstion on PunBB (I don't want to have to do it by hand on several multiple install, like TXP, it's a time eater). I'm pretty sure such a tool won't be here at 1.3, so it give us something to bother them about for 1.3.1 tongue

17

Re: [1.3] New PHP URL rewrite system: localization

Just as the 1.2 of punbb,
Extentions or plugins can not gave support to that "rewrite" feature.

For many years I'm using a not perfect rewrite system for my own language.

Re: [1.3] New PHP URL rewrite system: localization

I'm not sure what you're trying to say wink

19 (edited by qie 2008-01-19 05:19)

Re: [1.3] New PHP URL rewrite system: localization

my forum now using a rewrite script from punres. it's not so good,for it convert the chinese word to  "#($*(#*$" eg:

but it should be

i suggested punbb 1.3 version will solve it.

oh,your page can not encoded my words to excactly chinese words smile

20 (edited by Solovey 2008-01-19 06:42)

Re: [1.3] New PHP URL rewrite system: localization

Please just make the English, we can localize it ourselves, eventually everyone can share the rules.