# 在ActivityPub本地化字符串中处理复数形式

**URL:** <https://meta.discourse.org/t/handling-plural-forms-in-activity-pub-localization-strings/363687>\
**Category:** Translations\
**Tags:** activitypub\
**Created:** [2025年四月27日 20:14 UTC](https://meta.discourse.org/t/handling-plural-forms-in-activity-pub-localization-strings/363687 "2025-04-27T20:14:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<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:** [2025年四月27日 20:14 UTC](https://meta.discourse.org/t/handling-plural-forms-in-activity-pub-localization-strings/363687/1 "2025-04-27T20:14:32Z")

</div>

我注意到 ActivityPub 插件中有一些字符串，我认为需要进行复数化。

#### The first post of a new topic will be published %{delay\_minutes} minutes after being posted

[discourse-activity-pub/config/locales/client.en.yml at a49ec5c4f5acac28bafbc1c57c57161c067e8f6e · discourse/discourse-activity-pub · GitHub](https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L105)  
如果 `delay_minutes` 是 1，它应该显示“1 minute”。

#### “Publish Post #%{post\_number} and deliver it to the followers of the Group Actors in %{minutes} minutes.”

[discourse-activity-pub/config/locales/client.en.yml at a49ec5c4f5acac28bafbc1c57c57161c067e8f6e · discourse/discourse-activity-pub · GitHub](https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L248)  
与上面相同。

#### “Publish %{count} unpublished posts in Topic #%{topic\_id}. Posts will not be delivered to the followers of the Group Actors.”

[discourse-activity-pub/config/locales/client.en.yml at a49ec5c4f5acac28bafbc1c57c57161c067e8f6e · discourse/discourse-activity-pub · GitHub](https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L293)

如果只有 **1 篇帖子** 未发布，您应该说“Publish %{count} unpublished post in Topic #%{topic\_id}. Post will not be delivered to the followers of the Group Actors.”

#### “%{min\_length} to %{max\_length} letters, numbers, dashes or underscores.”

[discourse-activity-pub/config/locales/client.en.yml at a49ec5c4f5acac28bafbc1c57c57161c067e8f6e · discourse/discourse-activity-pub · GitHub](https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L42)  
我认为这取决于 `max_length`。如果 `max_length` 是 1，您应该说“letter, number, dash or underscore”。但我不确定是否有其他语言也需要考虑 `min_length`。

#### “Username must be %{min\_length} to %{max\_length} letters, numbers, dashes or underscores.”

[discourse-activity-pub/config/locales/server.en.yml at a49ec5c4f5acac28bafbc1c57c57161c067e8f6e · discourse/discourse-activity-pub · GitHub](https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/server.en.yml#L156)  
与上面相同。

#### “%{count} of %{total} posts in this topic are published.”

[discourse-activity-pub/config/locales/client.en.yml at a49ec5c4f5acac28bafbc1c57c57161c067e8f6e · discourse/discourse-activity-pub · GitHub](https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L279)  
这个稍微复杂一些，因为它取决于两个变量：`count` 和 `total`。例如：

- **1** of _1_ _post_ in this topic **is** published
- **1** of _3_ _posts_ in this topic **is** published
- **2** of _3_ _posts_ in this topic **are** published

---

_[View the full topic](https://meta.discourse.org/t/handling-plural-forms-in-activity-pub-localization-strings/363687)._
