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

Scanner is scanning parent root directory (!?) #71

Closed
dantux opened this issue Apr 4, 2016 · 3 comments
Closed

Scanner is scanning parent root directory (!?) #71

dantux opened this issue Apr 4, 2016 · 3 comments
Labels

Comments

@dantux
Copy link

dantux commented Apr 4, 2016

Hi,

I have my application set up with the configuration file at this location:
/home/mywww/myapp/frontend/config/main.php
In this file, I set up your module and the value for 'root' is dirname(dirname(__DIR__))
which maps to/home/mywww/myapp
When I run a scan, I get error messages for not being able to open folders under /home/mywww (outside the 'myapp' folder). Why is that?
I also tried to put the path manually like this:
'root'=>'/home/mywww/myapp/'
and I get the same result.
If I put it like:
'root'=>'/home/mywww/myapp/frontend/', it seems to search 'myapp', but for some reason, it doesn't find any instances of Y::t('app','') in my project. And I have this in every file!
What am I doing wrong?

Here is my full config for the module:

    'translatemanager' => [
        'class' => 'lajax\translatemanager\Module',
        //'root' => dirname(dirname(__DIR__)),               // The root directory of the project scan.
        'root' => '/home/mywww/myapp/',               // The root directory of the project scan.
        'layout' => null,//'language',         // Name of the used layout. If using own layout use 'null'.
        'allowedIPs' => ['127.0.0.1'],  // IP addresses from which the translation interface is accessible.
        'roles' => ['theCreator','translator'],               // For setting access levels to the translating interface.
        'tmpDir' => '@runtime',         // Writable directory for the client-side temporary language files. 
                                        // IMPORTANT: must be identical for all applications (the AssetsManager serves the JavaScript files containing language elements from this directory).
        'phpTranslators' => ['::t'],    // list of the php function for translating messages.
        'jsTranslators' => ['lajax.t'], // list of the js function for translating messages.
        'patterns' => ['*.js', '*.php'],// list of file extensions that contain language elements.
        'ignoredCategories' => ['yii'], // these categories won’t be included in the language database.
        'ignoredItems' => ['config'],   // these files will not be processed.
    ],

Any ideas?

@moltam
Copy link
Collaborator

moltam commented Apr 4, 2016

See #12.

@moltam
Copy link
Collaborator

moltam commented Apr 10, 2016

Scanning multiple directories is now possible with merging #77.

It is also possible to turn off changing the root to its parent directory: #73.

Could you take a look at these in dev-master?

This is strange, I have no idea why this is happening:

If I put it like:
'root'=>'/home/mywww/myapp/frontend/', it seems to search 'myapp', but for some reason, it doesn't find any instances of Y::t('app','') in my project. And I have this in every file!

@dantux
Copy link
Author

dantux commented Apr 11, 2016

Thanks a lot Moltam for replying. Really appreciate it.
I don't know what I did the first time; probably because I was putting the actual physical path instead of the alias... but when I changed back to the alias, (I created one as a child folder to the root path), it worked! yay!! This is amazing :) I'm so happy :)

Thank you again.

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

No branches or pull requests

2 participants