8000 do not try to load translation files from hidden folders by laszlokorte · Pull Request #994 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

do not try to load translation files from hidden folders #994

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

Closed
wants to merge 1 commit into from

Conversation

laszlokorte
Copy link
Contributor

translation files in hidden folders and hidden translation files should not be loaded.

Eg:
src/Acme/DemoBundle/Resources/translation/.AppleDouble/messages.de.yml

@pborreli
Copy link
Contributor

this is indeed a problem i already noticed in another place, maybe we should ignore that folder inside Finder componant itself, personally i added ".AppleDouble" in ignoreVcs method but it's not really a vcs folder, any feedback ?

@jokey2k
Copy link
jokey2k commented May 21, 2011

I'd extend it to dot-folders in general.. unless explicitely stated they are meant to be hidden, hence we can extend that list endlessly

@@ -436,7 +436,7 @@ class FrameworkExtension extends Extension
// Register translation resources
if ($dirs) {
$finder = new Finder();
$finder->files()->filter(function (\SplFileInfo $file) { return 2 === substr_count($file->getBasename(), '.'); })->in($dirs);
$finder->files()->filter(function (\SplFileInfo $file) { return (FALSE === strpos($file->getRealPath(), DIRECTORY_SEPARATOR . '.') && 2 === substr_count($file->getBasename(), '.')); })->in($dirs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FALSE should be in lowercase

@fabpot
Copy link
Member
fabpot commented May 23, 2011

7ab3fde

@fabpot fabpot closed this May 23, 2011
@pborreli
Copy link
Contributor

thanks @fabpot !

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

Successfully merging this pull request may close these issues.

5 participants
0