Plugin to Append Extra Message to a Hint

Plugin source location: <serge_root>/lib/Serge/Engine/Plugin/append_hint_message.pm

Plugin always attaches itself to the following callback phase: add_dev_comment.

Adding a hint allows you to provide better context to translators. It can include, for example, links to a preview server, or some hashtags to help translators find similar messages. This plugin is used to append an arbitrary messages to a hint associated with the translatable string. The resulting multi-line hint is then exported as a developer's comment in generated translation file, and is generally displayed to translators within their translation environment.

This plugin inherits all the configuration logic from the parent 'if' plugin and, if all conditions are met, appends a hint message. Note that all if conditions are optional: if none are provided, the hint message will be always added.

In the context of if conditions, the content_matches and content_doesnt_match rules work against the source string (not the entire file).

When configuring the plugin, you can include macros in hint message parameter, see below. These macros will be expanded to their actual values. Having macros allows one to construct preview links pointing to a specific target file, or to a help page for a specific file extension. See Configuration File Reference for the list of available macros.

Usage

example-project.serge