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

Fixed inline translation function call with translate(key, {}, html) #9787

Merged
merged 6 commits into from
Jun 14, 2021

Conversation

imajit
Copy link
Contributor

@imajit imajit commented Jun 12, 2021

Part of #9686
Translation function needs to be called with false parameter in cases where it is called inside HTML tags.

@imajit imajit requested review from a team as code owners June 12, 2021 20:08
@gitpod-io
Copy link

gitpod-io bot commented Jun 12, 2021

@codeclimate
Copy link

codeclimate bot commented Jun 12, 2021

Code Climate has analyzed commit 51ceaaa and detected 0 issues on this pull request.

View more on Code Climate.

@codecov
Copy link

codecov bot commented Jun 12, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@c76e485). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9787   +/-   ##
=======================================
  Coverage        ?   82.07%           
=======================================
  Files           ?       98           
  Lines           ?     5940           
  Branches        ?        0           
=======================================
  Hits            ?     4875           
  Misses          ?     1065           
  Partials        ?        0           

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

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

Just a note on the parameter simplicity. I was also wondering -- can you add to the translation documentation in the README to clarify the usage of this new parameter? Again it's fine to do this in another PR -- but if you can add an item to your planning issue in #9686 that would be great. Thank you!!!

<div class="dropdown-menu">
<div class="dropdown-item">
<a style="margin-top:-8px;" rel="tooltip" title="<%= translation('tag.show.blog_updates') %>" href="/subscribe/tag/blog">
<a style="margin-top:-8px;" rel="tooltip" title="<%= translation('tag.show.blog_updates',{},false) %>" href="/subscribe/tag/blog">
Copy link
Member

Choose a reason for hiding this comment

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

Hi @imajit this is looking really nice! I wonder if it's possible to simplify the parameters and omit the {} by checking if options == true OR by using translation(key, {html: true}) for some slightly shorter cleaner syntax? This could definitely be done in follow-up, as this PR looks good. Are there any other places where this is used and where it would need to be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll change the syntax to make it more clear.
I think I have changed all the occurrences. If I find any new ones I'll make ftos to change them.

@jywarren jywarren changed the title Fixed inline translation function call Fixed inline translation function call with translate(key, {}, html) Jun 14, 2021
@jywarren jywarren merged commit 9e7c99d into publiclab:main Jun 14, 2021
@imajit
Copy link
Contributor Author

imajit commented Jun 14, 2021

Just a note on the parameter simplicity. I was also wondering -- can you add to the translation documentation in the README to clarify the usage of this new parameter? Again it's fine to do this in another PR -- but if you can add an item to your planning issue in #9686 that would be great. Thank you!!!

Sure, will add documentation about the updates in the function.

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
…ubliclab#9787)

* Adding some more corrected tags

* Changed translation function

* Changed all translation function inside html tag

Co-authored-by: imajit <[email protected]>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
…ubliclab#9787)

* Adding some more corrected tags

* Changed translation function

* Changed all translation function inside html tag

Co-authored-by: imajit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants