Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 2.31 KB

README.md

File metadata and controls

56 lines (38 loc) · 2.31 KB

translate

Table of Contents

  1. Module Description - What the module does and why it is useful
  2. Setup - The basics of getting started with translate
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Functions
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module
  8. Contributors

Module description

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.

Setup

Install this module with the Puppet Module Tool:

puppet module install puppetlabs-translate

Reference

Functions

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"))

Limitations

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.")

Development

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.

Contributors

The list of contributors can be found at: https://github.com/puppetlabs/puppetlabs-translate/graphs/contributors.