openedx / openedx/i18n-tools

extract: Fix extraction for es6/jsx files

Open
#75 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
26
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Django makemessages / GNU gettext do not currently support es6's template strings anywhere in a jsx file (not just in a gettext() call). Since it doesn't appear that gettext has any plans to add this support, we should really find a workaround or another library.

Bug reports:

Having backticks in the file causes xgettext's parsing to break, printing a few warnings in the log about unterminated strings or regexes. Additionally, it will complete the parsing but miss many gettext strings, leading to incomplete .po files.

Jira ticket:
https://openedx.atlassian.net/browse/LEARNER-6038

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with Django makemessages or GNU gettext on a JSX file containing backtick template strings, using the linked bug reports for context. Investigate how extraction currently handles those files; done means gettext strings are extracted without parser warnings and the resulting .po files are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, javascript, python
Domain
localization, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.