# Incorrect usage of week/month/year units in a translated string

**URL:** <https://meta.discourse.org/t/incorrect-usage-of-week-month-year-units-in-a-translated-string/98931>\
**Category:** Bug\
**Created:** [07.Октябрь.2018 10:41:21 UTC](https://meta.discourse.org/t/incorrect-usage-of-week-month-year-units-in-a-translated-string/98931 "2018-10-07T10:41:21Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dimsuz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dimsuz/32/113634_2.png) [@dimsuz](https://meta.discourse.org/u/dimsuz)\
**Post date:** [07.Октябрь.2018 10:41:21 UTC](https://meta.discourse.org/t/incorrect-usage-of-week-month-year-units-in-a-translated-string/98931/1 "2018-10-07T10:41:21Z")

</div>

The `topic_stat_sentence` [translateable string](https://github.com/discourse/discourse/blob/master/config/locales/client.en.yml#L582-L584) looks like this:

```plaintext
topic_stat_sentence:
  one: "%{count} new topic in the past %{unit}."
  other: "%{count} new topics in the past %{unit}."

```

And upon formatting this string at [category-list.js.es6](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/models/category-list.js.es6#L55-L58) `count` is applied as a plural argument, but the thing is that this is not enough, there are 2 issues for some languages:

- `unit` can be not in nominative form here, so it is not correct to simply use translation of `js.week` string (for example ) as a `unit`
- `in the past` part translation can change too depending on the `unit` value

For example in Russian the phrase `in the past %{unit}%` translates differently depending on unit:

week → “за предыдущ **ую** неделю”  
month → “за предыдущ **ий** месяц”  
day → “за предыдущ **ий** день”  
minute → “за предыдущ **ую** минуту”

things to note above:

- `in the past` (`за предыдущую`) changes depending on `unit`
- `{unit}` is not nominative in the translation. Nominative for `week/month/day/minute` is `неделя/месяц/день/минута`, but in the phrase we use `неделю/месяц/день/минуту` for Russian.

**Current behavior**

is to translate `in the past week` as “за предыдущ **ий** недел **я** ” which has both words wrong.

**Proposed solution:**

Unit should not be used here separately, instead the whole `in the past week/month/day/year` phrase should be made available for translation as 3 (or 4?) different translatable strings.

---

_[View the full topic](https://meta.discourse.org/t/incorrect-usage-of-week-month-year-units-in-a-translated-string/98931)._
