Removing the concept of "slugs" for some languages


(cpradio) #11

Probably not, as I’d venture to guess he has zero to little programming knowledge. Discourse is getting a lot more CM (Community Manager) attraction now and a lot of those who are engaging here on Meta are no longer devs/programmers, but the CMs. To ask a CM to submit a PR is just unrealistic.

Just for clarification, there is a big difference between changing CSS/SCSS and actual programming changes. I have no idea what @Qasem_h’s experience is, but I definitely see more CMs participating in Meta than what were here several months ago.


#12

i don’t mean i cant send pull request i mean how i can send pull request for slugs


(Jeff Atwood) #13

I think we should add this for 1.4.


(Erick Guan) #14

I am working on it. Maybe I can submit the pr in next 24h.

It depends on your judgement about the release date. So it’s your call to consider whether merge it or not. I hope it can catch up 1.3 personally.

EDIT:

Here it is.
https://github.com/discourse/discourse/pull/3370


German umlauts are NOT handled correct for Badges
#15

@fantasticfears can you give some screen shot of your work ?


(Erick Guan) #16

Sure.

Settings:

For topics:

english

encoded

default

For categories:

encoded

default


Importing from phpBB3
Importing from vBulletin 4
Importing mailing lists (mbox, Listserv, emails, ...)
How to add a new language
(Kane York) #17

I don’t think that the “default” option is very useful - call it “none” instead.


(Gerhard Schlager) #18

Would it be possible to rename the English method to Latin, ASCII or something like that? English is somehow misleading…


(Jeff Atwood) #19

@fantasticfears this looks great but I agree with @gerhard, name it “ASCII” instead.


(Erick Guan) #20

Updated, just renamed english to ascii. Thanks @gerhard!


(Sam Saffron) #21

I think we are done with this, closing, thanks @fantasticfears


(Sam Saffron) #22

(Sam Saffron) #23

(Sam Saffron) #24

@fantasticfears I am reopening this cause this needs urgent polish (in fact make this your #1 priority)

Issues I have:

  • If a topic has the test งಠಠง and slug generation method is “encoded” the slug is test-งಠಠง. This is a nasty problem cause the actual UI will cause a fight with the browser. The browser sends over the slug as test-%E0%B8%87%E0%B2%A0%E0%B2%A0%E0%B8%87 and we perform no decoding on our side which leads to an infinite redirect in the topic page, if you hit reload. It feels to me like “encoded” should be always percent encoded.

  • If you change slug generation method there is no way of “fixing” the slug cache in “topics” table. There needs to be some mechanism of clearing out the “slug” column on topics. Maybe if you touch that setting it should automatically null out all cached slugs on topic.

As it stands we are seeing some extreme issues here with infinite redirects and there is not clean way of correcting the customer issues.


සිංහල දෙමල සිංහල slug for Unicode?
(Erick Guan) #25

OK, I’ve researched into Rails router, Rack and Webrick. According to previous dev discussion, I am sure Rails conforms to Rack behaviour. This might not be ideal for us. Though I didn’t check, I have some confidence to say that Puma and Unicorn don’t escape non-ascii for URI. In contrast, Webrick does conforms to this point but it pins the uri into US_ASCII. It would be a complicated debug process to hunt down the cause. It might be regexp failure, encoding problem for Rails router GTG.

My step would be:

  1. Escape our Slug detector fast to fix urgent problem.
  2. Find a place to report this problem or write PR. I am not familiar with Rails community. I would like to ask for your direction later.

(Sam Saffron) #26

Sure, but we also need to make sure we deal with history AND switching slug generation mechanisms. Both are critical we deal with. When you switch mechanisms on categories it is particularly complicated cause we allow overrides.


(Sam Saffron) #27

I think this is all working properly now that we upgraded to rails 5 ? @tgxworld ?


(Alan Tan) #29

Yup, we just had to teach people how to “re-cook” all the slugs

I think only this is left. We had a number of support request coming in asking us how to “re-cook” the slug.


(Alan Tan) #31

Fixed in


(Sam Saffron) #32