| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Support\Twig; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Twig_Extension; | 
					
						
							|  |  |  | use Twig_SimpleFilter; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2015-06-29 09:23:39 +02:00
										 |  |  |  * @codeCoverageIgnore | 
					
						
							| 
									
										
										
										
											2015-06-29 09:53:10 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  |  * Class Budget | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package FireflyIII\Support\Twig | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class Translation extends Twig_Extension | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function getFilters() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $filters = []; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $filters[] = new Twig_SimpleFilter( | 
					
						
							| 
									
										
										
										
											2015-06-06 23:09:12 +02:00
										 |  |  |             '_', function ($name) { | 
					
						
							| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-14 09:51:54 +02:00
										 |  |  |             return trans('firefly.' . $name); | 
					
						
							| 
									
										
										
										
											2015-05-09 22:42:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         }, ['is_safe' => ['html']] | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $filters; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * {@inheritDoc} | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function getName() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return 'FireflyIII\Support\Twig\Translation'; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |