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

Error "no DTD found" #169

Closed
stefantalen opened this issue Dec 19, 2013 · 5 comments
Closed

Error "no DTD found" #169

stefantalen opened this issue Dec 19, 2013 · 5 comments

Comments

@stefantalen
Copy link

When clearing the cache in production environment I'm getting this error:

[Symfony\Component\Translation\Exception\InvalidResourceException]
[ERROR 94] Validation failed: no DTD found ! (in n/a - line 2, column 31)
[ERROR 1845] Element '{urn:jms:translation}reference-file': No matching global element declaration available, but demanded by the strict wildcard. (in ~/Sites/acme/ - line 16, column 0)

Should the generated XLIFF include a DTD since the schema exists in this bundle?

Symfony: 2.3.8
JMSTranslationBundle: dev-master

@stefantalen
Copy link
Author

Found the cause of this error, don't do this:

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    // ...
    $bundles[] = new JMS\TranslationBundle\JMSTranslationBundle();
    // ...
}

facepalm

@ludofleury
Copy link

It helped :) ty @stefantalen

@Aerendir
Copy link

I have the same error: should have I to register the bundle also in production? Do you mean this by telling "don't do this"?

@stefantalen
Copy link
Author

@Aerendir If you want to use the bundle in a production environment, you should register it there and not within the if-statement

@Aerendir
Copy link

Aerendir commented Sep 7, 2016

Yes, I've fixed! Thank you for your reply!

Also in composer.json it is required to set the dependency in the require section and in the require-dev one.

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

3 participants