Plots2: Error in transifex translation()

Created on 18 Nov 2019  Â·  15Comments  Â·  Source: publiclab/plots2

Hi @gauravano @cesswairimu @nstjean I wanted to see if the three of you might be able to figure out this

https://github.com/publiclab/plots2/blob/master/config/locales/en.yml#L205 looks pretty simple.

But it's causing this oddity:

image

Here's the line of code; we swapped t( for translation(

https://github.com/publiclab/plots2/blob/a5d3392c3d6f5f4daaa56d5a4431e1bc0de5c46c/app/views/notes/_comments.html.erb#L4

In this PR: https://github.com/publiclab/plots2/pull/6766/files

Do we need to use <%=raw %> so that any HTML that's replaced gets better formatted? Or, what is going on here?

Thanks all!!!

bug help wanted high-priority

All 15 comments

Uff, here's another related error further down the same page!!!

image

That's on this page!

Oh dear!! I'm taking a look at that page, I'm not seeing an error on my PC or mobile! So I'm not sure why it would be showing only sometimes?

FireShot Capture 013 - 🎈 Public Lab_ Fall Workshops in NYC- Oil   Gas - publiclab org

Oh hm, do you think it only happens when you're using another language? You
can switch in the footer...

On Mon, Nov 18, 2019 at 5:56 PM Natalie St Jean notifications@github.com
wrote:

Oh dear!! I'm taking a look at that page, I'm not seeing an error on my PC
or mobile! So I'm not sure why it would be showing only sometimes?

[image: FireShot Pro Screen Capture #023 - 'Arrow Down Icon I Font
Awesome' - fontawesome_com]
https://user-images.githubusercontent.com/49460529/69101032-85ed9480-0a2c-11ea-8bf5-912ef875348f.png

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/6807?email_source=notifications&email_token=AAAF6J5N6WVX4ALABTMG6ULQUMMPJA5CNFSM4JO2SFI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEMGYWI#issuecomment-555248729,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAF6J25FPYUE5WZ2GT6PQTQUMMPJANCNFSM4JO2SFIQ
.

For me it looks the same under any language. Hmm. But nothing on the page changes to a translated text, is that normal?

Like @nstjean, I also cannot replicate this....which page is this @jywarren?

@ebarry do you see it? I see it when set to Spanish, and saw it on my laptop and phone. But when I switch to English it's fine!

Yes, i can replicate it on that page. It's also happening in a couple other places, mostly where the translation overlaps a button or some other HTML.

image

I wonder if the translation helper itself needs a <%=raw %> or .html_safe to stop the HTML from getting flattened?

https://github.com/publiclab/plots2/blob/1e0eba7eb917784717cccc19783fee250a1d2d99/app/helpers/application_helper.rb#L140-L151

https://apidock.com/rails/String/html_safe

Actually it recommends using raw() on the string, which marks it as safe to not escape. Let's try that.

Noting that to switch languages locally is /change_locale/es (for spanish)

hmm, i can't seem to switch locally... strange. can anyone else? As this is a priority, maybe we should go ahed and implement this as it's a pretty small change. I don't like publishing it without being able to check, though.

Unfortunately the staging and unstable servers are down, will fix them thursday with luck.

https://github.com/publiclab/plots2/pull/6813 - if anyone can try this out that'd be great!

I'm going to give it a try!!!

Fingers crossed!

Solved! Thanks, all!!!

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

milaaraujo picture milaaraujo  Â·  3Comments

grvsachdeva picture grvsachdeva  Â·  3Comments

keshavsethi picture keshavsethi  Â·  3Comments

RuthNjeri picture RuthNjeri  Â·  3Comments

milaaraujo picture milaaraujo  Â·  3Comments