# Заголовки на графиках в дашборде общественного здравоохранения не локализованы

**URL:** https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776
**Category:** Bug
**Tags:** translation
**Created:** [07.Апрель.2024 15:15:21 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776 "2024-04-07T15:15:21Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![schneeland](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schneeland/32/275391_2.png) [@schneeland](https://meta.discourse.org/u/schneeland)
#### Post date: [07.Апрель.2024 15:15:21 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/1 "2024-04-07T15:15:21Z")

</div>

Как уже сказано в заголовке: похоже, что строки заголовков на графиках в панели мониторинга здоровья сообщества не локализованы:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/a/b/6ab1b8872cb50c262af39b81278263e25ddf74dc.png)

При переключении на вкладку отчётов отображаются локализованные заголовки:

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/b/1/eb15af212a347fc524754a26279281533c2f63a2.png)

Однако при просмотре отдельного отчёта/графика снова используется английский заголовок, а также не локализованы заголовки столбцов «день» и «количество» в таблице:

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/2/5/12579b2dfbd2a8481621852397c505b679ffbca6.png)

---

<div class="post-metadata">

### Author: ![tvavrda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tvavrda/32/480674_2.png) [@tvavrda](https://meta.discourse.org/u/tvavrda)
#### Post date: [31.Декабрь.2024 11:41:25 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/2 "2024-12-31T11:41:25Z")

</div>

Это по-прежнему актуально. Также отмечено здесь: [Report locale copies do not update with user locale](https://meta.discourse.org/t/report-locale-copies-do-not-update-with-user-locale/135888).

Можно ли это исправить?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [01.Январь.2025 22:53:31 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/3 "2025-01-01T22:53:31Z")

</div>

Я сообщил об этом команде, но пока нет сроков, когда мы сможем это исправить.

Хотите попробовать сделать PR, чтобы улучшить это?

---

<div class="post-metadata">

### Author: ![tvavrda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tvavrda/32/480674_2.png) [@tvavrda](https://meta.discourse.org/u/tvavrda)
#### Post date: [01.Январь.2025 23:13:52 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/5 "2025-01-01T23:13:52Z")

</div>

Для меня это может оказаться сложным 🙂

И пока мы говорим, в полученном мной уведомительном письме заголовок **In Reply To** не локализован, хотя остальная часть письма, похоже, переведена.

 ![Обсуждение в цепочке писем о баге, связанном с заголовками дашборда здоровья сообщества на графиках, касающегося невозможности обновить копии отчёта на локаль пользователя. (Подпись сгенерирована ИИ)](https://global.discourse-cdn.com/meta/original/4X/5/0/7/507b0822aeefc86619348b2966f1a2aa05d25c1b.png)

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [02.Январь.2025 02:22:44 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/6 "2025-01-02T02:22:44Z")

</div>

Это должно исправить проблему с отчётом:

> <https://github.com/discourse/discourse/pull/30524>
>
> 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.
> 
> c.f. https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/5

Что касается проблемы «В ответ на», похоже, что наши чешские переводы немного отстают: в нашем немецком файле `server.de.yml` есть ключ `user_notifications.in_reply_to`, а в `server.cs.yml` его нет. При отсутствии ключей переводы возвращаются к английскому варианту.

---

<div class="post-metadata">

### Author: ![tvavrda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tvavrda/32/480674_2.png) [@tvavrda](https://meta.discourse.org/u/tvavrda)
#### Post date: [02.Январь.2025 08:49:38 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/7 "2025-01-02T08:49:38Z")

</div>

Извините, вы правы. Я сам запутался. Я перевёл эту фразу всего 4 дня назад, и вчера казалось, что всё должно работать. Однако переводы ещё не были закоммичены.

Спасибо за исправление, теперь всё работает!!

---

<div class="post-metadata">

### Author: ![tvavrda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tvavrda/32/480674_2.png) [@tvavrda](https://meta.discourse.org/u/tvavrda)
#### Post date: [02.Январь.2025 14:04:20 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/8 "2025-01-02T14:04:20Z")

</div>

Я заметил, что подсказки не переведены.

 ![Раздел с надписью 'Обсуждения активности' отображает метрики активности пользователей с числовыми данными и аннотациями изменения в процентах. (Подпись сгенерирована ИИ)](https://global.discourse-cdn.com/meta/original/4X/5/0/4/5049c84b3e47ca976c73403a0e2057ee867e727c.png)

Также я нашел соответствующий фрагмент кода:

> <https://github.com/discourse/discourse/blob/a21eefd142a4b11ab2337167b72161bf3957f1bb/app/assets/javascripts/admin/addon/models/report.js#L410>

Я просто программист на C#, поэтому не могу создать pull request. 😉

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [03.Январь.2025 00:09:07 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/9 "2025-01-03T00:09:07Z")

</div>

Да ладно, C# достаточно близок к JavaScript! 😛 Спасибо, что нашли это, я сделаю PR, чтобы исправить JS и использовать I18n.

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [03.Январь.2025 01:04:04 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/10 "2025-01-03T01:04:04Z")

</div>

Это исправит другую проблему, хотя вы не заметите никаких практических изменений до следующего раунда переводов:

> <https://github.com/discourse/discourse/pull/30541>
>
> 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

---

<div class="post-metadata">

### Author: ![tvavrda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tvavrda/32/480674_2.png) [@tvavrda](https://meta.discourse.org/u/tvavrda)
#### Post date: [03.Январь.2025 10:08:27 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/11 "2025-01-03T10:08:27Z")

</div>

Это не всё. Я оставил комментарий в PR, хотя он уже был слит, не уверен, заметите ли вы его.

> Ниже приведены ещё несколько переводов («две недели назад» и «за предыдущие 30 дней»).

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [06.Январь.2025 04:48:02 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/12 "2025-01-06T04:48:02Z")

</div>

Этот следующий PR должен исправить эти проблемы, а также учесть комментарии, добавленные Герхардом!

> <https://github.com/discourse/discourse/pull/30570>
>
> 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.

---

<div class="post-metadata">

### Author: ![tvavrda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tvavrda/32/480674_2.png) [@tvavrda](https://meta.discourse.org/u/tvavrda)
#### Post date: [10.Январь.2025 16:09:29 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/13 "2025-01-10T16:09:29Z")

</div>

Кажется, есть другие темы, касающиеся той же проблемы. Я не хочу их все поднимать. Что правильно делать? Просто оставить их как есть или их нужно как-то обновить или закрыть?

> [@Report locale copies do not update with user locale](https://meta.discourse.org/t/report-locale-copies-do-not-update-with-user-locale/135888?u=tvavrda):
>
> 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:

> [@Dashboard strings are not being translated](https://meta.discourse.org/t/dashboard-strings-are-not-being-translated/165353?u=tvavrda):
>
> Hello community slight_smile , I noticed that the strings in the admin/moderator dashboard are not being translated. Tried multiple languages and it keeps those strings in English. 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 slight_smile

> [@Translated strings in Transifex, untraslated in production](https://meta.discourse.org/t/translated-strings-in-transifex-untraslated-in-production/130113?u=tvavrda):
>
> 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.

---

<div class="post-metadata">

### Author: ![schneeland](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schneeland/32/275391_2.png) [@schneeland](https://meta.discourse.org/u/schneeland)
#### Post date: [18.Январь.2025 16:05:01 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/14 "2025-01-18T16:05:01Z")

</div>

Прежде всего: большое спасибо! У меня не было достаточно времени, чтобы оставить комментарий в промежутке, но я вижу, что локализация теперь применяется гораздо шире в панели управления.

Одна небольшая деталь, которую я всё же заметил: ссылка «Назад» к странице обзора отчётов, похоже, не локализована.

 ![grafik](https://global.discourse-cdn.com/meta/original/4X/2/0/0/2005988e4658db32a652b07f6960cb4c8e7a5fb2.png)

И рекомендации относительно настроек сайта также отображаются на английском языке:

 ![grafik](https://global.discourse-cdn.com/meta/original/4X/e/d/9/ed9b05995072cc75c187fff72b8d778391451b08.png)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [18.Январь.2025 16:25:29 UTC](https://meta.discourse.org/t/titles-on-graphs-in-community-health-dashboard-are-not-localized/302776/15 "2025-01-18T16:25:29Z")

</div>

> [@schneeland](#):
>
> Я всё ещё заметил одну мелочь: обратная ссылка на страницу обзора отчётов, похоже, не локализована.

Они локализованы. Вы можете это увидеть, если включите «[подробную локализацию](https://meta.discourse.org/t/find-a-translation-key-with-verbose-localization/134651?u=moin)», так как у них есть номер.  
Это просто новые строки; обе были переведены на немецкий язык 4 дня назад, но переводы объединяются только раз в неделю. Поэтому совершенно новые строки, добавленные после слияния переводов (или чуть раньше, но у кого-то не было времени перевести их вовремя), возвращаются к английскому языку. Перевод будет добавлен при следующем слиянии переводов ([обычно во вторник](https://github.com/discourse/discourse/commits/main/?author=discourse-translator-bot)), и вы увидите их после обновления.
