support installation specific translations (#1099)
This commit is contained in:
@@ -62,6 +62,16 @@ class AppExtension extends Extension
|
||||
$container->setParameter('kimai.timesheet.rounding', $config['timesheet']['rounding']);
|
||||
|
||||
$this->setLdapParameter($config['ldap'], $container);
|
||||
|
||||
// translation files, which can overwrite the default kimai translations
|
||||
$localTranslations = [];
|
||||
if (null !== $config['theme']['branding']['translation']) {
|
||||
$localTranslations[] = $config['theme']['branding']['translation'];
|
||||
}
|
||||
if (null !== $config['industry']['translation']) {
|
||||
$localTranslations[] = $config['industry']['translation'];
|
||||
}
|
||||
$container->setParameter('kimai.i18n_domains', $localTranslations);
|
||||
}
|
||||
|
||||
protected function setLdapParameter(array $config, ContainerBuilder $container)
|
||||
|
||||
@@ -58,6 +58,7 @@ class Configuration implements ConfigurationInterface
|
||||
->append($this->getLanguagesNode())
|
||||
->append($this->getCalendarNode())
|
||||
->append($this->getThemeNode())
|
||||
->append($this->getIndustryNode())
|
||||
->append($this->getDashboardNode())
|
||||
->append($this->getWidgetsNode())
|
||||
->append($this->getDefaultsNode())
|
||||
@@ -344,6 +345,9 @@ class Configuration implements ConfigurationInterface
|
||||
->scalarNode('title')
|
||||
->defaultNull()
|
||||
->end()
|
||||
->scalarNode('translation')
|
||||
->defaultNull()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->integerNode('autocomplete_chars')
|
||||
@@ -355,6 +359,22 @@ class Configuration implements ConfigurationInterface
|
||||
return $node;
|
||||
}
|
||||
|
||||
protected function getIndustryNode()
|
||||
{
|
||||
$builder = new TreeBuilder('industry');
|
||||
/** @var ArrayNodeDefinition $rootNode */
|
||||
$node = $builder->getRootNode();
|
||||
|
||||
$node
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('translation')->defaultNull()->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
protected function getUserNode()
|
||||
{
|
||||
$builder = new TreeBuilder('user');
|
||||
|
||||
Reference in New Issue
Block a user