New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some improvements #14
Conversation
… matched by cookie reference.
Hi Vlad, thanks for improving the extension. I haven't found the time to implement some of the older pull requests and kind of forgot those. I'll have the time to got through my list of extensions in february, but I can add you as an collaborator to the repo right now if you want to. Regards Am 31.01.2012 um 12:32 schrieb Vlad Ghita:
|
No prob, just keep up the good work.
This could be an idea, but you should review & agree with the changes I made. This time they're quite radical ;) |
I like the changes :-) What do you think? |
Ah, and the extension should be renamed then. There is no redirect anymore. Maybe "Frontend Languages" or similar? But this will break with many existing extensions that require the language redirect. |
Heheh. I wouldn't worry too much about breaking dependencies, I'm sure we could all bang heads together to find a way of ensuring legacy support until those extensions are also updated. I'll do some reading through this extension a little more and see what I can think of. |
You've also reminded me I need to write a tutorial for using the URL rRouter correctly. |
I'm currently working on it... Will push something later today. |
Well, not on the tTutorial ;-) |
Well, this is there for the developers working on localhost. In this case the
What about merging current changes and let them live like this for Sym 2.2.x and starting with Symphony 2.3 rename the extension to I recommend postponing this until S2.3 because there are lots of changes to be done, especially in all my extensions (they all depend on language info retrieved from Frontend Localisation). With S2.3 I will have to edit them all (there are some breaking changes) and I'll update the Language references as well.
Hmm ... And the first rule in the URL Router rules should be this one?
This feels a bit incomplete. It doesn't allow these cases:
|
To wait for the renaming for S2.3 sounds good. I thought about appending example URL Router and |
We need to look at those rules, as also there seems to be an issue with query strings in the Router itself. I'm thinking about it at the moment... I would suggest a rule like:
Also, the plan is to get @nils-werner to finish his pages branch to remove the rules from Preferences to a separate page, so we could look for the existence of this page and append a 'Languages Redirects' section to it? Just an idea... |
This is a very good idea. .htaccess rules should be preserved for anyone who wants them. Here's a use case: Say you want to localise the Page Titles and Handles. Page LHandles extension deals with this: _1. .htaccess rules manipulate the URL If language is determined by URL Router, this will happen: _1. URL Router determines language ( Let's bring @designermonkey here. John, your opinion is most welcome in this one. Edit: Uhh, you're here :) P.S. Why did you said that |
Yep. I wouldn't want to drop support for |
Duhh ... Why shouldn't these rules
live in Language Redirect directly? + some logic change here and voila! This way, EDIT: Here's the fixed rule. With this we can extract the language and solve it:
new url is AFAIK: standard is language = lower case; region = upper case |
I don't want to hardcode the regexes anywhere anymor I think. So the developer has the control about the URL scheme again. |
Talking of URL schemes, I've been reading about that today... It's best practice to put the language code at the beginning of the URL like you have been doing. I reckon we should at least still advocate that behaviour, even if it's not hardcoded. |
Agree. This is where the example rules will come in handy. |
Symphony 2.3 is around the corner. How are we dealing with this? 1. Take note that as @designermonkey mentioned before
we should help the frontend developer in setting up the links. The recommended way to setup a multilingual site is (using gTLDS):
2. Regarding .htaccess rules, @klaftertief said
@see my comment above. The rules should stay in my opinion. Let this extension use .htacces rules and URLs as stated above. If someone has an outstanding requirement for another way of language identification (eg www.site.com/?lang=XX), then writing an extension for that particular case is trivial and very easy to integrate with Frontend Localisation. 3. What this extension should do: - offer a way to input desired frontend languages (exists) - select a reference language (Frontend Localisation does this atm = not a good thing) - I think this extension could properly be renamed to `frontend_languages` I can deal with implementing this stuff. What do you think? |
Update: Forget about this post. Read next one. Here's Frontend Languages. It respects the bullets from point 3 in previous post.< I'll integrate it with Frontend Localisation and proceed. Until Language Redirect is updated to Symphony 2.3, I'll remove it from supported Language drivers in Frontend Localisation. |
Last night a new idea struck me and here's the result: Frontend Localisation deals with Frontend language management (adding language codes in Backend and selecting main language of the site). The frontend language information is sent by third-party extensions. It must receive 2 GET parameters: One extension the implements the routing logic is FLang detection gTLDs (I just created it). It implements slighlty modified .htaccess rules of language redirect. This way, the Frontend Language information sits in one place (Frontend Localisation) and everybody is free to chose a way to implement the URL structure as long as behind the scenes the GET params are received for processing. What do you think? |
Thanks again for thinking and working hard on this one. And sorry again for slow answers. I don't have a strong opinion at the moment. Maybe it really is time to hand the extension over to you, because you are building extensions on top of it. I only used the old language field and the multilingual field with it. I'll have some thinking and extension-updating time at the weekend. So you can expect a mor detailed answer then. |
No prob. I was expressing the ideas loud because these decisions will impact the future really hard and I wanted at least someone else's opinion in this matter.
Well, I'm building for some time now and that's why I needed some solid ground => Frontend Localisation :) In current state of things, there is no need of Language Redirect any longer since the needed functionality (language detection and language management) are handled separately in dedicated places. Here's how I see it atm. Can you drop your 2 cents please? |
I couldn't install the extension to have a look at them. I like the idea that the Frontend Localisation doesn't care where the language information comes from. It gives you the freedom to set the parameters the way you like, e.g. via What I generally don't like are your sometimes cryptic naming conventions :-) But maybe that's just me. What I didn't like in the Language Redirect changes in this pull request is the following:
The automatic redirect took care of this. But I think that's just a question of the implementation and not a desgn choice. Is it? (Maybe we should discuss further somewhere else. Though the multilingual stuff is not my main building lot at the moment.) |
Indeed. Frontend Localisation should provide these ways, but I'll implement them when are needed. ATM, I didn't see any request in multilingual related threads for something specific (except the brief ideas from this discussion = URL Router)
Yeah, well, it's a battle between conciseness and explicitness :) It seems I'm changing sides on-the-fly.
Well, this pull request is ancient history at this moment since the main ideas from it have been split between (Frontend Localisation) & (FLang detection gTLDs). The important thing now is you to decide what to do with Language Redirect, if there is still need for it. The language management and a language detection mechanism are taken care of in other places. Language redirection must remain here. |
About redirect:
I noticed a performance hit on my site: www.xanderadvertising.com with the previous version of Language Redirect. The redirect requires the Symphony Engine to initialize and execute the Events attached to a Page before the effective redirect takes place. Adding this to some other factors, there was a penalty of at least 2-3 seconds in page load time.
The changes in this commit will remove the redirection mechanism and instead detect the language as follows (if not found at current point, proceed to next point):
This will comply very well with Search Engines who will index only
www.xanderadvertising.com
instead ofwww.xanderadvertising.com/ro/
orwww.xanderadvertising.com/en/
.