-
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
Conversation
aaronskiba
commented
Aug 1, 2023
•
edited
Loading
edited
- Enable missing French translations: Missing front end French translations #404
- Remove duplicate "Sign Up" and "Help" messages in "About Us": Repeated text in Getting started section of /about_us #407
- Fix broken "Help" link: Broken link to /help page #412
Generated by 🚫 Danger |
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.
Maybe refactoring is needed for the array in def self.selectable_subjects
? If the elements didn't contain commas and other symbols, I would've created enum selectable_subject
in class ResearchOutput
. Also, I'm not sure if the prepended XX-
can be removed from each of the array elements.
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.
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.
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.
The changes are looking good! I just have a few questions about the approach for some minor parts of the code.
Looking forward to reading your responses!
"23-#{_('Agriculture, Forestry, Horticulture and Veterinary Medicine')}", | ||
"21-#{_('Biology')}", | ||
"31-#{_('Chemistry')}", | ||
"44-#{_('Computer Science, Electrical and System Engineering')}", | ||
"45-#{_('Construction Engineering and Architecture')}", | ||
"34-#{_('Geosciences (including Geography)')}", | ||
"11-#{_('Humanities')}", | ||
"43-#{_('Materials Science and Engineering')}", | ||
"33-#{_('Mathematics')}", | ||
"41-#{_('Mechanical and industrial Engineering')}", | ||
"22-#{_('Medicine')}", | ||
"32-#{_('Physics')}", | ||
"12-#{_('Social and Behavioural Sciences')}", | ||
"42-#{_('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.
I dont think the hashtag notation will work for this. In previous times we have used the format method so that gettext can identify the keys. Translation gem is using gettext which uses the full string as a key in a hash object to look up the translations. so if a key is missing it wont translate.
So it should be something like _('23-Agriculture, Forestry, Horticulture and Veterinary Medicine')
.
Or you can try something like format("23-%{subject}", subject : _(Agriculture, Forestry, Horticulture and Veterinary Medicine'))
which could make it more general. I am not 100% sure it works though.
Give it a try on the test project and talk with @200455939-yashu .
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.
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.
Actually, although it is getting picked up, this will still probably need to be fixed. When .map do |subject| [subject.split('-').last, subject.gsub('-', ' ')]
is applied to the array, both elements in the array receive the translation. However, subject.gsub('-', ' ')
should not be receiving the translation.
@@ -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 comment
The 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 comment
The 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 comment
The 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 comment
The 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.
Awesome, thank you! Translation.io is a little peculiar so I appreciate any questions/concerns. It looks like all of the proposed changes are currently working for the translations, though. Maybe you'd still prefer for something to be refactored, though? Also, I don't know if you have a preference as to how we should proceed with this #409 (comment)? Thanks! |
Perhaps the best solution would be to add 'enum selectable_subject' to ResearchOutput. That way we could implement the same logic we used for ResearchOuput.output_types and ResearchOutput.accesses.
e42ce36
to
07741d2
Compare
config/locale/app.pot
Outdated
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.
Do we need these files ?
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.
Good question. I want to test the translations in UAT, but there are a few things I'm unsure about:
- Does UAT use the test key or the prod key for translation.io?
- Do I need to provide the po files for UAT deployment?
- When translations are provided to translation.io, are those changes automatically sync'd back to UAT? And if not, should we deploy another UAT instance, or should we execute the
translation:sync
task within the existing UAT instance?
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.
As per my knowledge,
- UAT uses the prod key.
- No, PO files are not needed for the UAT deployment.
- Everything available in Translation.io are directly available to the UAT.
Or so I thought, haha. There was an issue that was addressed with the following commit: 07741d2 Also, sorry, I have a question here: #409 (comment) |
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.
Good work
This reverts commit 1a00675.
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.
Great work @aaronskiba , I found some very minor changes that we can make and then it will be good to go.
@@ -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 comment
The 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.
CHANGELOG.md
Outdated
|
||
- Removed repeated "Sign-up" and "Help" text in "About Us" [#407](https://github.com/portagenetwork/roadmap/issues/407) | ||
|
||
- Fixed broken "Help" link [402](https://github.com/portagenetwork/roadmap/issues/412) |
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.
@@ -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 comment
The 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?
The commented out code is related to issue #407. It was decided that the commented code is what will be removed.
Hi @lagoan, I did the changelog cleanup. Also, after discussing the repeated About Us text with @isawil, the commented-out code is what we will not be keeping. As a result, it has been removed. |
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.