Jira (PDOC-193) Evaluate using `yard i18n` to extract doc string content into POT files

3 views
Skip to first unread message

Jesse Scott (JIRA)

unread,
Dec 13, 2017, 9:04:03 AM12/13/17
to puppe...@googlegroups.com
Jesse Scott created an issue
 
Puppet Strings / Improvement PDOC-193
Evaluate using `yard i18n` to extract doc string content into POT files
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2017/12/13 6:03 AM
Priority: Normal Normal
Reporter: Jesse Scott

Since 0.8.0 yard has included an i18n subcommand to place all the doc strings into a .pot file. It seems like if we just run this automatically when a user invokes puppet strings that would go a long way to enabling i18n workflows for module documentation.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Eric Putnam (JIRA)

unread,
Jan 25, 2018, 4:19:02 PM1/25/18
to puppe...@googlegroups.com

Eric Putnam (JIRA)

unread,
Feb 7, 2018, 1:37:03 PM2/7/18
to puppe...@googlegroups.com
Eric Putnam updated an issue
 
Puppet Strings / Task PDOC-193
Change By: Eric Putnam
Issue Type: Improvement Task
This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Eric Putnam (JIRA)

unread,
Feb 13, 2018, 5:11:03 PM2/13/18
to puppe...@googlegroups.com

Eric Putnam (JIRA)

unread,
Jun 8, 2018, 5:29:02 PM6/8/18
to puppe...@googlegroups.com
Eric Putnam updated an issue
Since 0.8.0 yard has included an {{i18n}} subcommand to place all the doc strings into a .pot file. It seems like if we just run this automatically when a user invokes {{puppet strings}} that would go a long way to enabling i18n workflows for module documentation.


You can see this in raw action by simply calling the CLI tool from the PuppetStrings.generate method and then running strings on a module.
{code}
YARD::CLI::I18n.run(search_patterns)
{code}
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Eric Putnam (JIRA)

unread,
Jun 8, 2018, 5:29:02 PM6/8/18
to puppe...@googlegroups.com
Eric Putnam updated an issue
Since 0.8.0 yard has included an {{i18n}} subcommand to place all the doc strings into a .pot file. It seems like if we just run this automatically when a user invokes {{puppet strings}} that would go a long way to enabling i18n workflows for module documentation.

You can see this in raw action by simply calling the CLI tool from the PuppetStrings.generate method and then running strings on a module.
{code :ruby }
YARD::CLI::I18n.run(search_patterns)
{code}

Eric Putnam (JIRA)

unread,
Jun 8, 2018, 5:29:03 PM6/8/18
to puppe...@googlegroups.com

Eric Putnam (JIRA)

unread,
Jun 8, 2018, 5:35:02 PM6/8/18
to puppe...@googlegroups.com
Eric Putnam updated an issue
Since 0.8.0 yard has included an {{i18n}} subcommand to place all the doc strings into a .pot file. It seems like if we just run this automatically when a user invokes {{puppet strings}} that would go a long way to enabling i18n workflows for module documentation.

You can see this in raw action by simply calling the CLI tool from the PuppetStrings.generate method and then running strings on a module.
{code:ruby}
YARD::CLI::I18n.run(search_patterns)
{code}


You can see from the attached file, there's a lot of stuff that we won't want in there. It will be confusing to the translator and lots of unnecessary work. A few examples:

A lot of tags get the tag itself extracted into a msgid that looks like the one here:
{code}
# @param [String]
#: ../lib/puppet/type/radius.rb:3
#: ../manifests/install.pp:10
msgid "tag|param|name"
msgstr ""
{code}
First of all, we don't want the param name translated. Second, that's just confusing to look at.

In other cases, we _do_ want part of this msgid. This mostly occurs in examples:
{code}
# @example
#: ../lib/puppet/type/radius.rb:3
msgid "tag|example|Here's an example"
msgstr ""
{code}

Finally, we don't want to translate code examples, obviously
{code}
# @example Using the type.
#: ../lib/puppet/type/test.rb:3
msgid "test { 'mctesterson':\n"
"  foo     => 'hi',\n"
"  my_prop => 'bar',\n"
"}"
msgstr ""
{code}

Eric Putnam (JIRA)

unread,
Jun 8, 2018, 5:35:03 PM6/8/18
to puppe...@googlegroups.com

Eric Putnam (JIRA)

unread,
Sep 4, 2019, 12:11:03 PM9/4/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages