Skip to content
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

Translate actions in articles view #14911

Merged

Conversation

mtayllan
Copy link
Contributor

@mtayllan mtayllan commented Oct 3, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This add Internationalization to the actions that are displayed at left of an article.

Related Tickets & Documents

https://dev.to/devteam/forem-hacktoberfest-let-s-internationalize-404n
#14888

QA Instructions, Screenshots, Recordings

image
image

UI accessibility concerns?

None

Added/updated tests?

  • Yes
  • No, and this is why: existing regression tests should suffice
  • I need help with writing tests

@mtayllan mtayllan requested a review from a team as a code owner October 3, 2021 23:16
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 3, 2021
@CLAassistant
Copy link

CLAassistant commented Oct 3, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2021

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution, just some minor comments.

@@ -5,23 +5,23 @@
<%= render partial: "articles/reaction_button",
locals: {
category: :like,
description: "Heart",
description: t("core.heart"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should eventually start using namespaced keys more, I'd suggest core.reactions.heart, etc.

app/views/articles/_actions.html.erb Show resolved Hide resolved
@@ -57,9 +58,12 @@ en:
read_next: "Read next"
reply: "Reply"
report_abuse: "Report abuse"
save: Save
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's strictly speaking not necessary, we opted for quoting all strings in our translation files, please keep it this way. This also avoids some issues with YAML's implicit typing, e.g.

YAML.load("- yes\n- maybe\n- no")
#=> [true, "maybe", false]

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 5, 2021
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 5, 2021
@rhymes
Copy link
Contributor

rhymes commented Oct 5, 2021

Hi @mtayllan, I took the liberty to fix the conflict and merge main in

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 6, 2021
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 6, 2021
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mtayllan!

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 6, 2021
@rhymes
Copy link
Contributor

rhymes commented Oct 6, 2021

@citizen428 @mtayllan for some reason specs are failing because Cypress is seeing the text in French but the test code expects them in English:

https://app.travis-ci.com/github/forem/forem/jobs/541750706#L2527

Screenshot 2021-10-06 at 18 42 05

it's quite odd :D

@mtayllan
Copy link
Contributor Author

mtayllan commented Oct 6, 2021

@citizen428 @mtayllan for some reason specs are failing because Cypress is seeing the text in French but the test code expects them in English:

https://app.travis-ci.com/github/forem/forem/jobs/541750706#L2527

it's quite odd :D

The last merge from main changed the translation in the en.yml
image

I'll fix that

@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 6, 2021
@citizen428 citizen428 merged commit fc77376 into forem:main Oct 7, 2021
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: unreviewed bot applied label for PR's with no review labels Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants