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

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

Closed
olafgrabienski opened this issue Apr 19, 2017 · 3 comments
Closed

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

olafgrabienski opened this issue Apr 19, 2017 · 3 comments
Assignees

Comments

@olafgrabienski
Copy link
Member

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
Copy link
Member

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

@serundeputy
Copy link
Member

replace Drupal.t.

@quicksketch
Copy link
Member

I went ahead and merged my PR at #4. It gets the UI working.

  • Enable potx module.
  • Visit /admin/config/regional/translate/extract
  • Select a module that has calls to either Drupal.t() or Backdrop.t() (both should be detected now).
  • Export.
  • Get a .pot file downloaded in the browser.

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.

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

No branches or pull requests

3 participants