Cyr-to-Lat in URLs #1645

Closed
opened 2026-02-05 01:29:58 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @rockenren on GitHub (Apr 12, 2020).

Describe the feature you'd like
Add feature to convert cyrillic URLs to latin. Something lilke "водка -> vodka".
Or add feature to turn off "pretty urls" completely.

Describe the benefits this feature would bring to BookStack users
For now any cyrillic URLs in BookStack are Punycode URLs, so they are not human-readable (only readable in browser address bar) and VERY long (we forced to use url shortener just to share a link).

Additional context
For example, url https://domain/books/%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%86%D0%B8%D0%B8/page/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D0%B0%D1%8F-%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F can be converted to https://domain/books/instrukcii/page/osnovnaya-informacia or https://domain/books/book_id/page/page_id in case of turning off pretty urls.

Originally created by @rockenren on GitHub (Apr 12, 2020). **Describe the feature you'd like** Add feature to convert cyrillic URLs to latin. Something lilke "водка -> vodka". Or add feature to turn off "pretty urls" completely. **Describe the benefits this feature would bring to BookStack users** For now any cyrillic URLs in BookStack are Punycode URLs, so they are not human-readable (only readable in browser address bar) and VERY long (we forced to use url shortener just to share a link). **Additional context** For example, url https://domain/books/%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%86%D0%B8%D0%B8/page/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D0%B0%D1%8F-%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F can be converted to https://domain/books/instrukcii/page/osnovnaya-informacia or https://domain/books/book_id/page/page_id in case of turning off pretty urls.
OVERLORD added the 🛠️ Enhancement🏭 Back-End💆 UX labels 2026-02-05 01:29:58 +03:00
Author
Owner

@Statium commented on GitHub (Apr 13, 2020):

I agree completely. We are faced with the same problem, I would like to see a function to disable this type of URL.

@Statium commented on GitHub (Apr 13, 2020): I agree completely. We are faced with the same problem, I would like to see a function to disable this type of URL.
Author
Owner

@kudja commented on GitHub (Apr 14, 2020):

Agree, in my opinion transliteration + editable slugs for all content types (books, shielfs, chapters, pages) is quite a good solution here

@kudja commented on GitHub (Apr 14, 2020): Agree, in my opinion transliteration + editable slugs for all content types (books, shielfs, chapters, pages) is quite a good solution here
Author
Owner

@drzippie commented on GitHub (Jun 25, 2020):

Added Illuminate\Support\Str::slug to generate slug from text to improve the creation of slugs with non-English characters with a pull request

before:

name = "¿ De qué color son los paños calientes ?"
slug  = "¿-de-qué-color-son-los-paños-calientes-"
encoded_slug = "%C2%BF-de-qu%C3%A9-color-son-los-pa%C3%B1os-calientes-"
name = "основная-информация"
slug="основная-информация"
encoded_url = "%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D0%B0%D1%8F-%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F"

After ( with Str::slug() )

name = "¿ De qué color son los paños calientes ?"
slug  = "de-que-color-son-los-panos-calientes"
encoded_slug = "de-que-color-son-los-panos-calientes"
name = "основная-информация"
slug="osnovnaya-informatsiya"
encoded_slug = "osnovnaya-informatsiya"
@drzippie commented on GitHub (Jun 25, 2020): Added Illuminate\Support\Str::slug to generate slug from text to improve the creation of slugs with non-English characters with a pull request **before:** ``` name = "¿ De qué color son los paños calientes ?" slug = "¿-de-qué-color-son-los-paños-calientes-" encoded_slug = "%C2%BF-de-qu%C3%A9-color-son-los-pa%C3%B1os-calientes-" ``` ``` name = "основная-информация" slug="основная-информация" encoded_url = "%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D0%B0%D1%8F-%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F" ``` **After ( with Str::slug() )** ``` name = "¿ De qué color son los paños calientes ?" slug = "de-que-color-son-los-panos-calientes" encoded_slug = "de-que-color-son-los-panos-calientes" ``` ``` name = "основная-информация" slug="osnovnaya-informatsiya" encoded_slug = "osnovnaya-informatsiya" ```
Author
Owner

@ssddanbrown commented on GitHub (Jun 27, 2020):

Thanks to @drzippie this will be part of the next feature release. Note that, for existing URL slugs, they will remain the same until there's a change to that shelf/book/chapter/page's name.

@ssddanbrown commented on GitHub (Jun 27, 2020): Thanks to @drzippie this will be part of the next feature release. Note that, for existing URL slugs, they will remain the same until there's a change to that shelf/book/chapter/page's name.
Author
Owner

@rockenren commented on GitHub (Jun 27, 2020):

Got it, thank you all.

@rockenren commented on GitHub (Jun 27, 2020): Got it, thank you all.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1645