From 2f3569bed5600ab6897dc0ccc5d55782eb766dd5 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 20 Jul 2015 18:13:56 +0930 Subject: [PATCH] Don't override username if already set --- framework/core/js/lib/Translator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/core/js/lib/Translator.js b/framework/core/js/lib/Translator.js index 404595819..777cc8a67 100644 --- a/framework/core/js/lib/Translator.js +++ b/framework/core/js/lib/Translator.js @@ -61,7 +61,9 @@ export default class Translator { // translation key. This will allow a gender property to determine which // translation key is used. 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