Topic: Language specific SEF urls

Whats the best way to let FluxBB use a translated url_scheme? E.g. instead of http://fluxbb.org/forums/new/topic/9/ I want to have it like this: http://fluxbb.org/forums/neu/thema/9/

I'm also thinking about packaging localised schemes with the language files.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Language specific SEF urls

Christian wrote:

I'm also thinking about packaging localised schemes with the language files.

It's already planned (at least for the language maintainers that want to do so).

Re: Language specific SEF urls

I see, that there is code which loads the rewrite aliases from the url folder, but the rules are handled in rewrite_rules.php, which is included by default.

If localised url shemes are meant to be selected via the dropdown in the admin panel, rules need to be loaded the same way as the aliases.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Language specific SEF urls

Iirc, it'll be done through extension.

Re: Language specific SEF urls

I wrote an extension a while back that allowed for it.

Re: Language specific SEF urls

I wasn't able to find your extension, Smartys, but I don't understand why this has to be done through an extension. First, half of this feature is already in the core and second, this is something which is useful for all non-english forums.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Language specific SEF urls

I agree with Christian.

It is a must-have for the "internationalization" of FluxBB.

Re: Language specific SEF urls

http://punbb.informer.com/forums/topic/ … alization/

And that is why localization should be an option that forum administrators can choose rather than a requirement.

Re: Language specific SEF urls

So what's the difference between putting this into an official extension and having this feature in the core?

In both cases you'll have to support that localised rules work with the other extensions. (Which shouldn't be a big problem, because extension developers would have to use the aliases for building proper urls anyway)

This would be used for all forums having a non-english audience. It's just consequent to have it in the core and it makes life easier for admins.

Looking from the perspective of a casual admin, I would ask myself why I can download language packs and install them right away, but for using the localised url schemes packaged with the language files, I need to install an extension first. Makes no sense to me.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Language specific SEF urls

Christian wrote:

So what's the difference between putting this into an official extension and having this feature in the core?

One is an extension and another is the core? tongue

Christian wrote:

In both cases you'll have to support that localised rules work with the other extensions. (Which shouldn't be a big problem, because extension developers would have to use the aliases for building proper urls anyway)

Yeah, that shouldn't be an issue at all.

Christian wrote:

Looking from the perspective of a casual admin, I would ask myself why I can download language packs and install them right away, but for using the localised url schemes packaged with the language files, I need to install an extension first. Makes no sense to me.

Because they're a feature that not everyone would want/need to take advantage of? A feature that has no impact on the forum content but is entirely cosmetic? Exactly what the extension system is well suited for?

Re: Language specific SEF urls

I simply don't get why custom SEF urls are core, but localised not.

We are talking about 10 lines of code, which don't affect performance at all, but make the whole feature more consistent.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Language specific SEF urls

I've tried this one several months back, an official extension was the best I could get hmm

Still, Smartys, URL aren't just cosmetic, far from it.

Last edited by Jérémie (2008-09-07 21:47:37)

Re: Language specific SEF urls

Christian wrote:

I simply don't get why custom SEF urls are core, but localised not.

We are talking about 10 lines of code, which don't affect performance at all, but make the whole feature more consistent.

Agreed. Surely full support for localization is key architecture requirements and part of core and if SEF are core it ought to be subject to localization as well.

Re: Language specific SEF urls

Could this be fixed easily by adding a $lang_url language file, then changing the rewrite_rules to something like

$forum_rewrite_rules = array(
    '/^'.$lang_url['topic'].'[\/_-]?([0-9]+).*('.$lang_url['new'].'|'.$lang_url['last'].')[\/_-]?('.$lang_url['post'].'|'.$lang_url['posts'].')?(\.html?|\/)?$/i'                                                    =>    'viewtopic.php?id=$1&action=$2',

and the url schemes to like

$forum_url = array(
    'topic_new_posts'                =>    $lang_url['topic'].'$1'.$lang_url['new'].'-'.$lang_url['posts'].'.html',

That way language packs don't need to deal with the url scheme at all really, just the correct translations of the words?

Re: Language specific SEF urls

Having the whole, full array available for localization is better than translating each word on its own. It allow culture-specific localization, if needed.

It's a little technical yes, but there's only a handful of language maintainers, and they can get help if the stuff is too technical for them. And it's only done once in a while (each time the dev modify the scheme, shouldn't be often).

Re: Language specific SEF urls

Any new URL scheme would require an extension, not just localizations.

A solution would be to allow a second file (File_based_(fancy)_rules.php) with the rules, for that scheme only, in the /include/url directory along with the URL file (File_based_(fancy).php). Then you would change the require() in rewrite.php to include them based on the o_sef configuration variable. An update would also be required to /admin/settings.php around line 595 to stop it displaying the rule files in the dropdown.

This will also stop rewrite.php accepting all the possible URLs (example: /forums/topic-1815-language-specific-sef-urls.html).

Last edited by richardk (2008-09-08 17:45:33)

Re: Language specific SEF urls

That actually sounds like a good idea richardk.

Re: Language specific SEF urls

That's exactly what I said in my second post. hmm

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Language specific SEF urls

Christian wrote:

That's exactly what I said in my second post. hmm

Sorry I've been away for a couple weeks so just read the first post properly and skimmed the rest. Anyway it is a good idea so I think I may write a patch for it and see what the other devs think.

Re: Language specific SEF urls

This should now be possible as of r603.

Re: Language specific SEF urls

sorry i'm newbie

hi i'm download 1.3beta2 from fluxbb.org

and howto upgrade to r603. ? could it ?

beta 2 is not allow Localization of the URL schemes sad


i got http://localhost:81/flux/topic/1/mylang_disappear/


what should i do ?

smile


thanks

this is a thailand hi5 directory a lot of people in thailand playing hi5 include super star. http://www.thaihi5list.com

Re: Language specific SEF urls

i'm trying to  remove utf8_decode
and

$str = strtr($str,....);

i got it work for now  0.0

Last edited by absolutex (2008-10-05 04:36:19)

this is a thailand hi5 directory a lot of people in thailand playing hi5 include super star. http://www.thaihi5list.com