-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Way to generate string location path relative? #208
Comments
This is not implemented currently. $translations = Translations::fromPhpCode($file, ['basepath' => __DIR__]); I don't think to have time to do this, if you want to help with a pull request, I'll happily review it. |
I would like to see if I can get some time for this. What would be the best default option? I personally would find the relative path the best option. |
For backward compatibility, the default option should be absolute path. Relative path will be generated only if |
That's what I was figuring. Let's see if I can make a PR this weekend. So, we are limited to passing the base path to calculate a relative one, right? There is this neat method from symfony/filesystem but I dont know If you are willing to include another dependency just for this method. If we are not going to add that component as a dependency, we would be breaking any license if we just copy and paste that method? |
This could be a good usage? $translations->addFromJsCodeFile($file, [
'base_path' => '/var/www/html'
]); |
Yes, perfect.
No, this should be implemented without include any dependency
I think we can simplify this method, not only copy and paste as is. Anyway, the license is MIT so I think there's no problem, but I'd include a php comment referencing to the original method. |
Any news on this one? |
for ppl wanting this, this is the code we have running for a while now
which gives us relative filenames |
I was wondering if there is any possibility of generating a relative path when I'm generating a .pot file when scanning files. Por example, not having lines like
and getting something more like
if the pot file is being generated on /var/www/html/httpdocs/translations (just a fast example)
The text was updated successfully, but these errors were encountered: