Skip to content

Commit

Permalink
i18n - extracting new, pulling from tx (theforeman#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfu committed May 18, 2023
1 parent e721dcf commit 0bc1890
Show file tree
Hide file tree
Showing 54 changed files with 20,690 additions and 201 deletions.
9 changes: 6 additions & 3 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[main]
host = https://www.transifex.com
host = https://app.transifex.com

[foreman.foreman_virt_who_configure]
[o:foreman:p:foreman:r:foreman_virt_who_configure]
file_filter = locale/<lang>/foreman_virt_who_configure.edit.po
source_file = locale/foreman_virt_who_configure.pot
source_lang = en
type = PO
type = PO

minimum_perc = 0
resource_name = foreman_virt_who_configure
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div id="config_general_information">
<%= text_f f, :name, inline_help_popover(_('Name of this configuration, e.g. the name of the hypervisor')) %>
<%= text_f f, :name, inline_help_popover(_('Name of this configuration, e.g. the name of the hypervisor')).merge(:label => _('Name')) %>
<% if f.object.organization_id.present? %>
<%= f.hidden_field :organization_id %>
<% else %>
<%= select_f f, :organization_id, Organization.authorized(:view_organizations), :id, :to_s, {}, :label => _('Owner') %>
<% end %>
<%= select_f f, :hypervisor_type, ForemanVirtWhoConfigure::Config::HYPERVISOR_TYPES, :first, :last %>
<%= text_f f, :hypervisor_server, { :required => true }.merge(inline_help_popover(hypervisor_server_help_data[f.object.hypervisor_type]).merge(:data => { :help => hypervisor_server_help_data })) %>
<%= text_f f, :hypervisor_username, { :required => true }.merge(inline_help_popover(hypervisor_username_help_data[f.object.hypervisor_type]).merge(:data => { :help => hypervisor_username_help_data })) %>
<%= password_f f, :hypervisor_password, { :required => true, :value => f.object.hypervisor_password }.merge(inline_help_popover(_('Account password by which virt-who is to connect to the hypervisor instance.'))) %>
<%= select_f f, :hypervisor_type, ForemanVirtWhoConfigure::Config::HYPERVISOR_TYPES, :first, :last, {}, { :label => _('Hypervisor Type') } %>
<%= text_f f, :hypervisor_server, { :label => _('Hypervisor Server'), :required => true }.merge(inline_help_popover(hypervisor_server_help_data[f.object.hypervisor_type]).merge(:data => { :help => hypervisor_server_help_data })) %>
<%= text_f f, :hypervisor_username, { :label => _('Hypervisor Username'), :required => true }.merge(inline_help_popover(hypervisor_username_help_data[f.object.hypervisor_type]).merge(:data => { :help => hypervisor_username_help_data })) %>
<%= password_f f, :hypervisor_password, { :label => _('Hypervisor Password'), :required => true, :value => f.object.hypervisor_password }.merge(inline_help_popover(_('Account password by which virt-who is to connect to the hypervisor instance.'))) %>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="config_schedule">
<%= selectable_f f, :interval, ForemanVirtWhoConfigure::Config::AVAILABLE_INTERVALS.map { |k,v| [_(v), k] }, {}, inline_help_popover(_("How often to check connected hypervisors for changes? Also affects how often a mapping is reported. The recommended value for most environments is every two hours. Different interval can't be set per hypervisor, therefore it will affect all other deployed configurations on the host on which this configuration will be deployed.")) %>
<%= selectable_f f, :interval, ForemanVirtWhoConfigure::Config::AVAILABLE_INTERVALS.map { |k,v| [_(v), k] }, {}, inline_help_popover(_("How often to check connected hypervisors for changes? Also affects how often a mapping is reported. The recommended value for most environments is every two hours. Different interval can't be set per hypervisor, therefore it will affect all other deployed configurations on the host on which this configuration will be deployed.")).merge(:label => _('Interval')) %>
</div>
12 changes: 12 additions & 0 deletions foreman_virt_who_configure.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
require File.expand_path('../lib/foreman_virt_who_configure/version', __FILE__)
require 'date'

begin
Dir["locale/**/*.po"].each do |po|
mo = po.sub(/foreman_virt_who_configure\.po$/, "LC_MESSAGES/foreman_virt_who_configure.mo")
STDERR.puts "WARNING: File #{mo} does not exist, generate with 'make all-mo'!" unless File.exist?(mo)
STDERR.puts "WARNING: File #{mo} outdated, regenerate with 'make all-mo'" if File.mtime(po) > File.mtime(mo)
# Adding this so you can actually build the gem and the warnings come out, without this
# we get an error when making the gem and it fails as well as a ruby error if the mo files don't exist
rescue => e
puts "#{e} not found"
end
end

Gem::Specification.new do |s|
s.name = 'foreman_virt_who_configure'
s.version = ForemanVirtWhoConfigure::VERSION
Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_virt_who_configure/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Engine < ::Rails::Engine

initializer 'foreman_virt_who_configure.register_plugin', :before => :finisher_hook do |_app|
Foreman::Plugin.register :foreman_virt_who_configure do
requires_foreman '>= 1.24'
requires_foreman '>= 3.7'

apipie_documented_controllers ["#{ForemanVirtWhoConfigure::Engine.root}/app/controllers/foreman_virt_who_configure/api/v2/*.rb"]

Expand Down
3 changes: 1 addition & 2 deletions locale/action_names.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
_("Create Alternate Content Source")
_("Create Export History")
_("Create Import History")
_("Create Package Group")
_("Create Syncable Export History")
_("Create")
_("Delete Activation Key")
_("Delete Lifecycle Environment")
_("Delete Package Group")
_("Delete Product")
_("Delete")
_("Destroy Alternate Content Source")
Expand Down Expand Up @@ -57,6 +55,7 @@
_("Publish")
_("Refresh Alternate Content Source")
_("Reindex subscriptions")
_("Remote action:")
_("Remove Content")
_("Remove Version")
_("Remove Versions and Associations")
Expand Down

0 comments on commit 0bc1890

Please sign in to comment.