mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-30 08:53:05 +00:00
translate cli options
This commit is contained in:
parent
2e8e220ada
commit
1e4a91dba8
3 changed files with 45 additions and 15 deletions
15
i18n/en.yml
15
i18n/en.yml
|
@ -20,6 +20,21 @@ en:
|
||||||
update:
|
update:
|
||||||
id_no_exist: "Can't update the item, the item %{id} doesn't exist!"
|
id_no_exist: "Can't update the item, the item %{id} doesn't exist!"
|
||||||
cli:
|
cli:
|
||||||
|
option:
|
||||||
|
usage: "Usage"
|
||||||
|
show: "Search and show the items"
|
||||||
|
show_all: "Show all items"
|
||||||
|
update: "Update an item"
|
||||||
|
remove: "Delete an item"
|
||||||
|
group: "Search the items with specified group"
|
||||||
|
add: "Add an item"
|
||||||
|
setup: "Create a new configuration file"
|
||||||
|
protocol: "Select the items with the specified protocol"
|
||||||
|
export: "Export all items in a CSV file"
|
||||||
|
import: "Import item since a CSV file"
|
||||||
|
force: "Force an action"
|
||||||
|
format: "Change the display items format by an alternative format"
|
||||||
|
help: "Show this help message"
|
||||||
form:
|
form:
|
||||||
add:
|
add:
|
||||||
title: "Add a new item"
|
title: "Add a new item"
|
||||||
|
|
15
i18n/fr.yml
15
i18n/fr.yml
|
@ -20,6 +20,21 @@ fr:
|
||||||
update:
|
update:
|
||||||
id_no_exist: "Impossible de mettre à jour l'élément %{id}, car il n'existe pas!"
|
id_no_exist: "Impossible de mettre à jour l'élément %{id}, car il n'existe pas!"
|
||||||
cli:
|
cli:
|
||||||
|
option:
|
||||||
|
usage: "Utilisation"
|
||||||
|
show: "Recherche et affiche les éléments"
|
||||||
|
show_all: "Affiche tous les éléments"
|
||||||
|
update: "Met à jour un élément"
|
||||||
|
remove: "Supprime un élément"
|
||||||
|
group: "Recherche les éléments appartenant au groupe spécifié"
|
||||||
|
add: "Ajoute un élément"
|
||||||
|
setup: "Création d'un nouveau fichier de configuration"
|
||||||
|
protocol: "Sélectionne les éléments ayant le protocole spécifié"
|
||||||
|
export: "Exporte tous les éléments dans un fichier au format CSV"
|
||||||
|
import: "Importe des éléments depuis un fichier au format CSV"
|
||||||
|
force: "Force une action, l'action ne demandera pas de confirmation"
|
||||||
|
format: "Change le format d'affichage des éléments par un alternatif"
|
||||||
|
help: "Affiche ce message d'aide"
|
||||||
form:
|
form:
|
||||||
add:
|
add:
|
||||||
title: "Ajout d'un nouvel élément"
|
title: "Ajout d'un nouvel élément"
|
||||||
|
|
30
mpw
30
mpw
|
@ -27,58 +27,58 @@ options[:format] = false
|
||||||
options[:group] = nil
|
options[:group] = nil
|
||||||
|
|
||||||
OptionParser.new do |opts|
|
OptionParser.new do |opts|
|
||||||
opts.banner = "Usage: mpw [options]"
|
opts.banner = "#{I18n.t('cli.option.usage')}: mpw [options]"
|
||||||
|
|
||||||
opts.on("-d", "--display [SEARCH]", "Display items") do |search|
|
opts.on('-d', '--display [SEARCH]', I18n.t('cli.option.show')) do |search|
|
||||||
search.nil? ? (options[:display] = '') : (options[:display] = search)
|
search.nil? ? (options[:display] = '') : (options[:display] = search)
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-A", "--show-all", "Show all items") do |b|
|
opts.on('-A', '--show-all', I18n.t('cli.option.show_all')) do |b|
|
||||||
options[:type] = nil
|
options[:type] = nil
|
||||||
options[:display] = ""
|
options[:display] = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-u", "--update ID", "Update an items") do |id|
|
opts.on('-u', '--update ID', I18n.t('cli.option.update')) do |id|
|
||||||
options[:update] = id
|
options[:update] = id
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-r", "--remove ID", "Remove an items") do |id|
|
opts.on('-r', '--remove ID', I18n.t('cli.option.remove')) do |id|
|
||||||
options[:remove] = id
|
options[:remove] = id
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-g", "--group GROUP", "Select a group") do |group|
|
opts.on('-g', '--group GROUP', I18n.t('cli.option.group')) do |group|
|
||||||
options[:group] = group
|
options[:group] = group
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-a", "--add", "Add an items") do |b|
|
opts.on('-a', '--add', I18n.t('cli.option.add')) do |b|
|
||||||
options[:add] = true
|
options[:add] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-S", "--setup", "Setup the config file") do |b|
|
opts.on('-S', '--setup', I18n.t('cli.option.setup')) do |b|
|
||||||
options[:setup] = true
|
options[:setup] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-p", "--protocol PROTOCOL", "Select a protocol") do |type|
|
opts.on('-p', '--protocol PROTOCOL', I18n.t('cli.option.protocol')) do |type|
|
||||||
options[:type] = type
|
options[:type] = type
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-e", "--export FILE", "Export to csv file") do |file|
|
opts.on('-e', '--export FILE', I18n.t('cli.option.export')) do |file|
|
||||||
options[:export] = file
|
options[:export] = file
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-i", "--import FILE", "Import from csv file") do |file|
|
opts.on('-i', '--import FILE', I18n.t('cli.option.import')) do |file|
|
||||||
options[:import] = file
|
options[:import] = file
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-f", "--force", "Force an action") do |b|
|
opts.on('-f', '--force', I18n.t('cli.option.force')) do |b|
|
||||||
options[:force] = true
|
options[:force] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-F", "--format", "Change the display format by an alternatif") do |b|
|
opts.on('-F', '--format', I18n.t('cli.option.format')) do |b|
|
||||||
options[:format] = true
|
options[:format] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-h", "--help", "Show this message") do |b|
|
opts.on('-h', '--help', I18n.t('cli.option.help')) do |b|
|
||||||
puts opts
|
puts opts
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue