i18n-command icon indicating copy to clipboard operation
i18n-command copied to clipboard

Search for translation sources with custom extensions via make-json

Open olegglocc opened this issue 5 years ago • 2 comments

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 avatar Oct 15 '20 15:10 olegglocc

Hi!

Have you got some updates about this issue?

olegglocc avatar Feb 12 '21 06:02 olegglocc

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 :-)

swissspidy avatar Feb 12 '21 08:02 swissspidy