Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 5.2.0
-
Platform Core
-
Platform Core KANBAN
-
Needs Assessment
-
New Feature
-
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.
-
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
1.
|
Create mountpoint for locale files on master |
|
Closed | Jennifer Solman |
2.
|
Pluginsync locale files |
|
Closed | Maggie Dreyer |
3.
|
Load module translation files |
|
Closed | Maggie Dreyer |