toollabs / relgen

Wikimedia OTRS release generator
https://tools.wmflabs.org/relgen
Other
12 stars 9 forks source link

The "name, copyright holder and authority" input column can only accept Latin characters #9

Closed Taiwania closed 7 years ago

Taiwania commented 7 years ago

@FDMS, the "name, copyright holder and authority" input column I tested are not accept any other languages but only Latin characters. Because non-Latin multilingual characters (like CJK) are appeared, could you fix them to accept the multilingual characters? Thanks.

Artoria2e5 commented 7 years ago

The blame goes to all these \w stuff in JS Regex: https://github.com/toollabs/relgen/blob/master/express.php#L46

Maybe use Unicode's regex translator to do some \p{L}\p{Nd}_? Or just grab some XRegExp from npm and make some fancy browser packing magic...

Artoria2e5 commented 7 years ago

Um well, these are defined locally for each PHP file. I might still prefer some refactoring to de-duplicate the regexes though.

By the way I wonder if we can make a translation for the express version...

FDMS commented 7 years ago

Will look into these suggestions (and also ping @zhuyifei1999). Re translating the express version be aware that even the English express version is quite rarely used (two times so far this year) – still, feel free to provide a translation under i18n/zh-hant-express.php (open to other paths or names).

zhuyifei1999 commented 7 years ago

@FDMS what does this part of code do? I don't find a hint from v, namei, fg1. I'll see if I can find an alternative besides using regexes.

Artoria2e5 commented 7 years ago

@zhuyifei1999, I should've linked the relevant sections in zh-tw's code. These are the same regexen though.

FDMS commented 7 years ago

Implemented per off-GitHub discussions.