Skip to content

Commit

Permalink
Merge pull request #449 from portagenetwork/aaron/issues/411
Browse files Browse the repository at this point in the history
Enable Missing Translations
  • Loading branch information
aaronskiba authored Sep 26, 2023
2 parents cf41028 + 5b7f2be commit 2d0c91d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- Fixed landing page content and links for fr-CA locale [#405](https://github.com/portagenetwork/roadmap/pull/405)

- Address missing French translations throughout application [#404](https://github.com/portagenetwork/roadmap/issues/404)
- Address missing French translations throughout application [#404](https://github.com/portagenetwork/roadmap/issues/404) and [#411](https://github.com/portagenetwork/roadmap/issues/411)

- Removed repeated "Sign-up" and "Help" text in "About Us" [#407](https://github.com/portagenetwork/roadmap/issues/407)

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/super_admin/orgs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def merge_commit

if @target_org.present?
if @target_org.merge!(to_be_merged: @org)
msg = "Successfully merged '#{@org.name}' into '#{@target_org.name}'"
msg = format(_("Successfully merged '%{org}' into '%{target_org}'."), org: @org.name,
target_org: @target_org.name)
redirect_to super_admin_orgs_path, notice: msg
else
msg = _('An error occurred while trying to merge the Organisations.')
Expand Down
18 changes: 9 additions & 9 deletions app/models/org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,18 @@ def locale
# Tests are setup currently to work with this issue.
#
# Returns String
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize
def org_type_to_s
ret = []
ret << 'Institution' if institution?
ret << 'Funder' if funder?
ret << 'Organisation' if organisation?
ret << 'Research Institute' if research_institute?
ret << 'Project' if project?
ret << 'School' if school?
(ret.empty? ? 'None' : ret.join(', '))
ret << _('Institution') if institution?
ret << _('Funder') if funder?
ret << _('Organisation') if organisation?
ret << _('Research Institute') if research_institute?
ret << _('Project') if project?
ret << _('School') if school?
(ret.empty? ? _('None') : ret.join(', '))
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize

def funder_only?
org_type == Org.org_type_values_for(:funder).min
Expand Down
2 changes: 1 addition & 1 deletion app/views/guidances/new_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end
<%= form_for(@guidance, url: url, html: { method: method , id: 'new_edit_guidance'}) do |f| %>
<div class="form-group" data-toggle="tooltip" title="<%= guidance_text_tooltip %>">
<em class="sr-only"><%= guidance_text_tooltip %></em>
<%= f.label :text, class: 'control-label' %>
<%= f.label(:text, _('Text'), class: "control-label") %>
<%= f.text_area :text, rows: 10, class: "form-control", spellcheck: true,
aria: { required: true } %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/paginable/orgs/_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<td><%= org.contact_email %></td>
<td><%= org.org_type_to_s %></td>
<td><%= org.template_count %></td>
<td><%= org.managed? ? "Yes" : "No" %></td>
<td><%= org.managed? ? _('Yes') : _('No') %></td>
<td>
<div class="dropdown">
<button
Expand Down
3 changes: 2 additions & 1 deletion app/views/super_admin/notifications/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<div class="form-group col-xs-2">
<%= f.label :level, _('Level'), class: 'control-label' %>
<%= f.select :level,
Notification.levels.keys.map { |l| [l.humanize, l] },
# l.humanize is sync'd to translation.io via _notification.erb
Notification.levels.keys.map { |l| [_(l.humanize), l] },
{ value: @notification.level },
{ class: 'form-control',
data: { toggle: 'tooltip', html: true }, title: _('<strong>Info:</strong> Simple information message, displayed in blue.<br/><strong>Warning:</strong> warning message, for signaling something unusual, displayed in orange.<br/><strong>Danger:</strong> error message, for anything critical, displayed in red') } %>
Expand Down
8 changes: 8 additions & 0 deletions app/views/translation_io_exports/_notification.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

<%=

# level
_('Info')
_('Warning')
_('Danger')
%>

0 comments on commit 2d0c91d

Please sign in to comment.