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

Search for translation sources with custom extensions via make-json #231

Open
olegglocc opened this issue Oct 15, 2020 · 2 comments
Open

Comments

@olegglocc
Copy link

make-json extract JavaScript strings from PO files with .js and .min.js files extensions while generating individual JSON files like it should. But I have JS files with other extensions (for example .tag), which ignored this way.

In /i18n-command/blob/master/src/MakeJsonCommand.php start at 134 line I found code which responsible for it. So there inside iteration it check for each extension and return source if was found. Off course, I can "hardcode" and this will work. Something like:

if ( substr( $file, - 4 ) === '.tag' ) {
    return $file;
}

But my request is in core update from your side, because I think a lot of people will use with feature for their own purposes and there can be a great variety of similar extensions. Feature must be multipurpose for any extension and, desirable, provide this opportunity to programmers at their own discretion (like --extensions=tag argument or something similar). I.e additional to .js and .min.js will search for extensions specified in --extensions argument.

Or maybe you have any other suggestions for resolving my request? I am open to discussion and ready to listen to any suggestions.

Thanks!

@olegglocc
Copy link
Author

Hi!

Have you got some updates about this issue?

@swissspidy
Copy link
Member

swissspidy commented Feb 12, 2021

No update I‘m afraid. I personally haven‘t had time to look into it but it sounds like a feasible enhancement and PRs are more than welcome.

You do have some exotic file extensions I must say :-)

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

No branches or pull requests

2 participants