Skip to content

Puppet module i18n: Puppet code

ehom edited this page Jun 3, 2019 · 2 revisions

Mark your strings for translation (Puppet)

To decorate Puppet code, use a tool called puppet-lint which fulfills the same role as RuboCop. When you run puppet-lint, it tracks down all instances where decoration is required and outputs them in a simple format.

Similar to RuboCop, puppet-lint can attempt to autocorrect the violations if the –fix flag is added to the command, although it does not work on interpolated strings.

At this point in time, only warning and fail methods are supported, all others will have to be manually tracked down.

Generate the .pot file for translation (Puppet)

To generate a pot, run a rake task that exist and live in gettext.

bundle exec rake generate_puppet_pot

This command creates a file called puppet.pot inside the locales folder. Make sure to check for duplications.