-
Notifications
You must be signed in to change notification settings - Fork 207
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
Support different language on CMS URL Path segment #1557
Comments
hi @apychan, i just googled very quickly what valid url chars are: https://stackoverflow.com/a/7109208 So i guess this is the reason why this very rare scenario. Am i wrong? |
Hi @nadar |
Okay, i think it does not hurt to allow other chars, its still a user decision what to use. Well then i am going to change the usage of the slug directive a bit. Thanks for the report anyhow! (Seems like you are speaking Japanese, maybe help translate luya 😄 ?) |
Well, i enabled the usage of unicode chars, but now the yii\helpers\Inflector::slug() returns and stores I assume this is a similar discussion: yiisoft/yii2#10061 |
@nadar I can help you to translate, I try to finish before 12/12 and how about this? It is a simple function. How about add a checkbox after aliases field to choose between standard slug function(translated) or SEO slug(only filtered all url and luya not accepted symbol) |
@apychan translating would be awesome, i just saw your fork. please make sure to create a clean branch in order to make pull requests and not using the "master" branch. Well i fixed the problem already on client side (angular) you can try by checking out the dev-master (https://luya.io/guide/install-problems#require-the-dev-master). Its now a problem from http://www.yiiframework.com/doc-2.0/yii-helpers-baseinflector.html#slug()-detail which is validating the slug on server side but converting then the chars due to transliteration method http://www.yiiframework.com/doc-2.0/yii-helpers-baseinflector.html#transliterate()-detail i tryed to changed the transliteration settings of the inflector class but it seems not to work (see related issue from above), but i will find a solution. |
I'll extend the yii helper base inflector as a luya helper and provide a fourth parameter to the original slug function which will give the option to prevent the use of the yii/intl transliterate function. Additionally I'll provide a unit test which will prove the correct transformation (trim, lowercase, etc.) of the original slug function despite the skipped transliteration. |
Sounds good to me: luya\helpers\Inflector and then replace the slug() method inside the cms model NavItem. |
…S URLs. This will close luyadev#1557
@apychan Thanks again for your input! We've successfully implemented a way to handle non transliterated URL strings and you can now use the feature in the current dev version. |
For best SEO, I suggest CMS URL Path segment not only accept English alphabets and '-', also accept other language alphabets and maintain accept '-' symbol only.
For example, we have a page call 'new' in English, URL will be http://test.com/en/new
and we also have Japanese version, so the page call '新', URL can be http://test.com/jp/新
But I facing now is if I type non English alphabets and '-', the URL Path segment will auto reject those inputs.
But if I directly change alias field in database, front end still works and can be use other language alphabets
The text was updated successfully, but these errors were encountered: