wp-cli / i18n-command

Provides internationalization tools for WordPress projects.
MIT License
96 stars 52 forks source link

Are file references for plugin/theme headers supposed to be absolute paths? #383

Closed jkrrv closed 5 months ago

jkrrv commented 5 months ago

I realize support questions are supposed to go through other channels, but since this is closely related to #377 and #65, posting here made sense. (Though, let me know if elsewhere would still be better).

I'm a plugin developer and I'm noticing the header strings now being added to pot files, which is great! But, the file references being used are absolute paths, which seems odd to me.

I'm running on Windows, but this is holding true for the handful of plugins I work on.

Running wp-cli i18n make-pot . i18n/my-plugin.pot from the root directory of the plugin results in the pot file containing:

...
#. Author URI of the plugin
#: V:\my-plugin\my-plugin.php
msgid "https://github.com/jkrrv"
msgstr ""

#: src/templates/admin/invKoForm.php:17
#: src/templates/admin/locationsKoForm.php:13
#: src/templates/admin/locationsKoForm.php:50
msgid "Delete"
msgstr ""
...

I've included the last header item, and the first regular string. The second item, the regular string, has the relative paths I expect. But the paths for the header strings are all absolute, which is not what I would expect. After all, these paths are going to be different for every developer or translator.

Is this intentional?

Thanks!

jkrrv commented 5 months ago

Based on the diff in #377, it appears the answer is 'no', it's not intentional. #384 is intended to resolve this.