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

views/notifications i18n #15056

Merged
merged 15 commits into from Oct 25, 2021
Merged

Conversation

yheuhtozr
Copy link
Contributor

@yheuhtozr yheuhtozr commented Oct 13, 2021

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

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

Description

Extracts strings for i18n from app/views/notifications and related files. Attached fr locale for testing purposes. Existing translations up to #15002 reflected (hopefully).

Related Tickets & Documents

Relates to #14888

QA Instructions, Screenshots, Recordings

UI accessibility concerns?

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[Forem core team only] How will this change be communicated?

Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.

  • I've updated the Developer Docs or
    Storybook (for Crayons components)
  • This PR changes the Forem platform and our documentation needs to be
    updated. I have filled out the
    Changes Requested
    issue template so Community Success can help update the Admin Docs
    appropriately.
  • I've updated the README or added inline documentation
  • I've added an entry to
    CHANGELOG.md
  • I will share this change in a Changelog
    or in a forem.dev post
  • I will share this change internally with the appropriate teams
  • I'm not sure how best to communicate this change and need help
  • This change does not need to be communicated, and this is why not: this is ongoing work related to a large, ongoing initiative.

[optional] Are there any post deployment tasks we need to perform?

N/A

[optional] What gif best describes this PR or how it makes you feel?

alt_text

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 13, 2021
@github-actions
Copy link
Contributor

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!

@juliannatetreault
Copy link
Contributor

Hey @yheuhtozr! 👋 Can you please update your branch with the latest code from the repository’s main branch? i18n files weren’t being loaded properly and we have merged a fix for this. Thanks so much in advance and please do not hesitate to reach out if you need help!

@yheuhtozr yheuhtozr force-pushed the patch-notifications-i18n-14888 branch 2 times, most recently from f38f928 to 6e31b17 Compare October 15, 2021 10:42
@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 19, 2021
@yheuhtozr yheuhtozr requested review from a team and Ridhwana and removed request for a team October 19, 2021 14:52
Copy link
Contributor

@fdocr fdocr left a comment

Choose a reason for hiding this comment

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

Hi @yheuhtozr thanks for the PR!

This LGTM except for the conflict that was there. I just pushed a tiny fix for that last file to hopefully trigger the Travis build that seems stuck. Once all checks pass it should be good to merge 😃

@fdocr fdocr closed this Oct 19, 2021
@fdocr fdocr reopened this Oct 19, 2021
@yheuhtozr yheuhtozr force-pushed the patch-notifications-i18n-14888 branch from bd56234 to 2e20164 Compare October 20, 2021 00:05
@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 20, 2021
@yheuhtozr
Copy link
Contributor Author

@fdoxyz Thank you for the commit and the error report. I had to repush everything again to fix the error that makes Travis stop, due to my workflow. The conflict is technically resolved too except GitHub doesn't think so because it was operated outside GH. I hope whoever merges this can simply accept all changes from my side before merging.

@fdocr fdocr closed this Oct 20, 2021
@fdocr fdocr reopened this Oct 20, 2021
@djuber
Copy link
Contributor

djuber commented Oct 20, 2021

The CI tests may not be running because of the merge conflict - and that looks like it's related to conflicting updates in main from #15043 that used core strings (like core.comments) in the nav menu partial, where the same changes are being made in this branch to use view specific translations in the views.notifications.nav namespace.

I think it makes sense to keep the existing core.* names where they're present in main?

There's one conflict around the aria label for the nav tag - as we're localizing labels elsewhere your branches change makes sense, but the other conflicts (same data, but differing path between core and view specific namespaces) are probably reasonable to keep with the main branches version. My reasoning here is that these are global vocabulary about the app, rather than view specific strings ("Comments" is a larger concept than just the notification view, for example) and avoids requiring multiple updates if something changes in the future.

@yheuhtozr
Copy link
Contributor Author

yheuhtozr commented Oct 21, 2021

@djuber

My reasoning here is that these are global vocabulary about the app, rather than view specific strings ("Comments" is a larger concept than just the notification view, for example)

This is the exact reason I want to separate them into each namespace. I have already cut off a lot, but those core strings tend to be used in multiple contexts where the same word form is luckily applicable to every instance both in English and French (which are very similar in the global perspective), and could immediately fail in other languages.

For example you have "all"; all what? If you mean "all comments", všechny, but "all notifications", všechna in Czech.

You don't have to follow my namespace, but you have to split it up somehow.

@yheuhtozr
Copy link
Contributor Author

yheuhtozr commented Oct 21, 2021

@djuber On second thoughts, perhaps your idea of "global vocabulary" should be materialized as a glossary or style guide, which you can just put dictionary forms in and translators know how to inflect them according to the context, rather than the actual translations directly inserted into UI.

@citizen428
Copy link
Contributor

I resolved the merge conflicts now. However, I'm holding off on hearing back from @djuber regarding the global vocabulary discussion above.

@@ -23,6 +23,6 @@ def message_user_acted_maybe_org(data, action, if_org: "")
)
else
I18n.t(action, user: key_to_link.call("user"))
end.html_safe
end.html_safe # rubocop:disable Rails/OutputSafety
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There seems a peculiar phenomenon that a rubocop comment angers a spec test which previously passed. But otherwise I don't think the line would pass the husky check.

@citizen428 citizen428 merged commit cdedbc1 into forem:main Oct 25, 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 25, 2021
citizen428 added a commit that referenced this pull request Oct 29, 2021
* views/notifications etc i18n

* notifications PR fixes

* remove ja.yml

* Update en.yml

* Update fr.yml

* Update en.yml

* Update fr.yml

* Update _comment.html.erb

* Update _comment.html.erb

* Update notifications_helper.rb

* Update notifications_helper.rb

* Update notifications_helper.rb

* Update notifications_helper.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>
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

5 participants