Improve converting to username from non-latin characters
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a54607a57d
commit
cd8a5552bb
@ -1232,5 +1232,6 @@
|
||||
"View full profile": "View full profile",
|
||||
"Any type": "Any type",
|
||||
"In person": "In person",
|
||||
"In the past": "In the past"
|
||||
"In the past": "In the past",
|
||||
"Only registered users may fetch remote events from their URL.": "Only registered users may fetch remote events from their URL."
|
||||
}
|
||||
|
@ -1336,5 +1336,6 @@
|
||||
"View full profile": "Voir le profil complet",
|
||||
"Any type": "N'importe quel type",
|
||||
"In person": "En personne",
|
||||
"In the past": "Dans le passé"
|
||||
"In the past": "Dans le passé",
|
||||
"Only registered users may fetch remote events from their URL.": "Seul⋅es les utilisateur⋅ices enregistré⋅es peuvent récupérer des événements depuis leur URL."
|
||||
}
|
||||
|
@ -29,8 +29,10 @@ export default class IdentityEditionMixin extends Mixins(Vue) {
|
||||
.toLocaleLowerCase()
|
||||
.normalize("NFD")
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
.replace(/\s{2,}/, " ")
|
||||
.replace(/ /g, "_")
|
||||
.replace(/[^a-z0-9_]/g, "");
|
||||
.replace(/[^a-z0-9_]/g, "")
|
||||
.replace(/_{2,}/, "");
|
||||
}
|
||||
|
||||
validateUsername(): boolean {
|
||||
|
@ -8,8 +8,10 @@ function convertToUsername(value: string | null): string {
|
||||
.toLocaleLowerCase()
|
||||
.normalize("NFD")
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
.replace(/\s{2,}/, " ")
|
||||
.replace(/ /g, "_")
|
||||
.replace(/[^a-z0-9_]/g, "");
|
||||
.replace(/[^a-z0-9_]/g, "")
|
||||
.replace(/_{2,}/, "");
|
||||
}
|
||||
|
||||
function autoUpdateUsername(
|
||||
|
Loading…
Reference in New Issue
Block a user