backdrop-contrib / potx

Translation template extrator for Backdrop modules, layouts, and themes. Finds translatable strings such as t() calls and exports .pot files.
GNU General Public License v2.0
1 stars 0 forks source link

Some or all JS files are not respected by potx #3

Closed olafgrabienski closed 6 years ago

olafgrabienski commented 7 years ago

I extracted the language template files of the core and the profiles directory of a Backdrop 1.6.3. site using the potx module via Drush.

When I compared these files at random with a language template file exported otherwise, I noticed that some (or all?) .js files weren't respected by potx.

As an example see core/misc/backdrop.js which seemingly wasn't interpreted by potx although there are relevant language strings in it, for instance Backdrop.t("An AJAX HTTP error occurred.").

serundeputy commented 7 years ago

ok. I'll check into this js integration. thanks!

serundeputy commented 6 years ago

replace Drupal.t.

quicksketch commented 6 years ago

I went ahead and merged my PR at https://github.com/backdrop-contrib/potx/pull/4. It gets the UI working.

I noticed that while Backdrop.t() calls are now exported, they all are reported as line number "0". But that seems to be the current design of the module that it doesn't track line numbers in JS files. So it's not perfect but it's matching the Drupal module functionality.