How to generate the strings for foreman-docker

Daniel:

What is the best way to generate the strings for foreman-docker? I tried:

bundle exec rake plugin:gettext[foreman_docker]
bundle exec rake plugin:gettext[ForemanDocker]

from the foreman directory and it ends up creating foreman.po in

locale/zh_CN/foreman.edit.po
locale/zh_CN/foreman.po
locale/zh_CN/foreman.po.time_stamp
locale/zh_TW/foreman.edit.po
locale/zh_TW/foreman.po
locale/zh_TW/foreman.po.time_stamp

If I go to foreman_docker/locale and run make extract-strings I get:

[bkearney@fivehole locale] $ make extract-strings
bundle exec rake locale:po_to_json locale:find DOMAIN=docker SKIP_MODEL=1
(in /home/bkearney/code/foreman-docker)
rake aborted!
LoadError: cannot load such file – rubocop/rake_task
/home/bkearney/code/foreman-docker/Rakefile:10:in require&#39; /home/bkearney/code/foreman-docker/Rakefile:10:in<top (required)>'
/home/bkearney/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in
eval&#39; /home/bkearney/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in<main>'
(See full trace by running task with --trace)
…/.foreman_app/locale/Makefile:51: recipe for target 'extract-strings'
failed
make: *** [extract-strings] Error 1
[bkearney@fivehole locale] $

even with rubocop installed

– bk

Probably #8874, which isn't solved for plugins yet. Patches welcome.

··· On 16/09/15 00:29, Bryan Kearney wrote: > bundle exec rake plugin:gettext[foreman_docker] > bundle exec rake plugin:gettext[ForemanDocker] > > from the foreman directory and it ends up creating foreman.po in > > locale/zh_CN/foreman.edit.po > locale/zh_CN/foreman.po > locale/zh_CN/foreman.po.time_stamp > locale/zh_TW/foreman.edit.po > locale/zh_TW/foreman.po > locale/zh_TW/foreman.po.time_stamp


Dominic Cleal
dominic@cleal.org

There is an open PR for this. Does this need testing, or to be amended?

– bk

··· On 09/16/2015 02:51 AM, Dominic Cleal wrote: > On 16/09/15 00:29, Bryan Kearney wrote: >> bundle exec rake plugin:gettext[foreman_docker] >> bundle exec rake plugin:gettext[ForemanDocker] >> >> from the foreman directory and it ends up creating foreman.po in >> >> locale/zh_CN/foreman.edit.po >> locale/zh_CN/foreman.po >> locale/zh_CN/foreman.po.time_stamp >> locale/zh_TW/foreman.edit.po >> locale/zh_TW/foreman.po >> locale/zh_TW/foreman.po.time_stamp > > Probably #8874, which isn't solved for plugins yet. Patches welcome. >

It only works for core, not plugins.

··· On 16/09/15 16:53, Bryan Kearney wrote: > > > On 09/16/2015 02:51 AM, Dominic Cleal wrote: >> On 16/09/15 00:29, Bryan Kearney wrote: >>> bundle exec rake plugin:gettext[foreman_docker] >>> bundle exec rake plugin:gettext[ForemanDocker] >>> >>> from the foreman directory and it ends up creating foreman.po in >>> >>> locale/zh_CN/foreman.edit.po >>> locale/zh_CN/foreman.po >>> locale/zh_CN/foreman.po.time_stamp >>> locale/zh_TW/foreman.edit.po >>> locale/zh_TW/foreman.po >>> locale/zh_TW/foreman.po.time_stamp >> >> Probably #8874, which isn't solved for plugins yet. Patches welcome. >> > > There is an open PR for this. Does this need testing, or to be amended?


Dominic Cleal
dominic@cleal.org

Added a comment to the PR. Take a look at
https://github.com/bkearney/foreman/commits/bkearney-8874-i18n-failures.
I was able to get the plugins to generate correctly. That patch is a
rebase of yours onto develop, and then a small patch on top of it.

– bk

··· On 09/17/2015 02:55 AM, Dominic Cleal wrote: > On 16/09/15 16:53, Bryan Kearney wrote: >> >> >> On 09/16/2015 02:51 AM, Dominic Cleal wrote: >>> On 16/09/15 00:29, Bryan Kearney wrote: >>>> bundle exec rake plugin:gettext[foreman_docker] >>>> bundle exec rake plugin:gettext[ForemanDocker] >>>> >>>> from the foreman directory and it ends up creating foreman.po in >>>> >>>> locale/zh_CN/foreman.edit.po >>>> locale/zh_CN/foreman.po >>>> locale/zh_CN/foreman.po.time_stamp >>>> locale/zh_TW/foreman.edit.po >>>> locale/zh_TW/foreman.po >>>> locale/zh_TW/foreman.po.time_stamp >>> >>> Probably #8874, which isn't solved for plugins yet. Patches welcome. >>> >> >> There is an open PR for this. Does this need testing, or to be amended? > > It only works for core, not plugins. >