As the title already says: it seems that the strings for the titles on graphs in the community health dashboard are not localized:
When switching to the reports tab, the localized titles are shown:
However, when looking at an individual report/graph, again the English title is used and both day and count in the table headings are also not localized:
1 Like
tvavrda
(Tomas Vavrda)
December 31, 2024, 11:41am
2
This is still the case. Also noted here: Report locale copies do not update with user locale .
Can it be fixed?
1 Like
sam
(Sam Saffron)
January 1, 2025, 10:53pm
3
I have flagged this with the team, no timeline though on when we can resolve this.
Would you like to try out making PR to improve this?
2 Likes
tvavrda
(Tomas Vavrda)
January 1, 2025, 11:13pm
5
It might be challenging for me
And as we speak the notification mail I’ve got has not the In Reply To heading localized, although the e-mail otherwise seems to be translated.
4 Likes
martin
(Martin Brennan)
January 2, 2025, 2:22am
6
This should fix the report issue:
discourse:main
← discourse:fix/report-i18n
opened 02:09AM - 02 Jan 25 UTC
Our bulk report endpoint uses `hijack`, which does not
use the current user's l… ocale via the `with_resolved_locale`
method in `ApplicationController`. This is happening because
we are doing `around_action` to set the locale, then calling
the code in the block inside the action directly when we use
`hijack`.
We can fix this by capturing `I18n.locale` when starting the
hijack then using `I18n.with_locale` when evaluating the
block inside `hijack`, this way the translations will always
use the correct locale based on the current user.
For the “In Reply To” issue, it looks like our Czech translations are a bit lacking, our German server.de.yml
file has user_notifications.in_reply_to
but server.cs.yml
does not. Translations fall back to English when keys are missing.
4 Likes
tvavrda
(Tomas Vavrda)
January 2, 2025, 8:49am
7
I am sorry, you are right. I confused myself. I translated the phrase just 4 days ago and yesterday it looked like it should have worked. The translations have not been committed yet though.
Thanks for the fix, it works!!
1 Like
tvavrda
(Tomas Vavrda)
January 2, 2025, 2:04pm
8
I noticed the tooltips are not translated.
Found the piece of code as well:
return i18n("admin.dashboard.reports.trend_title", {
percent,
prev,
current,
});
}
changeTitle(valAtT1, valAtT2, prevPeriodString) {
const change = this.percentChangeString(valAtT1, valAtT2);
let title = "";
if (change) {
title += `${change} change. `;
}
title += `Was ${number(valAtT1)} ${prevPeriodString}.`;
return title;
}
@discourseComputed("yesterdayCount")
yesterdayCountTitle(yesterdayCount) {
return this.changeTitle(this.valueAt(2), yesterdayCount, "two days ago");
I am just a c# guy, so I am not able to make PR’s.
2 Likes
martin
(Martin Brennan)
January 3, 2025, 12:09am
9
Come on, C# is close enough to Javascript! Thanks for finding that, I will make a PR to fix the JS to use I18n.
1 Like
martin
(Martin Brennan)
January 3, 2025, 1:04am
10
This will fix the other issue, though you won’t see any practical change until our next round of translations:
discourse:main
← discourse:fix/report-percent-tooltip
opened 01:03AM - 03 Jan 25 UTC
Use i18n in the JS code instead of concatenating English
strings.
c.f. https… ://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/8?u=martin
1 Like
tvavrda
(Tomas Vavrda)
January 3, 2025, 10:08am
11
It’s not all. I commented on the PR although it was merged, not sure if you can spot it.
There are more translations below (“two weeks ago” and “in the previous 30 day period”).
2 Likes
martin
(Martin Brennan)
January 6, 2025, 4:48am
12
This next PR should fix those issues, as well as the comments Gerhard added!
discourse:main
← discourse:ux/more-admin-dash-translations
opened 04:47AM - 06 Jan 25 UTC
Followup 8d5c4ecc3398611764a4459c0e92f0fb90edd90f
Implement review suggestion… s from https://github.com/discourse/discourse/pull/30541
after merge, and also fix other hardcoded strings on this
dashboard.
2 Likes
tvavrda
(Tomas Vavrda)
January 10, 2025, 4:09pm
13
There seem to be other topics referring to the same problem. I don’t want to bump them all. What is the right thing to do? Just let them be or should they be somehow updated or closed?
Reports, along with their locale strings, are being cached in the server’s locale, such that users with a differing locale will see an incorrect locale on some reports - should Discourse also pass a localization string in reports so that reports are properly localized?
EG, this is a screenshot of a default EN site, with a sr user:
[Screen Shot 2019-12-13 at 11.37.29 AM]
Hello community ,
I noticed that the strings in the admin/moderator dashboard are not being translated. Tried multiple languages and it keeps those strings in English.
[image]
I wanted to add translations to those strings in Crowdin but those strings already have translations. So I ran a search query and found out this topic:
It looks like there was a PR but was not merged at the end.
Was there any progress with that issue?
Thank you
I have found some strings that are translated in Transifex, but doesn’t appear translated in production. They are in Admin>Dashboard: Signups, Topics, Posts, Daily Engaged Users, New Contributors, Top Referred Topics, Trending Search Terms, Users per Type… (with its corresponding tooltips).
This issue is common to all languages. I have checked different locales (French, German, Catalan…), and the strings always appear untranslated.
2 Likes