Use buttons.* translations for glyphicons titles

This commit is contained in:
Brenda Wallace
2019-01-21 13:40:56 +13:00
parent e886929af5
commit 30255a24d2
9 changed files with 23 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
%p
.btn-group
= link_to t(:plant_something), new_planting_path, class: 'btn btn-default'
= link_to t(:harvest_something), new_harvest_path, class: 'btn btn-default'
= link_to t(:save_seeds), new_seed_path, class: 'btn btn-default'
= link_to t(:write_blog_post), new_post_path, class: 'btn btn-default'
= link_to t('buttons.plant_something'), new_planting_path, class: 'btn btn-default'
= link_to t('buttons.harvest_something'), new_harvest_path, class: 'btn btn-default'
= link_to t('buttons.save_seeds'), new_seed_path, class: 'btn btn-default'
= link_to t('buttons.write_blog_post'), new_post_path, class: 'btn btn-default'

View File

@@ -1,4 +1,4 @@
- if can?(:create, Photo)
= link_to path, class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-camera{ title: "Add photo" }
%span.glyphicon.glyphicon-camera{ title: t('buttons.add_photo') }
=t('buttons.add_photo')

View File

@@ -1,4 +1,4 @@
= link_to path, method: :delete,
data: { confirm: t(:are_you_sure?) }, class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-trash{ title: t(:delete) }
%span.glyphicon.glyphicon-trash{ title: t('buttons.delete') }
=t('buttons.delete')

View File

@@ -1,3 +1,3 @@
= link_to path, class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-pencil{ title: t(:edit) }
%span.glyphicon.glyphicon-pencil{ title: t('buttons.edit') }
=t('buttons.edit')

View File

@@ -1,5 +1,5 @@
- if can?(:edit, planting) && !planting.finished
= link_to planting_path(planting, planting: { finished: 1 }),
method: :put, class: 'btn btn-default btn-xs append-date' do
%span.glyphicon.glyphicon-ok{ title: t(:finished) }
%span.glyphicon.glyphicon-ok{ title: t('buttons.finished') }
=t('buttons.mark_as_finished')

View File

@@ -1,5 +1,5 @@
- unless seed.finished
= link_to seed_path(seed, seed: { finished: 1 }),
method: :put, class: 'btn btn-default btn-xs append-date' do
%span.glyphicon.glyphicon-ok{ title: t(:finished) }
%span.glyphicon.glyphicon-ok{ title: t('buttons.finished') }
=t('buttons.mark_as_finished')

View File

@@ -1,4 +1,4 @@
- planting.active? && if can?(:create, Harvest) && can?(:edit, planting)
= link_to new_planting_harvest_path(planting), class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-leaf{ title: :harvest }
=t('buttons.harvest')
%span.glyphicon.glyphicon-leaf{ title: = t('buttons.harvest') }
= t('buttons.harvest')

View File

@@ -1,4 +1,4 @@
- if planting.active?
= link_to new_planting_seed_path(planting), class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-heart{ title: t(:save_seeds) }
=t('buttons.save_seeds')
%span.glyphicon.glyphicon-heart{ title: t('buttons.save_seeds') }
= t('buttons.save_seeds')

View File

@@ -63,6 +63,16 @@ en:
seed:
one: seed
other: seeds
buttons:
add_photo: Add photo
delete: Delete
edit: Edit
harvest: Harvest
harvest_something: Harvest something
mark_as_finished: Mark as finished
plant_something: Plant something
save_seeds: Save seeds
write_blog_post: Write blog post
crops:
index:
subtitle: "%{crops_size} total"