- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with translate
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Functions
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Contributors
This module provides the translate
function for Puppet. Wrapping a string in this function will mark it to be picked up by gettext and put into the .pot file for translation purposes. Currently, we are only marking failures, errors, and warnings in Puppet Supported modules. However, feel free to do what you like with your own.
Install this module with the Puppet Module Tool:
puppet module install puppetlabs-translate
Takes in a string and passes it to fast_gettext's _() function. Primarily used for 'marking' a string to be added to a .pot file.
fail(translate("Failure message"))
We do not yet support string interpolation or pluralization.
# WRONG
translate("Failure: ${message}")
# WRONG
translate("There is ${count} failure: ...", "There are ${count} failures: ...", num_failures)
# RIGHT
translate("Failure: Could not load thing.")
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can’t access the huge number of platforms and myriad hardware, software, and deployment configurations that Puppet is intended to serve. We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see our module contribution guide.
The list of contributors can be found at: https://github.com/puppetlabs/puppetlabs-translate/graphs/contributors.