Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find template "JMSTranslationBundle::base.html.twig" #497

Open
c2sean opened this issue Aug 31, 2018 · 4 comments
Open

Unable to find template "JMSTranslationBundle::base.html.twig" #497

c2sean opened this issue Aug 31, 2018 · 4 comments

Comments

@c2sean
Copy link

c2sean commented Aug 31, 2018

Q A
Bundle version 1.4.3
Symfony version 3.4.15
PHP version 7.2

Expected behavior

Loading the web interface for translation

Actual behavior

Loading results in the following error:

Twig_Error_Loader:
Unable to find template "JMSTranslationBundle::base.html.twig" (looked into: /Users/sean/sites/meg/app/Resources/views, /Users/sean/sites/xxxxxx/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form) in "@JMSTranslation/Translate/index.html.twig" at line 1.

at vendor/twig/twig/lib/Twig/Loader/Filesystem.php:226
at Twig_Loader_Filesystem->findTemplate('JMSTranslationBundle::base.html.twig')
(vendor/twig/twig/lib/Twig/Loader/Filesystem.php:143)
at Twig_Loader_Filesystem->getCacheKey('JMSTranslationBundle::base.html.twig')
(vendor/twig/twig/lib/Twig/Environment.php:270)
at Twig_Environment->getTemplateClass('JMSTranslationBundle::base.html.twig')
(vendor/twig/twig/lib/Twig/Environment.php:350)
at Twig_Environment->loadTemplate('JMSTranslationBundle::base.html.twig', null)
(vendor/twig/twig/lib/Twig/Template.php:330)
at Twig_Template->loadTemplate('JMSTranslationBundle::base.html.twig', '@JMSTranslation/Translate/index.html.twig', 1)
(var/cache/dev/twig/fa/fa6896cbbd9e869f369eadfe88a075737bb7f63244fe5afb31faf445f5e98e65.php:15)
at __TwigTemplate_a00e5d3a92c05701c817117cd2541bc7292f33b8435818de6b6d1d9d8dc365c3->__construct(object(Twig_Environment))
(vendor/twig/twig/lib/Twig/Environment.php:397)
at Twig_Environment->loadTemplate('@JMSTranslation/Translate/index.html.twig')
(vendor/twig/twig/lib/Twig/Environment.php:289)
at Twig_Environment->render('@JMSTranslation/Translate/index.html.twig', array('selectedConfig' => 'app', 'configs' => array('app'), 'selectedDomain' => 'validators', 'domains' => array('validators'), 'selectedLocale' => 'en', 'locales' => array('en', 'fr'), 'format' => 'xliff', 'newMessages' => array('fos_user.email.already_used' => object(XliffMessage), 'fos_user.email.blank' => object(XliffMessage), 'fos_user.email.invalid' => object(XliffMessage), 'fos_user.email.long' => object(XliffMessage), 'fos_user.email.short' => object(XliffMessage), 'fos_user.password.blank' => object(XliffMessage), 'fos_user.password.short' => object(XliffMessage), 'fos_user.username.already_used' => object(XliffMessage), 'fos_user.username.blank' => object(XliffMessage), 'fos_user.username.long' => object(XliffMessage), 'fos_user.username.short' => object(XliffMessage)), 'existingMessages' => array(), 'alternativeMessages' => array('fos_user.email.already_used' => array('fr' => object(XliffMessage)), 'fos_user.email.blank' => array('fr' => object(XliffMessage)), 'fos_user.email.invalid' => array('fr' => object(XliffMessage)), 'fos_user.email.long' => array('fr' => object(XliffMessage)), 'fos_user.email.short' => array('fr' => object(XliffMessage)), 'fos_user.password.blank' => array('fr' => object(XliffMessage)), 'fos_user.password.short' => array('fr' => object(XliffMessage)), 'fos_user.username.already_used' => array('fr' => object(XliffMessage)), 'fos_user.username.blank' => array('fr' => object(XliffMessage)), 'fos_user.username.long' => array('fr' => object(XliffMessage)), 'fos_user.username.short' => array('fr' => object(XliffMessage))), 'isWriteable' => true, 'file' => '/Users/sean/sites/meg/app/Resources/translations/validators.en.xliff', 'sourceLanguage' => 'en'))
(vendor/sensio/framework-extra-bundle/EventListener/TemplateListener.php:103)
at Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener->onKernelView(object(GetResponseForControllerResultEvent), 'kernel.view', object(TraceableEventDispatcher))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php:104)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(GetResponseForControllerResultEvent), 'kernel.view', object(ContainerAwareEventDispatcher))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:212)
at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener)), 'kernel.view', object(GetResponseForControllerResultEvent))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:44)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', object(GetResponseForControllerResultEvent))
(vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:139)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.view', object(GetResponseForControllerResultEvent))
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:156)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(web/app.php:25)

Steps to reproduce

Install the bundle, set the configuration:
#JMS Translation Bundle jms_translation: configs: app: dirs: ["%kernel.root_dir%", "%kernel.root_dir%/../src"] output_dir: "%kernel.root_dir%/Resources/translations" ignored_domains: [routes] excluded_names: ["*TestCase.php", "*Test.php"] excluded_dirs: [cache, data, logs]

Then attempt to load site.com/_trans

@tilimac
Copy link
Contributor

tilimac commented Nov 14, 2018

I have the same problem ...
Up ?

@merigold
Copy link

merigold commented Nov 17, 2018

same,

SYMFONY 4.1

Unable to find template "JMSTranslationBundle::base.html.twig" (looked into: /usr/home/merigold/domains/locatick.zetapp.pl/webapp/templates, /usr/home/merigold/domains/locatick.zetapp.pl/webapp/vendor/symfony/twig-bridge/Resources/views/Form) in @JMSTranslation/Translate/index.html.twig at line 1.

My solution:

add to framework.yaml:

templating:
engines: ['twig']

@imadetouil
Copy link

try to use :
// Case if you want to include it:
{{ include('@Blog/partials/header.html.twig') }} //Blog is the name of bundle

// Case you want extends it:
{% extends "base.html.twig" %} //From app folder
{% extends "@Blog/base.html.twig" %} // from Blog Bundle

@muhiddingithub
Copy link

Change to "@JMSTranslationBundle/base.html.twig" that, If your symfony version greater than 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants