Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

[i18n] Make theme sniffer fully translatable #163

Open
fr-laurentn opened this issue Apr 28, 2019 · 5 comments
Open

[i18n] Make theme sniffer fully translatable #163

fr-laurentn opened this issue Apr 28, 2019 · 5 comments
Labels
Status: Future Release This issue will be fixed in the future release of the plugin, or an enhancement will be added in the Status: Good First Issue This is a good first issue, something a new contributor can work on. Type: Enhancement This is an enhancement of the existing features or a new feature to the plugin.

Comments

@fr-laurentn
Copy link

Hi,

Thanks for this great plugin.

I translated the plugin to fr_FR, however not all the strings are translatable from translate.wordpress.org.

For instance, the standards name are not translatable, therefore we can't apply local typographical rules:
image
(we're supposed to have an non-breaking space before the : )

It would also be nice if we could translate the results.

Thanks in advance.

@dingo-d dingo-d added Status: Future Release This issue will be fixed in the future release of the plugin, or an enhancement will be added in the Status: Good First Issue This is a good first issue, something a new contributor can work on. Type: Enhancement This is an enhancement of the existing features or a new feature to the plugin. labels Apr 28, 2019
@dingo-d
Copy link
Member

dingo-d commented Apr 28, 2019

Thanks for the reported issue.

The standards name are not translatable, as they are the official names of the standards (like you wouldn't translate Zend, PSR etc.). I'd have to look into the non-breaking space before the :, not 100% sure what the issue is with this.

The results are derived from the PHP_CodeSniffer, and I'm not 100% sure it's possible to translate these. The results are passed down to JS, and then back to PHP via AJAX.

Maybe it would be possible to translate these, but I'm currently out of ideas how to do this.

Suggestions are welcomed of course 🙂

@fr-laurentn
Copy link
Author

fr-laurentn commented Apr 28, 2019

Thanks for your quick answer.

I understand the issue with the standards names, my concern is only with the non-breaking space.

For the results, I'm not a developer, so I won't be helpful here ^^
Can't you use https://make.wordpress.org/core/2018/11/09/new-javascript-i18n-support-in-wordpress?

Thanks,

@dingo-d
Copy link
Member

dingo-d commented Apr 28, 2019

I'll look into the issue with the non-breaking space 🙂

As for the results, the issue is that the error and warning strings (in most cases) are coming from the phpcs script. So it's the script output that's just being consumed. Theme Sniffer is registering some of the error messages, but those coming from the phpcs, I have (yet) no idea how to handle.

I'll have more time for cleaning up the issues and releasing the new version in the coming weeks so I'll look into this 🙂

@fr-laurentn
Copy link
Author

Thanks for taking the time to look into this! I appreciate that.

Good luck and let me know if you need help to do some testing.

@fr-laurentn
Copy link
Author

Hi Denis,

I'm not sure if this helps but I asked for ideas on the French WP Slack and someone sent me this link: https://developer.wordpress.org/reference/functions/wp_set_script_translations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Future Release This issue will be fixed in the future release of the plugin, or an enhancement will be added in the Status: Good First Issue This is a good first issue, something a new contributor can work on. Type: Enhancement This is an enhancement of the existing features or a new feature to the plugin.
Projects
None yet
Development

No branches or pull requests

2 participants