[PUP-9053] Enable localizations for extracted modules Created: 2018/08/10  Updated: 2018/10/02  Resolved: 2018/09/25

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 6.0.1

Type: Bug Priority: Normal
Reporter: Josh Cooper Assignee: Melissa Stone
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template: PUP Bug Template
Epic Link: Move non-core T/P to modules
Team: Coremunity
Sprint: Platform Core KANBAN
Method Found: Needs Assessment
Release Notes: New Feature
Release Notes Summary: We are now doing translations for extracted modules
QA Risk Assessment: Needs Assessment


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.
  # 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
      - './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

Comment by Melissa Stone [ 2018/08/21 ]

we need to fix the i18n module jobs first: https://github.com/puppetlabs/ci-job-configs/pull/4925

Comment by Melissa Stone [ 2018/08/21 ]

waiting on cron though

Comment by Melissa Stone [ 2018/08/23 ]

https://github.com/puppetlabs/ci-job-configs/pull/4944 has everything but cron

Comment by Melissa Stone [ 2018/09/11 ]

PR to fix the module i18n jobs: https://github.com/puppetlabs/ci-job-configs/pull/4966

Comment by Melissa Stone [ 2018/09/14 ]

PR ready for merge: https://github.com/puppetlabs/ci-job-configs/pull/4966

Comment by Melissa Stone [ 2018/09/14 ]

This doesn't need ci, but I do want to check up on the module pipelines (especially if there are any module changes that go in), to check on if the i18n jobs are actually working

Comment by Melissa Stone [ 2018/09/18 ]

Something didn't quite go right with this

11:27:41 Changes found, commiting new POT file
11:27:41 [detached HEAD 41ca9d9] Updating POT file for 480519e2d72681653f17d57f5a7adad5c9297916
11:27:41  1 file changed, 5 insertions(+), 10 deletions(-)
11:27:41 Pushing changes back to repository
11:27:41 error: src refspec master does not match any.
11:27:41 error: failed to push some refs to 'git@github.com:puppetlabs/puppetlabs-augeas_core.git'

Comment by Melissa Stone [ 2018/09/20 ]

Most recent PR: https://github.com/puppetlabs/ci-job-configs/pull/5049

Comment by Michelle Fredette [ 2018/10/01 ]

added release note.

Generated at Sun May 31 14:03:02 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.