New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(PUP-7042) Mark strings in type #5566
Conversation
CLA signed by all contributors. |
Closing and reopening to fix Travis. |
cf626fe
to
3622a09
Compare
This commit marks user-facing error and info strings in `lib/puppet/type/*` for translation.
Closing and reopening to fix CI. |
lib/puppet/type/macauthorization.rb
Outdated
@@ -31,7 +31,7 @@ def munge_boolean(value) | |||
def munge_integer(value) | |||
Integer(value) | |||
rescue ArgumentError | |||
fail("munge_integer only takes integers") | |||
fail "munge_integer only takes integers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this was modified incorrectly
lib/puppet/type/tidy.rb
Outdated
@@ -258,7 +260,7 @@ def generate | |||
end | |||
found_files = files.find_all { |path| tidy?(path) }.collect { |path| mkfile(path) } | |||
result = found_files.each { |file| debug "Tidying #{file.ref}" }.sort { |a,b| b[:path] <=> a[:path] } | |||
notice "Tidying #{found_files.size} files" | |||
notice _("Tidying %{count} files") % { count: found_files.size } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth including note here too re: Tidying
lib/puppet/type/tidy.rb
Outdated
return nil | ||
rescue Errno::EACCES => error | ||
warning "Could not stat; permission denied" | ||
warning _("Could not stat; permission denied") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a note re: stat
is a program name?
lib/puppet/type/user.rb
Outdated
@@ -391,7 +391,7 @@ def insync?(current) | |||
|
|||
validate do |value| | |||
if value.intern != :absent and value !~ /^\d{4}-\d{2}-\d{2}$/ | |||
raise ArgumentError, "Expiry dates must be YYYY-MM-DD or the string \"absent\"" | |||
raise ArgumentError, _("Expiry dates must be YYYY-MM-DD or the string \"absent\"") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think its worth a translator note that YYYY-MM-DD reflects a four digit year two digit month two digit day separated by dashes? Maybe that's self-evident, not sure how/if it translates though
lib/puppet/type/user.rb
Outdated
end | ||
|
||
return [ "#{home}/.ssh/authorized_keys" ] if value == :true | ||
# value is an array - munge each value | ||
[ value ].flatten.map do |entry| | ||
if entry =~ /^~|^%h/ and not home | ||
raise ArgumentError, "purge_ssh_keys value '#{value}' meta character ~ or %h only allowed for users with a defined home directory" | ||
raise ArgumentError, "purge_ssh_keys value '#{value}' meta character ~ or \%h only allowed for users with a defined home directory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this line got skipped, maybe as a result of escaping %h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per minor fixups
efd6c4e
to
3a8a582
Compare
Updated. |
(PUP-7042) Mark strings in type
This commit marks user-facing error and info strings in
lib/puppet/type/*
for translation.