HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to change special characters in Pretty URL's?

Hi,

At first, i am not good at English and sorry for possible grammar faults.

In Turkish, we have some special characters like ğ, ş, ç etc. and Vanilla does not convert them g, s, c in URL's. It uses them as they are.

I have read oldest topics about it, but could not find any clear solution. Could you help me, please?

Thanks.

Answers

  • R_JR_J Ex-Fanboy Munich Moderator

    Well, if I try it in my forum with "In Turkish, we have some special characters like ğ, ş, ç etc. and Vanilla does not convert them" I get the following title: /discussion/108/in-turkish-we-have-some-special-characters-like-g-ş-c-etc-and-vanilla-does-not-convert-them/p1?new=1

    As you can see, some of those characters are converted: ğ and ç, but not ş. You need to change a core file in Vanilla, which I normally do not suggest. Do this:

    1. Open /library/core/class.format.php
    2. Search for a line beginning with protected static $_UrlTranslations (should be line 1593)
    3. It ends with 'ї' => 'yi']; make that 'ї' => 'yi', 'ş' => 's'];

    If you find more letters which are not substituted, do the same with them.


    It would be great if you can make pull requests for that on the GitHub repo. 😉


    paopevil2
  • imyusyilimyusyil New
    edited April 2020

    Thanks @R_J ,

    But I had tried it with adding categories in dashboard and it is valid for ğ, ç and all other special characters. Normally, all forum softwares I used converted them. I think, there should be an option in settings to convert unicode aliases to English ones like in Joomla.

    Also, I have tried to add a pull request for that on GitHub, but "Create pull request" button was not active. So, I failed in this subject.

  • R_JR_J Ex-Fanboy Munich Moderator

    Maybe I did not understand you, sorry. Where do you want to change the letters? In "example.com/categories/şomeçinğ"?

    That's very easy. Go to the dashboard and edit the category. The second line in the list showing for a category reads "Category Url:" and you can edit it, which is quite flexible. You could change e.g. "/categories/möhre" to "/categories/karotte" (just some silly German Umlaut example)


  • imyusyilimyusyil New
    edited April 2020

    I am sorry about my poor English @R_J . I have just wanted to explain that it is valid for all URL's. I saw the editable area in category settings and changed them manually, thanks.

    It would be great if there was an option for all URL's to convert unicode aliases to English. For example, Joomla has an option like this and you can activate it whenever you want.

    I have tried to add a pull request on GitHub again, but still the create button seems inactive. And I could not understand how to send a pull request for it. Also, I am not sure if I can explain it correctly to everyone in GitHub with my English 😅

    Is there any plan about coding a offical plugin for polls? If I can, I will send a pull request for it, too.

Sign In or Register to comment.