# 某些参数导致本地化字符串中出现英文

**URL:** <https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485>\
**Category:** Translations\
**Created:** [2019年二月18日 20:15 UTC](https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485 "2019-02-18T20:15:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rizka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rizka/32/79717_2.png) [@rizka](https://meta.discourse.org/u/rizka)\
**Post date:** [2019年二月18日 20:15 UTC](https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485/1 "2019-02-18T20:15:17Z")

</div>

After updating to 2.2, I split a post into another topic. The moderator post has the word topic in it even though that’s not Finnish.

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/8/58e8cae2ee6d7a1f67d0b4daa251d7b72ac0f9d6.png)

It comes from `move_posts.existing_topic_moderator_post`. Where is that `%{entity}` supposed to come from? Seems that it won’t work anyway.

English:

> A post was split to a new %{entity}: %{topic\_link}

Finnish:

> Viesti siirrettiin uuteen %{entity}: %{topic\_link}

Furthermore, I got a report that the Uncategorized category is visible to regular users now and they can even try to create topics there. I’m not sure what has changed, though, but clearly something. Anyway, when he tried to create a topic there he couldn’t, because we have prevented that by disabling `allow uncategorized topics`. The error prompt he received was:

> Category on varattu

That one comes from `errors.messages.exclusion` which is somewhat different as there is not even a parameter in that string. Not sure where the word “Category” comes from. Maybe it’s hardcoded?

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2019年二月18日 22:04 UTC](https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485/2 "2019-02-18T22:04:28Z")

</div>

> [@rizka](#):
>
> The moderator post has the word topic in it even though that’s not Finnish.

You are right. “message” or “topic” are hardcoded values for `%{entity}`. I’m going to fix that.

> <https://github.com/discourse/discourse/blob/c08b2ddecfaed0f0ab3e3b30743b55d5f5230fb2/app/models/post_mover.rb#L201-L204>

> [@rizka](#):
>
> Not sure where the word “Category” comes from. Maybe it’s hardcoded?

Yeah, that’s the attribute name that caused the validation error. Most of them aren’t translated. I think it should be enough to add a new translation for `activerecord.attributes.category`. I’ll see what I can do.

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2019年二月20日 15:55 UTC](https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485/4 "2019-02-20T15:55:12Z")

</div>

Thanks for reporting those issues. I fixed both of them:

- [UX: Moderator post wasn't completely translatable · discourse/discourse@66901f6 · GitHub](https://github.com/discourse/discourse/commit/66901f67f650bb2b6fd97511cdecf30733f47ee8)
- [UX: Make "Category" in topic validation errors translatable · discourse/discourse@964e7ed · GitHub](https://github.com/discourse/discourse/commit/964e7edcafbd30e6e69b7285e7bce54f4552b78f)

---

<div class="post-metadata">

**Author:** ![rizka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rizka/32/79717_2.png) [@rizka](https://meta.discourse.org/u/rizka)\
**Post date:** [2019年二月21日 02:32 UTC](https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485/5 "2019-02-21T02:32:43Z")

</div>

Thank you!

As we are running the stable branch, I overrode those strings featuring the faulty _entity_. They will now say the posts were moved into a topic (ketju) even if they would be moved into a message. We can live with that. Especially since I don’t think any post has ever been moved into a message.

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2019年二月22日 02:32 UTC](https://meta.discourse.org/t/some-parameters-cause-english-to-appear-in-localised-strings/109485/6 "2019-02-22T02:32:44Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
