Skip to content
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

Language Fallback for non-ascii languages #153

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

CDRO
Copy link

@CDRO CDRO commented May 3, 2016

When using japanese or chinese (or any non-ascii supporting language), realurl will simply encode the page names to the request query.

This is quite annoying, since this will never work (this is known since some years now). There used to be an option called languageExceptionUids, but it doesn't exist anymore, so I built it again.

What has to be done to work properly is that you have to add this to the pagePath Configuration part:

'languageFallback' => [
    '6' => 1,
    '7' => 1,
],

@ukemi-26
Copy link

If I'm logged in into the backend, it works else not ...

@dmitryd
Copy link
Owner

dmitryd commented Jun 20, 2016

The plan is to bring back languageExceptionUids. The pull request is not clean and cannot be merged.

@CDRO
Copy link
Author

CDRO commented Jun 20, 2016

@dmitryd What do you mean by "the request is not clean"?

@dmitryd
Copy link
Owner

dmitryd commented Jun 20, 2016

@crdo Check the diff. Why does it modify ext_localconf.php?

@CDRO
Copy link
Author

CDRO commented Jun 20, 2016

This should indeed not happen, I think this is due to a local conflict.

I'll try to fix this now and make another pull request.

@CDRO
Copy link
Author

CDRO commented Jun 20, 2016

This looks better now, what do you think?

@dmitryd
Copy link
Owner

dmitryd commented Jun 20, 2016

No, it doesn't :( I think you work with old sources. Please, see how ext_localconf.php looks like now: https://github.com/dmitryd/typo3-realurl/blob/development/ext_localconf.php

Please, update your copy before making a pull request to use latest file versions.

@CDRO
Copy link
Author

CDRO commented Jun 20, 2016

Ok, now I get what I got wrong, I thought I'd revmoed them by mistake but you took care of this (sorry for the burden).

So ext_localconf.php is now in the newest version, so no conflict possible there now.

@dmitryd
Copy link
Owner

dmitryd commented Jun 20, 2016

I'll do some more work on this later because there are other places where this has to be implemented.

@rvock
Copy link
Contributor

rvock commented Jul 14, 2016

You could also improve the Utility::convertToSafeString method. If it would transliterate the string, there would be a nicer URL.

You could either use the utf8_romanize method from dokuwiki: https://github.com/splitbrain/dokuwiki/blob/master/inc/utf8.php

Or you could use the Transliterator class from PHP (if it exists):

if (class_exists('Transliterator')) {
    $translit = \Transliterator::create('Any-Lower; Any-Latin; Latin-ASCII;');
    $processedTitle = $translit->transliterate($processedTitle);
}
Original After transliterate()
test with ßpace Änd Umlaüts test with sspace and umlauts
自由的百科全书 zi you de bai ke quan shu
ウィキペディア u~ikipedia

@dmitryd
Copy link
Owner

dmitryd commented Jul 14, 2016

@rvock This should be a separate pull request and it should be carefully evaluated because it may break compatibility.

@mbrodala
Copy link
Contributor

mbrodala commented Mar 9, 2017

@CDRO languageExceptionUids is back by now but I think this PR still has value since currently it's always sys_language_uid=0 that's used for these exceptions. Being able to specify better fallbacks would be highly useful.

Imagine for example a site where German is the default language, English the 2nd language and Japanese the 3rd language. If you set languageExceptionUids accordingly, you'll get German URLs in Japanese whereas English would be a better option.

@CDRO
Copy link
Author

CDRO commented Mar 9, 2017

@mbrodala I think you're right, this feature would be really great to have in this kind of situation.

I'll have a look at the current source code and propose a new MR in some weeks in order to cover this scenario.

@dmitryd
Copy link
Owner

dmitryd commented Mar 9, 2017

@rvock I think we do not need a transliterator that translate asian letters. As far as I see, people prefer to have them in urls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants