Skip to content

Commit 3a2c31c

Browse files
committed
Wrap hardcoded strings in t() and add missing translations
- Wrap all hardcoded UI strings in public views with t() calls: layouts, tracks, proposals, conference_registrations, physical_tickets, surveys, conferences splashpage partials - Add missing en/es locale keys for all wrapped strings - Fill empty Spanish translations in conferences/es.yml - Fix markdown_hint helper to use I18n.t() for boilerplate text - Use symbolic keys for strings with trailing periods to avoid YAML matching issues (room_capacity_*, tips_for_presentations, speakers_help)
1 parent 501045c commit 3a2c31c

33 files changed

Lines changed: 167 additions & 82 deletions

File tree

app/helpers/format_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ def markdown(text, escape_html=true)
196196
end
197197

198198
def markdown_hint(text='')
199-
markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text", false)
199+
link = link_to('**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank')
200+
hint = "#{I18n.t('Please look at')} #{link} #{I18n.t('to format your text')}"
201+
markdown(text.present? ? "#{text} #{hint}" : hint, false)
200202
end
201203

202204
def quantity_left_of(resource)

app/views/conference_registrations/show.html.haml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
%span.fa-stack
5858
%i.fa-solid.fa-square-dashed.fa-stack-2x
5959
%i.fa-solid.fa-check.fa-stack-1x
60-
Registered to the following event(s)
60+
= t('Registered to the following event(s)')
6161
%ul
6262
- @registration.events.each do |event|
6363
%li
@@ -101,10 +101,10 @@
101101
= humanized_money @total_price_per_ticket[ticket_id]
102102
%br
103103
.btn-group{ role: 'group' }
104-
= link_to 'View all tickets',
104+
= link_to t('View all tickets'),
105105
conference_physical_tickets_path(@conference.short_title),
106106
class: 'btn btn-success'
107-
= link_to 'Get more tickets',
107+
= link_to t('Get more tickets'),
108108
conference_tickets_path(@conference.short_title),
109109
class: 'btn btn-default'
110110
- else
@@ -115,7 +115,7 @@
115115
%p
116116
%em
117117
= t("Your participation won't be valid without getting a")
118-
registration ticket.
118+
= t('registration ticket.')
119119
= link_to t('Get tickets'),
120120
conference_tickets_path(@conference.short_title),
121121
class: 'btn btn-default'
@@ -126,13 +126,13 @@
126126
.btn-group-vertical.pull-right
127127
= link_to t('Edit your Registration'), edit_conference_conference_registration_path(@conference.short_title), class: 'btn btn-success', disabled: @conference.end_date < Date.today
128128
- if @tickets.any?
129-
= link_to 'Unregister', conference_conference_registration_path(@conference.short_title), method: :delete, class: 'btn btn-danger btn-xs',
129+
= link_to t('Unregister'), conference_conference_registration_path(@conference.short_title), method: :delete, class: 'btn btn-danger btn-xs',
130130
data: { confirm: t("Your ticket purchases won't be refunded") }, disabled: @conference.end_date < Date.today
131131
- else
132-
= link_to 'Unregister', conference_conference_registration_path(@conference.short_title), method: :delete, class: 'btn btn-danger btn-xs',
132+
= link_to t('Unregister'), conference_conference_registration_path(@conference.short_title), method: :delete, class: 'btn btn-danger btn-xs',
133133
data: { confirm: t("You haven't purchased any ticket") }, disabled: @conference.end_date < Date.today
134134
- else
135-
= link_to 'Register', new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-success btn-lg pull-right'
135+
= link_to t('Register'), new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-success btn-lg pull-right'
136136

137137
.row
138138
.col-md-12

app/views/conferences/_code_of_conduct.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
.modal-body
1717
= markdown organization.code_of_conduct
1818
.modal-footer
19-
= link_to 'permalink',
19+
= link_to t('permalink'),
2020
[:code_of_conduct, organization],
2121
target: '_blank'

app/views/conferences/_lodging.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= content_for :splash_nav do
22
%li
3-
%a.smoothscroll{ href: '#lodging' } Lodging
3+
%a.smoothscroll{ href: '#lodging' }= t('Lodging')
44

55
- cache [venue, lodgings, '#splash#lodging'] do
66
%section#lodging

app/views/conferences/_program.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= content_for :splash_nav do
22
%li
3-
%a.smoothscroll{ href: '#program' } Program
3+
%a.smoothscroll{ href: '#program' }= t('Program')
44

55
- cache [conference, highlights, tracks, booths, '#splash#program'] do
66
%section#program
@@ -30,7 +30,7 @@
3030
%p.cta-button.text-center
3131
= link_to(conference_schedule_path(conference.short_title),
3232
class: 'btn btn-success btn-lg') do
33-
Full Schedule
33+
= t('Full Schedule')
3434

3535
- unless booths.blank?
3636
- booths.each do |booth|

app/views/conferences/_sponsors.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= content_for :splash_nav do
22
%li
3-
%a.smoothscroll{ href: '#sponsors' } Sponsors
3+
%a.smoothscroll{ href: '#sponsors' }= t('Sponsors')
44

55
- cache [conference, sponsors, sponsorship_levels, '#splash#sponsors'] do
66
%section#sponsors

app/views/conferences/_tracks.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
- if track.start_date && track.end_date
1414
= date_string(track.start_date, track.end_date)
1515
- if track.room
16-
In #{track.room.name}
16+
= "#{t('in')} #{track.room.name}"
1717
= markdown truncate(track.description, length: 200, separator: ' ')

app/views/layouts/_messages.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
display: none;
55
}
66
%h2
7-
JavaScript is not enabled
7+
= t('JavaScript is not enabled')
88
%p
9-
Moraga requires JavaScript to be enabled to function. Please turn on JavaScript in your browser's settings and reload the page to continue.
9+
= t('Moraga requires JavaScript to be enabled to function. Please turn on JavaScript in your browser\'s settings and reload the page to continue.')
1010
- flash.each do |type, message|
1111
.row
1212
.col-md-12

app/views/layouts/_user_menu.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
= t('Notifications')
55
(#{unread_notifications(current_user).length})
66
- if unread_notifications(current_user).length > 0
7-
%li.dropdown-header Last 5 Comments for:
7+
%li.dropdown-header= t('Last 5 Comments for')
88
- unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments|
99
%li= link_to("#{event.title}(#{comments.count})", admin_conference_program_event_path(event.program.conference.short_title, event.id))
1010
%li.divider

app/views/physical_tickets/index.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
%table.table.table-bordered.table-striped.table-hover#roles
1515
%thead
1616
%tr
17-
%th ID
17+
%th= t('ID')
1818
%th
1919
= t('Type')
2020
%th
@@ -45,6 +45,6 @@
4545
.col-md-12
4646
- if @unpaid_ticket_purchases.any?
4747
.h3
48-
You have unpaid tickets!
48+
= t('You have unpaid tickets!')
4949
%small
5050
= link_to t("Pay them here"), conference_ticket_purchases_path

0 commit comments

Comments
 (0)