rubyforgood / rubyforgood/Flaredown
non-english browsers for existing accounts using "en" translations are missing all labels
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 50
- Forks
- 21
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 16
Description
To fix this, re-add fallback to english for missing translations
Code I ran to fix this for one "de" user
user.checkins.last.symptoms.map { |x| Symptom::Translation.find_by(symptom_id: x.symptom_id).name } # ["HWS", "Hände", "Ohrenweh"]
user.checkins.last.symptoms.map { |x| Symptom::Translation.find_by(symptom_id: x.symptom_id).update!(locale: "de") } # not "de" specific
user.checkins.last.treatments.flat_map { |x| Treatment::Translation.where(treatment_id: x.treatment_id).flat_map(&:name) }
user.checkins.last.treatments.map do |x|
tt = Treatment::Translation.find_by(treatment_id: x.treatment_id)
new_tt = tt.dup
new_tt.locale = "de"
new_tt.save!
end
This is the cause of this bug report:
Everything works better now, the only issue I still have is that I don’t see my treatments in the history anymore. They are also not visible in menu below. Any advise?
Add reaction
loganmerriam 😎@Galatea hmm, I'll make a ticket for contributors to look into. I'm seeing them on my account right now so it must not be 100% universal which makes it harder to track down the source of the issue.
Add reaction
GalateaThanks, I just realized that only conditions are available in the history, symptoms and treatments are missing. Strangely I can see them in my patterns.
Add reaction
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to Symptom::Translation and Treatment::Translation records and missing labels for existing non-English accounts. Start by tracing how locale-specific translations are looked up for symptoms and treatments, then reproduce the issue with an account using a non-English browser locale. Done means missing translations fall back to English and symptoms and treatments appear in history and menus.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend, localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100