-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Two translation helper errors on profile pages (one left) #10765
Comments
@jywarren I am unable to see this error on https://publiclab.org/profile/warren (screenshot below), even though I've joined the translation team. |
@KarishmaVanwari You need to change the site's language to one that doesn't have a lot of translations. For example: Deutsch |
Okay, thank you @TildaDares |
Hey @TildaDares, can I try my hands on this issue? |
Go ahead @KarishmaVanwari |
Hi @KarishmaVanwari how did that go, were you able to reproduce this? I can try to help if not! |
Hey @jywarren, I was still unable to reproduce the error, could you please help me out? |
@KarishmaVanwari Was if on the live site or your local environment that you couldn’t reproduce the bug? |
@TildaDares On the live site. I've successfully reproduced the bug locally. |
Hi @jywarren, @KarishmaVanwari, @KarishmaVanwari I think with this solution you should be able to resolve the second error. |
Great work figuring this all out! Very much appreciated @TildaDares and @KarishmaVanwari 🎉 |
Hi @KarishmaVanwari - I noticed this small error on profile pages with translations: https://publiclab.org/profile/carmen2x I think it's returning a more structured associative array (or hash, i think the Ruby term is) of counts per type, instead of just a number. The code is here: https://github.com/publiclab/plots2/blame/main/app/views/tag/_profileCard.html.erb#L27-L29 I'm not sure we fixed that one... @TildaDares what do you think? Maybe when I confirmed it in stable, it didn't have a translation turned on? Stable is offline right now but will be back up pretty soon so we can check, but locally we can check by changing the language and looking at that page. If the issue persists, I think we may need to do something like: |
@jywarren I think that line works fine, it's a lack of translation for those phrases that causes that issue. If you change the language to French, everything works great and that's because we only have translations for those phrases in French. Lines 342 to 350 in 112f789
That was the same thing that happened to the |
Ah, thanks @TildaDares and sorry to miss this. I think we need to fix the logic for when there is no translation: plots2/app/views/tag/_profileCard.html.erb Lines 27 to 29 in 3b7222e
See how it looks here: |
The Translation helper is supposed to insert a little globe icon for some users, where you can contribute missing translations.
Learn about the translation system at:
Unfortunately it is broken in a few places:
To see this yourself, you have to log in, join the translation team at https://publiclab.org/wiki/translation, and visit https://publiclab.org/profile/warren or another profile page.
What's wrong?
Note that to the right side it says
Joined %{time_ago}
- something must be going wrong with this line of code:plots2/app/views/users/profile.html.erb
Line 63 in 7de0bb0
Also, in the left column under "Remembering Tonawanda" it says:
{:one=>"1 note", :other=>"%{count} notes"} | {:one=>"1 question", :other=>"%{count} questions"} | {:one=>"1 comment", :other=>"%{count} comments"} by @warren
That leads to this line of code:
plots2/app/views/tag/_profileCard.html.erb
Lines 27 to 30 in 7de0bb0
There, I think we are passing back a hash instead of a number... somehow we're misusing the helper, which can be found here:
plots2/app/helpers/application_helper.rb
Lines 157 to 170 in a54bf46
This is a pretty complex pair of issues. I'm not sure how easy they will be to fix -- so we're hoping for someone with a little Ruby experience to help out here! Thanks!
The text was updated successfully, but these errors were encountered: