mirror of
https://github.com/flarum/framework.git
synced 2025-04-26 06:34:06 +08:00
Don't override username if already set
This commit is contained in:
parent
6b601ae2d6
commit
b31a290f00
@ -61,7 +61,9 @@ export default class Translator {
|
|||||||
// translation key. This will allow a gender property to determine which
|
// translation key. This will allow a gender property to determine which
|
||||||
// translation key is used.
|
// translation key is used.
|
||||||
if (input.user instanceof User) {
|
if (input.user instanceof User) {
|
||||||
input.username = username(extract(input, 'user'));
|
const user = extract(input, 'user');
|
||||||
|
|
||||||
|
if (!input.username) input.username = username(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we've found the appropriate translation string, then we'll sub in the
|
// If we've found the appropriate translation string, then we'll sub in the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user