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

Extractor searching same directories mulitple times #97

Closed
Venzon opened this issue Jan 17, 2013 · 4 comments · Fixed by #102
Closed

Extractor searching same directories mulitple times #97

Venzon opened this issue Jan 17, 2013 · 4 comments · Fixed by #102

Comments

@Venzon
Copy link

Venzon commented Jan 17, 2013

I am extracting translations for several languages with such command:
php app/console --env=dev translation:extract pl de it --config=app

In output I can see that after each iteration every source directory is duplicated - every next language keeps searching directories from previous languages:

Extracting Translations for locale pl
Keep old translations: No
Output-Path: /app/Resources/translations
Directories: /BackendBundle/Resources/views/Clinic, /BackendBundle/Resources/views/Person, /BackendBundle/Services
Excluded Directories: cache, data, logs, Resources/views/Form
Excluded Names: *TestCase.php, *Test.php
Output-Format: # whatever is present, if nothing then xliff #
Custom Extractors: # none #
============================================================
Loading catalogues from "/app/Resources/translations"
Extracting translation keys
Extracting messages from directory : /BackendBundle/Resources/views/Clinic
Extracting messages from directory : /BackendBundle/Resources/views/Person
Extracting messages from directory : /BackendBundle/Services
Writing translation file "/app/Resources/translations/backend.pl.xliff".
Extracting Translations for locale de
Keep old translations: No
Output-Path: /app/Resources/translations
Directories: /BackendBundle/Resources/views/Clinic, /BackendBundle/Resources/views/Person, /BackendBundle/Services
Excluded Directories: cache, data, logs, Resources/views/Form
Excluded Names: *TestCase.php, *Test.php
Output-Format: # whatever is present, if nothing then xliff #
Custom Extractors: # none #
============================================================
Loading catalogues from "/app/Resources/translations"
Extracting translation keys
Extracting messages from directory : /BackendBundle/Resources/views/Clinic
Extracting messages from directory : /BackendBundle/Resources/views/Person
Extracting messages from directory : /BackendBundle/Services
Extracting messages from directory : /BackendBundle/Resources/views/Clinic
Extracting messages from directory : /BackendBundle/Resources/views/Person
Extracting messages from directory : /BackendBundle/Services
Writing translation file "/app/Resources/translations/backend.de.xliff".
Extracting Translations for locale it
Keep old translations: No
Output-Path: /app/Resources/translations
Directories: /BackendBundle/Resources/views/Clinic, /BackendBundle/Resources/views/Person, /BackendBundle/Services
Excluded Directories: cache, data, logs, Resources/views/Form
Excluded Names: *TestCase.php, *Test.php
Output-Format: # whatever is present, if nothing then xliff #
Custom Extractors: # none #
============================================================
Loading catalogues from "/app/Resources/translations"
Extracting translation keys
Extracting messages from directory : /BackendBundle/Resources/views/Clinic
Extracting messages from directory : /BackendBundle/Resources/views/Person
Extracting messages from directory : /BackendBundle/Services
Extracting messages from directory : /BackendBundle/Resources/views/Clinic
Extracting messages from directory : /BackendBundle/Resources/views/Person
Extracting messages from directory : /BackendBundle/Services
Extracting messages from directory : /BackendBundle/Resources/views/Clinic
Extracting messages from directory : /BackendBundle/Resources/views/Person
Extracting messages from directory : /BackendBundle/Services
Writing translation file "/app/Resources/translations/backend.it.xliff".
done!

here is my config from app.yml:

jms_translation:
    configs:
        app:
            dirs:
                - %kernel.root_dir%/../src/Acme/BackendBundle/Resources/views/Clinic
                - %kernel.root_dir%/../src/Acme/BackendBundle/Resources/views/Person
                - %kernel.root_dir%/../src/Acme/BackendBundle/Services
            output_dir: %kernel.root_dir%/Resources/translations
            ignored_domains: [routes]
            excluded_names: [*TestCase.php, *Test.php]
            excluded_dirs: [cache, data, logs, Resources/views/Form]

Is this bug in bundle or should I look for bug in my code?

@Venzon
Copy link
Author

Venzon commented Jan 24, 2013

Can someone confirm this bug so I know if this happens only to me?
Please ^^

Regards

@tkleinhakisa
Copy link
Contributor

same problem here,

The result of extraction does not seems to be wrong

for first locale, runs quickly, only one line in the log
for second locale, runs slower, 2 lines in the log
third locale, runs very slow, 3 lines in the log

I think we gonna need a very powerfull server to extract translations when we get a fourth locale :)

@schmittjoh
Copy link
Owner

Supplying multiple locales is just a short cut for running the command with each locale successively. As such the current behavior is expected.

Iterating the files just once should be possible although requires some changes to the internals. If someone needs the performance improvement that comes with it, a pull request would be appreciated.

tkleinhakisa added a commit to tkleinhakisa/JMSTranslationBundle that referenced this issue Feb 6, 2013
setDirectories is in fact adding directories not setting them
fixes schmittjoh#97
@Venzon
Copy link
Author

Venzon commented Feb 6, 2013

@tkleinhakisa good job, thx

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 a pull request may close this issue.

3 participants