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",
|
"View full profile": "View full profile",
|
||||||
"Any type": "Any type",
|
"Any type": "Any type",
|
||||||
"In person": "In person",
|
"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",
|
"View full profile": "Voir le profil complet",
|
||||||
"Any type": "N'importe quel type",
|
"Any type": "N'importe quel type",
|
||||||
"In person": "En personne",
|
"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()
|
.toLocaleLowerCase()
|
||||||
.normalize("NFD")
|
.normalize("NFD")
|
||||||
.replace(/[\u0300-\u036f]/g, "")
|
.replace(/[\u0300-\u036f]/g, "")
|
||||||
|
.replace(/\s{2,}/, " ")
|
||||||
.replace(/ /g, "_")
|
.replace(/ /g, "_")
|
||||||
.replace(/[^a-z0-9_]/g, "");
|
.replace(/[^a-z0-9_]/g, "")
|
||||||
|
.replace(/_{2,}/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
validateUsername(): boolean {
|
validateUsername(): boolean {
|
||||||
|
|
|
@ -8,8 +8,10 @@ function convertToUsername(value: string | null): string {
|
||||||
.toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
.normalize("NFD")
|
.normalize("NFD")
|
||||||
.replace(/[\u0300-\u036f]/g, "")
|
.replace(/[\u0300-\u036f]/g, "")
|
||||||
|
.replace(/\s{2,}/, " ")
|
||||||
.replace(/ /g, "_")
|
.replace(/ /g, "_")
|
||||||
.replace(/[^a-z0-9_]/g, "");
|
.replace(/[^a-z0-9_]/g, "")
|
||||||
|
.replace(/_{2,}/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoUpdateUsername(
|
function autoUpdateUsername(
|
||||||
|
|
Loading…
Reference in a new issue