Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ private function configsNode(ArrayNodeDefinition $root)
->arrayNode('whitelist_domains')
->prototype('scalar')->end()
->end()
->arrayNode('remote_storage')
->info('Service ids with to classes that supports remote storage of translations.')
->prototype('scalar')->end()
->end()
->arrayNode('local_storage')
->info('Service ids with to classes that supports local storage of translations.')
->prototype('scalar')->end()
->end()
->scalarNode('output_dir')->isRequired()->cannotBeEmpty()->end()
->scalarNode('project_root')->info("The root dir of your project. By default this will be kernel_root's parent. ")->end()
->end()
Expand Down
14 changes: 13 additions & 1 deletion DependencyInjection/TranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,25 @@ public function load(array $configs, ContainerBuilder $container)
$c['project_root'] = dirname($container->getParameter('kernel.root_dir'));
}

$container->register('php_translation.storage.'.$name, StorageService::class);
$storageDefinition = $container->register('php_translation.storage.'.$name, StorageService::class);

// Register a file storage
$def = new DefinitionDecorator('php_translation.single_storage.file.abstract');
$def->replaceArgument(2, $c['output_dir'])
->addTag('php_translation.storage', ['type' => 'local', 'name' => $name]);
$container->setDefinition('php_translation.single_storage.file.'.$name, $def);

// Add storages
if (!empty($c['remote_storage'])) {
foreach ($c['remote_storage'] as $serviceId) {
$storageDefinition->addMethodCall('addRemoteStorage', [new Reference($serviceId)]);
}
}
if (!empty($c['local_storage'])) {
foreach ($c['local_storage'] as $serviceId) {
$storageDefinition->addMethodCall('addLocalStorage', [new Reference($serviceId)]);
}
}
}

if ($first !== null) {
Expand Down
2 changes: 0 additions & 2 deletions Resources/public/js/symfonyProfiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
*/
function clearState(key) {
var row = document.getElementById(key);
var cell = row.getElementsByClassName("state");
cell[0].innerHTML = "";

// disable the checkbox
var inputs = row.getElementsByTagName("input");
Expand Down