plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Change function t to translation in app/views/notes/_card.html.erb

Open nicoleiocana opened this issue 6 years ago • 31 comments

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • [ ] 🙋 Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!

  • [ ] 📝 Update the file app/views/notes/_card.html.erb in the plots2 repository (press the little pen Icon) and edit the line as shown below.

See this page for some help in taking your first steps!

Below is a "diff" showing in red (and a -) which lines to remove, and in green (and a +) which lines to add:

- 16: <%= t('notes._notes.moderate_first_time_post') %> <br class="d-none d-lg-inline"/>
+ 16: <%= translation('notes._notes.moderate_first_time_post') %> <br class="d-none d-lg-inline"/>

- 17: <a class="btn btn-outline-secondary btn-sm" href="/moderate/publish/<%= node.id %>"><%= t('notes._notes.approve') %></a>
+ 17: <a class="btn btn-outline-secondary btn-sm" href="/moderate/publish/<%= node.id %>"><%= translation('notes._notes.approve') %></a>

- 18: <a class="btn btn-outline-secondary btn-sm" data-test="spam" href="/moderate/spam/<%= node.id %>"><%= t('notes._notes.spam') %></a>
+ 18: <a class="btn btn-outline-secondary btn-sm" data-test="spam" href="/moderate/spam/<%= node.id %>"><%= translation('notes._notes.spam') %></a>

- 20: <%= raw t('notes._notes.pending_approval', :url1 => '/wiki/moderation') %>
+ 20: <%= raw translation('notes._notes.pending_approval', :url1 => '/wiki/moderation') %>

- 49: <li><a>Last Edited: <%= t('notes._notes.last_edit_by') %> <a <% if @widget %>target="_blank"<% end %> href="/profile/<%= node.latest.author.name %>"><%= node.latest.author.name %></a></a></li>
+ 49: <li><a>Last Edited: <%= translation('notes._notes.last_edit_by') %> <a <% if @widget %>target="_blank"<% end %> href="/profile/<%= node.latest.author.name %>"><%= node.latest.author.name %></a></a></li>

- 52: <li><a>Total Views: </i> <%= number_with_delimiter(node.views) %> <span class="d-none d-lg-inline"><%= t('notes._notes.views') %></span></a></li>
+ 52: <li><a>Total Views: </i> <%= number_with_delimiter(node.views) %> <span class="d-none d-lg-inline"><%= translation('notes._notes.views') %></span></a></li>

- 57: <li class="buttons mb-2"><% if @current_user && ['admin','moderator'].include?(@current_user.role) %><a style="width: 90px" class="btn btn-outline-secondary" href="/moderate/spam/<%= node.id %>"><i class="fa fa-ban"></i> <%= t('notes._notes.spam') %></a><% end %></li>
+ 57: <li class="buttons mb-2"><% if @current_user && ['admin','moderator'].include?(@current_user.role) %><a style="width: 90px" class="btn btn-outline-secondary" href="/moderate/spam/<%= node.id %>"><i class="fa fa-ban"></i> <%= translation('notes._notes.spam') %></a><% end %></li>

- 58: <li class="buttons"><a class="btn btn-outline-secondary" href="<%= node.path %>"><%= t('notes._notes.read_more') %></a></li>
+ 58: <li class="buttons"><a class="btn btn-outline-secondary" href="<%= node.path %>"><%= translation('notes._notes.read_more') %></a></li>

- 61: <a class="btn btn-outline-secondary" href="#"><i class="fa fa-ban-circle"></i> <%= t('notes._notes.spam') %></a>
+ 61: <a class="btn btn-outline-secondary" href="#"><i class="fa fa-ban-circle"></i> <%= translation('notes._notes.spam') %></a>
  • [ ] 💾 Commit your changes

  • [ ] 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • [ ] 🏁 Done Ask in comments for a review :)

Please keep us updated

💬⏰ - We encourage contributors to be respectful to the community and provide an update within a week of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need if you update us with a request for more time or help, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!

If this happens to you, don't sweat it! Grab another open issue.

Is someone else already working on this?

🔗- We encourage contributors to link to the original issue in their pull request so all users can easily see if someone's already started on it.

👥- If someone seems stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

🤔❓ Questions?

Leave a comment below!

nicoleiocana avatar Mar 28 '20 21:03 nicoleiocana

Hello @nicoleiocana , i wish to do this issue.

Angelvicks avatar Apr 03 '20 05:04 Angelvicks

@Angelvicks Hello. Your wish has been granted; the issue is now yours to do. Good luck.

nicoleiocana avatar Apr 03 '20 09:04 nicoleiocana

Thanks @nicoleiocana

Angelvicks avatar Apr 03 '20 20:04 Angelvicks

Hi @nicoleiocana , can I claim this issue? If it is still open

Alpha-yoyo avatar Apr 04 '20 21:04 Alpha-yoyo

Yes you may. I read the that Angelvicks contributed to a different issue. This one is re-assigned to you.

nicoleiocana avatar Apr 04 '20 21:04 nicoleiocana

Thank you

Alpha-yoyo avatar Apr 04 '20 21:04 Alpha-yoyo

Hi @nicoleiocana can you review my pull request? https://github.com/publiclab/plots2/pull/7783 Thank you

Alpha-yoyo avatar Apr 04 '20 21:04 Alpha-yoyo

This issue is now available for anyone who wishes to contribute for their first time.

nicoleiocana avatar Apr 05 '20 18:04 nicoleiocana

#7792 That's my pull request for this issue. Thanks

Angelvicks avatar Apr 07 '20 09:04 Angelvicks

@Angelvicks Your PR is failing on one of the checks. This is why your update has not been accepted and merged into the master branch. Until you fix this concern, this issue will still be open. You will need to run the command git rebase master which is why I suspect your PR fails one of the reviews.

nicoleiocana avatar Apr 07 '20 15:04 nicoleiocana

Hey @nicoleiocana , is this issue still open or does #7783 solves it? If it's open, can I claim it?

tinfoil-knight avatar Apr 10 '20 14:04 tinfoil-knight

@tinfoil-knight well, #7783 was closed by the contributor. I reached out to @Angelvicks to fix #7792 so that it can be approved, but I receive no reply. Since it seems that enough time has passed to be fair, yes, you can claim it. Good luck🎉

nicoleiocana avatar Apr 10 '20 14:04 nicoleiocana

Don't review #7804. It was not passing the build tests.

tinfoil-knight avatar Apr 10 '20 17:04 tinfoil-knight

I see that you closed it. You may have preemptively closed it. Sometimes your code is 100% accurate, but the issue is on their end. This happened to me regarding the same incident -> the Travis-CI was the culprit, not my PR. The reviewers and maintainers will most likely look into this because it seems as if the code is correct...

nicoleiocana avatar Apr 10 '20 17:04 nicoleiocana

I made another PR #7805 . Hopefully it won't fail the same. I followed the Git Workflow as mentioned step-by-step to prevent any bugs.

Edit: Failed again. What now?

tinfoil-knight avatar Apr 10 '20 17:04 tinfoil-knight

If you click on the https://travis-ci.org/github/publiclab/plots2/jobs/673510196 link, at line 1868, it summarized where the failure occurs. When I get the chance, I'll look into the unit test to get a better understanding of why it is failing.

nicoleiocana avatar Apr 10 '20 17:04 nicoleiocana

test 'that NodeShared can be used to convert short codes like [nodes:grid:foo] into tables which list nodes with image thumbnails' do
    before = "Here are some notes in a table: \n\n[nodes:grid:test] \n\nThis is how you make it work:\n\n`[nodes:grid:tagname]`\n\n `[nodes:grid:tagname]`\n\nMake sense?"
    html = NodeShared.nodes_thumbnail_grid(before)
    assert html
    assert_equal 1, html.scan('<div class="thumbnail-grid">').length
    assert_equal 4, html.scan('h5').length
  end

The test only asserts the length of certain content but the error is related to change in naming from t to translation. I don't have much experience with testing in Ruby yet. I'll look it up and see what I can do meanwhile.

tinfoil-knight avatar Apr 10 '20 17:04 tinfoil-knight

This issue is open!

govindgoel avatar Apr 17 '20 19:04 govindgoel

Hi @nicoleiocana @govindgoel , I'd like to give this issue a try if that's ok with you

adumortier avatar May 16 '20 23:05 adumortier

@adumortier Of course! Give it a go! The issue is all yours.

nicoleiocana avatar May 16 '20 23:05 nicoleiocana