Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Coremunity
-
Platform Core KANBAN
-
Needs Assessment
-
New Feature
-
We are now doing translations for extracted modules
-
Needs Assessment
Description
puppetlabs_spec_helper adds a dependency on gettext-setup which provides the gettext::* rake tasks, however, it is only enabled if the module defines a locales/ directory and provides a config.yaml within. So for each module, create locales/config.yaml containing (change project and package name):
# This is the project-specific configuration file for setting up
|
# fast_gettext for your project.
|
gettext:
|
# This is used for the name of the .pot and .po files; they will be
|
# called <project_name>.pot?
|
project_name: puppetlabs-augeas_core
|
# This is used in comments in the .pot and .po files to indicate what
|
# project the files belong to and should bea little more desctiptive than
|
# <project_name>
|
package_name: puppetlabs-augeas_core
|
# The locale that the default messages in the .pot file are in
|
default_locale: en
|
# The email used for sending bug reports.
|
bugs_address: docs@puppet.com
|
# The holder of the copyright.
|
copyright_holder: Puppet, Inc.
|
# This determines which comments in code should be eligible for translation.
|
# Any comments that start with this string will be externalized. (Leave
|
# empty to include all.)
|
comments_tag: TRANSLATOR
|
# Patterns for +Dir.glob+ used to find all files that might contain
|
# translatable content, relative to the project root directory
|
source_files:
|
- './lib/**/*.rb'
|
Run bundle exec rake gettext:update_pot to create the initial .pot file
Commit the newly added file
Enable LOCALIZATION_ENABLED in ci-job-configs
Verify i18n job runs and adds i18n commit to the repo, eg https://jenkins-master-prod-1.delivery.puppetlabs.net/view/modules/view/Core/view/augeas_core/view/master/job/forge-module_puppetlabs-augeas_core_i18n-ruby_master/
.. and more