jobl Posted March 25, 2015 Share Posted March 25, 2015 I just pushed my first module to github: https://github.com/jobl/LanguageRedirectToDefault It's basically a redirect to the default language if the user hits a inactive localized link wich normally throws a 404. If the page isn't viewable in the default language it does nothing and let pw handle the request (throws a 404). Some questions on my mind: - Is the naming right? - Is there a better method to check for installed languages? Any input is welcome. Have a nice day - jobl Link to comment Share on other sites More sharing options...
LostKobrakai Posted March 25, 2015 Share Posted March 25, 2015 About your two questions. I think that's all right there. Just note for potential users how this is supposed to work. E.g. it won't work for users not using localised urls (not sure if i would serve an 404 error there in the first place). Also it won't work for a language named "german", which will have a localised url like this www.example.com/de/… or this www.example.de/… . Link to comment Share on other sites More sharing options...
jobl Posted March 25, 2015 Author Share Posted March 25, 2015 About your two questions. I think that's all right there. Just note for potential users how this is supposed to work. E.g. it won't work for users not using localised urls (not sure if i would serve an 404 error there in the first place). Also it won't work for a language named "german", which will have a localised url like this www.example.com/de/… or this www.example.de/… . Thanks, i'll update the module description according to your suggestions. This module will only work if you installed the LanguageSupport module and let pw handle the urls on a per page basis. Maybe i should make it required. Please correct me if i'm wrong but the API says it's using the "name" variable to generate the url e.g. a language wich has the name german will produce a localized url like /german/yourpageingerman Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now