1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 18:32:41 +01:00
phorge-phorge/src/applications/config/option/PhabricatorTranslationsConfigOptions.php
Ricky Elrod ae0773b789 Add translations config group.
Summary:
Adds the translations group as per T2255. Currently `translation.override` is
`wild` -- it should be changed to dict<string, string> when that exists.

Also fixes a small bug from D4326 which caused "class" types to not ever
validate.

Test Plan:
- Looked at the settings.
- Successfully saved a setting relating to classes.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4350
2013-01-04 16:22:56 -08:00

43 lines
1.4 KiB
PHP

<?php
final class PhabricatorTranslationsConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht("Translations");
}
public function getDescription() {
return pht("Options relating to translations.");
}
public function getOptions() {
return array(
$this->newOption(
'translation.provider',
'class',
'PhabricatorEnglishTranslation')
->setBaseClass('PhabricatorTranslation')
->setSummary(pht("Translation class that should be used for strings."))
->setDescription(
pht(
"This allows customizing texts used in Phabricator. The class ".
"must extend PhabricatorTranslation."))
->addExample('PhabricatorEnglishTranslation', pht('Valid Setting')),
// TODO: This should be dict<string,string> I think, but that doesn't
// exist yet.
$this->newOption('translation.override', 'wild', array())
->setSummary(pht("Override translations."))
->setDescription(
pht(
"You can use 'translation.override' if you don't want to create ".
"a full translation to give users an option for switching to it ".
"and you just want to override some strings in the default ".
"translation."))
->addExample(
'{"some string": "my alternative"}',
pht('Valid Setting')),
);
}
}