-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
LaravelLocalization::getLocalizedURL issues! #47
Comments
My bad, I dug deeper into the code and looks like the correct way to generate links is as follows:
|
However shouldn't the getLocalizedURL() function return a url with no language code for the default language if the 'hideDefaultLanguageInRoute' in config is set to TRUE? I think it makes more sense than redirecting from a localized url to a non-localized for the default language. |
Your right. I'll create a fix and pull-request shortly. |
Also, you're initial issue is valid. I'll alter the function to deal with paths. |
#49 should fix your issues. |
@nikosv the fixes for this issue have been merged up in to the master branch. Can you confirm if your issue is resolved or not? |
@drewjw81 First of all some changes must be made to languagebar.blade.php which is still using
What is more getLocalizedUrl works great for 'hideDefaultLanguageInRoute' => false but behaviour doesn't seem to change for 'hideDefaultLanguageInRoute' => true. Moreover, even though it is not that important, it would be better if someone could just do
instead of
while it makes sense as it is for the home route. |
I'll take a look at these tomorrow. On Tue, Jan 21, 2014 at 10:19 PM, nikosv notifications@github.com wrote:
|
Fixed the issues mentioned above in #55 Staring work on suggested getLocalizedUrl changes. |
All the above issues including one new one I discovered should be solved in v0.10.1 coming in pull request #55 |
@nikosv can you confirm if all the issues related to this are completed now? If so please close off the ticket. |
There is still the issue related to
which produces links with twice the locale in the url like so as i have described in #55 |
Pull request #76 should finally fix this issue. |
Branch is merged as of yesterday. Please re-test and close this issue if we're good to go. |
@drewjw81 i am afraid we still have a problem with
which doesn't seem to work properly. |
What is the result? |
it produces a url with a slash in the end like |
Thanks for catching that. I should always be stripping the trailing slashes. #77 fixes this and one more minor issue. |
i am not sure if this is due to the same issue but there where also problems in my vhost
instead of "laravel.dev/contact" returns just "contact" |
That is by design, for localizing relative URLs. If you want "http://laravel.dev/contact/en" you'll need to pass "http://laravel.dev/contact". LaravelLocalization::LocalizeURL('/contact') will return "/contact/en" |
Or |
ok... i guess everything looks good ... i am closing the issue. |
@drewjw81
seems to localize the current url instead of the home url for the default language with the language prefix hidden. |
I'll take a look at this tomorrow and issue a fix. Time to finish off the test suite for this as well. On Sat, Feb 22, 2014 at 6:53 PM, nikosv notifications@github.com wrote:
|
@nikosv I'm not able to replicate this. Can you give any more detail? I've tried with hideDefaultLocaleInURL true and false and with Laravel public as the root or in a subfolder. |
Now i am not able to replicate it either... so i guess it was my mistake... |
Hello,
I am having some issues with this function which i am not sure if it is a bug or i am missing something. Probably there is something i am missing.
I am trying to use this function to build localized urls for my app like so:
The above example doen't work when in my '/' route. However a similar implementation works perfectly in other routes.
What is more i cannot generate localized urls for my '/' route while trying the following.
The text was updated successfully, but these errors were encountered: