Allow user override translation and implement PhutilPerson
Test Plan: Altered database. Wrote a custom translation and selected it in preferences. Verified that the text is custom translated. Set language back to default. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1139 Differential Revision: https://secure.phabricator.com/D2757
This commit is contained in:
@@ -60,6 +60,17 @@ abstract class PhabricatorController extends AphrontController {
|
||||
}
|
||||
}
|
||||
|
||||
$translation = $user->getTranslation();
|
||||
if ($translation &&
|
||||
$translation != PhabricatorEnv::getEnvConfig('translation.provider') &&
|
||||
class_exists($translation) &&
|
||||
is_subclass_of($translation, 'PhabricatorTranslation')) {
|
||||
$translation = newv($translation, array());
|
||||
PhutilTranslator::getInstance()
|
||||
->setLanguage($translation->getLanguage())
|
||||
->addTranslations($translation->getTranslations());
|
||||
}
|
||||
|
||||
$request->setUser($user);
|
||||
|
||||
if ($user->getIsDisabled() && $this->shouldRequireEnabledUser()) {
|
||||
|
||||
Reference in New Issue
Block a user