@@ 31-48 (lines=18) @@ | ||
28 | /** |
|
29 | * @Route("/import", name="KunstmaanTranslatorBundle_command_import") |
|
30 | */ |
|
31 | public function importAction() |
|
32 | { |
|
33 | $importCommand = new ImportCommand(); |
|
34 | $importCommand |
|
35 | ->setForce(false) |
|
36 | ->setDefaultBundle($this->getParameter('kuma_translator.default_bundle')) |
|
37 | ->setBundles($this->getParameter('kuma_translator.bundles')) |
|
38 | ->setGlobals(true); |
|
39 | ||
40 | $this->get('kunstmaan_translator.service.importer.command_handler')->executeImportCommand($importCommand); |
|
41 | ||
42 | $this->addFlash( |
|
43 | FlashTypes::SUCCESS, |
|
44 | $this->get('translator')->trans('kuma_translator.command.import.flash.success') |
|
45 | ); |
|
46 | ||
47 | return new RedirectResponse($this->generateUrl('KunstmaanTranslatorBundle_settings_translations')); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @Route("/import-forced", name="KunstmaanTranslatorBundle_command_import_forced") |
|
@@ 53-70 (lines=18) @@ | ||
50 | /** |
|
51 | * @Route("/import-forced", name="KunstmaanTranslatorBundle_command_import_forced") |
|
52 | */ |
|
53 | public function importForcedAction() |
|
54 | { |
|
55 | $importCommand = new ImportCommand(); |
|
56 | $importCommand |
|
57 | ->setForce(true) |
|
58 | ->setDefaultBundle($this->getParameter('kuma_translator.default_bundle')) |
|
59 | ->setBundles($this->getParameter('kuma_translator.bundles')) |
|
60 | ->setGlobals(false); |
|
61 | ||
62 | $this->get('kunstmaan_translator.service.importer.command_handler')->executeImportCommand($importCommand); |
|
63 | ||
64 | $this->addFlash( |
|
65 | FlashTypes::SUCCESS, |
|
66 | $this->get('translator')->trans('kuma_translator.command.import.flash.force_success') |
|
67 | ); |
|
68 | ||
69 | return new RedirectResponse($this->generateUrl('KunstmaanTranslatorBundle_settings_translations')); |
|
70 | } |
|
71 | ||
72 | /** |
|
73 | * @Route("/export", name="KunstmaanTranslatorBundle_command_export") |