Conditions | 2 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | public function create() |
||
42 | { |
||
43 | $this->validate(); |
||
44 | try { |
||
45 | $lang = strtolower($this->language) . '_panel'; |
||
46 | File::copy(LangManager::getPath('en_panel'), LangManager::getPath($lang)); |
||
47 | |||
48 | $this->dispatchBrowserEvent('show-message', ['type' => 'success', 'message' => __('CreatedMessage', ['name' => __('Translation') ])]); |
||
49 | } catch (\Exception $exception){ |
||
50 | $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => $exception->getMessage()]); |
||
51 | } |
||
52 | |||
53 | $this->reset('language'); |
||
54 | } |
||
63 |