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:
vrana
2012-06-14 18:08:06 -07:00
parent ec819c068c
commit 48ebcf0679
6 changed files with 63 additions and 6 deletions

View File

@@ -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()) {