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

Support translator comments #28

Merged
merged 14 commits into from
Nov 19, 2024
Merged

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Nov 15, 2024

Still WIP but Feedback welcome!

This allows you to add translator comments:

// i18n: comment
Translate.string('bar')

For react:

<div>
  {/* i18n: Title */}
  <Translate>Hello & World</Translate>
</div>

The resulting POT file looks like this:

#: test.jsx:4
#. comment
msgid "bar"
msgstr ""

I'm thinking maybe we should strip the leading i18n: (though babel does not do this)
Comment tags are stripped from comments

src/client/index.js Outdated Show resolved Hide resolved
Copy link
Member Author

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ughh I added the comments as pending and didn't notice..

src/tools/extract.js Show resolved Hide resolved
src/tools/extract-plugin.js Outdated Show resolved Hide resolved
@tomasr8 tomasr8 marked this pull request as ready for review November 19, 2024 13:14
@ThiefMaster ThiefMaster merged commit ba17597 into indico:master Nov 19, 2024
1 check passed
@tomasr8 tomasr8 deleted the translator-comments branch November 19, 2024 15:51
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

Successfully merging this pull request may close these issues.

2 participants