Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8026

Module code translation should be supported with puppet agent runs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.2.0
    • Fix Version/s: PUP 5.3.4
    • Component/s: Modules
    • Labels:
    • Release Notes:
      New Feature
    • Release Notes Summary:
      Module translations are now downloaded from the master to the agent during pluginsync, along with the rest of the module files. Note, currently all translations for all languages are downloaded, not just the ones for the agent's locale.
    • QA Risk Assessment:
      Automate

      Description

      Translation support in Puppet was extended to Puppet code in modules. It also appears to be expected to support any Ruby code in modules, such as custom facts, types and providers, and Puppet functions.

      This works with puppet apply. However, we don't appear to do anything to pluginsync the locales directory containing those translations to agents to make them available during a puppet agent run. We should.

      In order to get pluginsync working, we need a locale mountpoint on the server with the locale files, each of which has a unique name based on the module name. These come from the locales subdirectories of modules. We only want to sync the PO files, not the config files. We either need to preserve the directory structure or only download the one locale we need (or both). We should probably start by downloading all locales to keep things simple.

      Adding the downloader on the agent side should be a relatively simple addition, thanks to metaprogramming. We should have these translations be kept separate from the main plugin directory. See configurer/downloader_factory.rb.

      Once we have the translation files, we should load them into the text domain for the current environment at the start of every Puppet application call. This can likely be added to the application base. The first time that this happens on the agent, there won't be any translations. We need to load translations every time we pluginsync and re-evaluate facts, to make sure that we really have loaded the ones for the correct environment, so this should probably be added to the pluginsync functionality.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              maggie Maggie Dreyer
              Reporter:
              michael.smith Michael Smith
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support