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

Add translator comment parsing #106

Merged
merged 1 commit into from
Nov 11, 2023
Merged

Conversation

dyoo
Copy link
Collaborator

@dyoo dyoo commented Oct 23, 2023

This moves the comment directive parsing to a separate module and adds two features:

  • Customizable prefix for the directive. It defaults to "i18", but to maintain compatibility, overridden with "mdbook-xgettext" in its current usage.
  • Can parse translator comments.

This is preparatory work to thread this state during message extraction.

@mgeisler
Copy link
Collaborator

mgeisler commented Nov 4, 2023

This needs a little rebase before it can be tested and merged.

@dyoo dyoo force-pushed the directive-parsing branch 8 times, most recently from b0faaa3 to 1241ede Compare November 9, 2023 19:37
@dyoo
Copy link
Collaborator Author

dyoo commented Nov 9, 2023

Rebased and applied recommended cleanups; once it looks good to you, I'll squash the fixup commits into the branch.

@dyoo dyoo force-pushed the directive-parsing branch 3 times, most recently from 7a11334 to 6e5a87b Compare November 9, 2023 22:41
@mgeisler mgeisler changed the title Move directive parsing into separate package and add translator comment parsing. Add translator comment parsing Nov 10, 2023
Copy link
Collaborator

@mgeisler mgeisler left a comment

Choose a reason for hiding this comment

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

I'm happy to merge this now and then refactor/update as we get more experience.

This adjusts the directive detection to detect "skip" and "comment"
commands.  We also adjust the regular expression so that it can use a
different, less wordy "i18n" prefix, rather than "mdbook-xgettext".
@dyoo
Copy link
Collaborator Author

dyoo commented Nov 10, 2023

Sounds good. Please merge.

Thanks for your patience as I'm still catching up on responding to your comments. I'll try to be a bit more prompt in the future.

@mgeisler mgeisler merged commit cd12c74 into google:main Nov 11, 2023
7 checks passed
@mgeisler
Copy link
Collaborator

Thanks for your patience as I'm still catching up on responding to your comments. I'll try to be a bit more prompt in the future.

All good! It's your PR and you can drive it at whatever speed suits you 🙂 This feature is not blocking anything directly, so it's not something I'm trying to push super hard.

@dyoo dyoo deleted the directive-parsing branch November 13, 2023 18:50
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