-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aaron/issues/translation #409
Changes from 13 commits
e6f83a3
c72eb12
14a7afe
13933f4
a0d8a44
1a62806
633d8a0
115e0ac
4fe1918
cd8ab7f
07741d2
57f5d25
1a00675
383accf
523bac1
41a8140
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe refactoring is needed for the array in |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,13 @@ def initialize(research_output:) | |
# Returns the output_type list for a select_tag | ||
def selectable_output_types | ||
ResearchOutput.output_types | ||
.map { |k, _v| [k.humanize, k] } | ||
.map { |k, _v| [_(k.humanize), k] } # k.humanize is sync'd to translation.io via _research_output.erb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like how you are referencing where we need to look for the translations in case we ever need to update them. |
||
end | ||
|
||
# Returns the access options for a select tag | ||
def selectable_access_types | ||
ResearchOutput.accesses | ||
.map { |k, _v| [k.humanize, k] } | ||
.map { |k, _v| [_(k.humanize), k] } # k.humanize is sync'd to translation.io via _research_output.erb | ||
end | ||
|
||
# Returns the options for file size units | ||
|
@@ -54,6 +54,7 @@ def byte_sizable? | |
end | ||
|
||
# Returns the options for subjects for the repository filter | ||
# rubocop:disable Metrics/AbcSize | ||
def self.selectable_subjects | ||
[ | ||
'23-Agriculture, Forestry, Horticulture and Veterinary Medicine', | ||
|
@@ -71,7 +72,8 @@ def self.selectable_subjects | |
'12-Social and Behavioural Sciences', | ||
'42-Thermal Engineering/Process Engineering' | ||
].map do |subject| | ||
[subject.split('-').last, subject.gsub('-', ' ')] | ||
# subject.split('-').last is sync'd to translation.io via _research_output.erb | ||
[_(subject.split('-').last), subject.gsub('-', ' ')] | ||
end | ||
end | ||
|
||
|
@@ -85,7 +87,7 @@ def self.selectable_repository_types | |
end | ||
|
||
# Converts the byte_size into a more friendly value (e.g. 15.4 MB) | ||
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity | ||
# rubocop:disable Metrics/CyclomaticComplexity | ||
def converted_file_size(size:) | ||
return { size: nil, unit: 'mb' } unless size.present? && size.is_a?(Numeric) && size.positive? | ||
return { size: size / 1.petabytes, unit: 'pb' } if size >= 1.petabytes | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This remedies issue #407. No translations are currently available for the "Sign up" and "Help" messages I commented out here. Otherwise, I probably would've kept them and commented out the other "Sign up" and "Help" messages. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,10 +34,11 @@ | |
|
||
<h2 class="fontsize-h3"><%= _('Getting started') %></h2> | ||
|
||
<p><%= _("If you have an account please sign in and start creating or editing your DMP.") %></p> | ||
<p><%= _("If you have an account, please sign in and start creating or editing your DMP.") %></p> | ||
<!-- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, why are we commenting out this next part? If we don't need it we should remove it, but it looks like this code is something we do want here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All good. This related to #407. Currently, the "Sign Up" and "Help" messages are repeated in the "Getting Started" section of the "About Us" page https://assistant.portagenetwork.ca/about_us. I'm thinking we'll need to remove one of the "Sign Up" messages and one of the "Help" messages. But I actually prefer the code I commented out in comparison to what I kept. However, translations aren't currently available for the code that I do prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can double-check with @isawil to see which copy we like best. We can leave just one instead of waiting for the translation for the missing piece. Does this make sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, yes, that makes sense. I'll verify which one we should keep. |
||
<p><%= _("If you do not have a %{application_name} account, click on") % {application_name: ApplicationService.application_name} %> <a href="<%= root_path %>"><%= _('Sign up') %></a> <%= _("on the homepage.") %></p> | ||
lagoan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<p><%= _("Please visit the") %> <a href="<%= help_path %>"><%= _('Help') %></a> <%= _("page for guidance.") %></p> | ||
|
||
--> | ||
<p> | ||
<% sign_up_url = request.base_url %> | ||
<%= sanitize(_('If you do not have a DMP Assistant account, click on <a href="%{sign_up_url}"> \'Sign up\' </a> on the homepage.') % { sign_up_url: sign_up_url} ) %> | ||
|
@@ -48,8 +49,8 @@ | |
</p> | ||
|
||
<p> | ||
<% help_url = "help_url" %> | ||
<%= sanitize(_('Please visit the <a href="%{help_url}"> \'Help\' </a> page for guidance.') % {help_url: help_url}) %> | ||
<% help_url = help_path %> | ||
<%= sanitize(_('Please visit the <a href="%{help_url}"> \'Help\' </a> page for guidance.') % {help_url: help_path}) %> | ||
</p> | ||
|
||
<h2 class="fontsize-h3"><%= _('Feedback') %></h2> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,42 @@ | ||
|
||
<%= | ||
|
||
# output_type | ||
_('Audiovisual') | ||
_('Collection') | ||
_('Data_paper') | ||
_('Data paper') | ||
_('Dataset') | ||
_('Event') | ||
_('Image') | ||
_('Interactive_resource') | ||
_('Model_representation') | ||
_('Physical_object') | ||
_('Interactive resource') | ||
_('Model representation') | ||
_('Physical object') | ||
_('Service') | ||
_('Software') | ||
_('Sound') | ||
_('Text') | ||
_('Workflow') | ||
_('Other') | ||
|
||
# access | ||
_('Open') | ||
_('Embargoed') | ||
_('Restricted') | ||
_('Closed') | ||
|
||
# selectable_subjects | ||
_('Agriculture, Forestry, Horticulture and Veterinary Medicine') | ||
_('Biology') | ||
_('Chemistry') | ||
_('Computer Science, Electrical and System Engineering') | ||
_('Construction Engineering and Architecture') | ||
_('Geosciences (including Geography)') | ||
_('Humanities') | ||
_('Materials Science and Engineering') | ||
_('Mathematics') | ||
_('Mechanical and industrial Engineering') | ||
_('Medicine') | ||
_('Physics') | ||
_('Social and Behavioural Sciences') | ||
_('Thermal Engineering/Process Engineering') | ||
%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change, add the # simbol to the link.