-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #464 from tommygnr/DiExtraBundle-removal-tommygnr
Remove dependency on JMSDiExtraBundle
- Loading branch information
Showing
8 changed files
with
52 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,30 +23,39 @@ | |
use JMS\TranslationBundle\Translation\Updater; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use JMS\TranslationBundle\Util\FileUtils; | ||
use JMS\DiExtraBundle\Annotation as DI; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
/** | ||
* @Route("/api") | ||
* @Route("/api", service="jms_translation.controller.api_controller") | ||
* | ||
* @author Johannes M. Schmitt <[email protected]> | ||
*/ | ||
class ApiController | ||
{ | ||
/** | ||
* @DI\Inject("jms_translation.config_factory") | ||
* @var ConfigFactory | ||
*/ | ||
private $configFactory; | ||
|
||
/** | ||
* @DI\Inject("jms_translation.updater") | ||
* @var Updater | ||
*/ | ||
private $updater; | ||
|
||
/** | ||
* ApiController constructor. | ||
* | ||
* @param ConfigFactory $configFactory | ||
* @param Updater $updater | ||
*/ | ||
public function __construct(ConfigFactory $configFactory, Updater $updater) | ||
{ | ||
$this->configFactory = $configFactory; | ||
$this->updater = $updater; | ||
} | ||
|
||
/** | ||
* @Route("/configs/{config}/domains/{domain}/locales/{locale}/messages", | ||
* name="jms_translation_update_message", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,37 +22,53 @@ | |
use JMS\TranslationBundle\Translation\ConfigFactory; | ||
use JMS\TranslationBundle\Translation\LoaderManager; | ||
use JMS\TranslationBundle\Util\FileUtils; | ||
use JMS\DiExtraBundle\Annotation as DI; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\Translation\MessageCatalogue; | ||
|
||
/** | ||
* Translate Controller. | ||
* | ||
* @Route(service="jms_translation.controller.translate_controller") | ||
* @author Johannes M. Schmitt <[email protected]> | ||
*/ | ||
class TranslateController | ||
{ | ||
/** | ||
* @DI\Inject("jms_translation.config_factory") | ||
* @var ConfigFactory | ||
*/ | ||
private $configFactory; | ||
|
||
/** | ||
* @DI\Inject("jms_translation.loader_manager") | ||
* @var LoaderManager | ||
*/ | ||
private $loader; | ||
|
||
/** | ||
* @DI\Inject("%jms_translation.source_language%") | ||
* @var string | ||
*/ | ||
private $sourceLanguage; | ||
|
||
/** | ||
* TranslateController constructor. | ||
* | ||
* @param ConfigFactory $configFactory | ||
* @param LoaderManager $loader | ||
*/ | ||
public function __construct(ConfigFactory $configFactory, LoaderManager $loader) | ||
{ | ||
$this->configFactory = $configFactory; | ||
$this->loader = $loader; | ||
} | ||
|
||
/** | ||
* @param string $lang | ||
*/ | ||
public function setSourceLanguage($lang) | ||
{ | ||
$this->sourceLanguage = $lang; | ||
} | ||
|
||
/** | ||
* @Route("/", name="jms_translation_index", options = {"i18n" = false}) | ||
* @Template | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters