Handling plural forms in activity pub localization strings

I noticed some strings in the ActivityPub plugin that, in my opinion, need pluralization.

The first post of a new topic will be published %{delay_minutes} minutes after being posted

https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L105 If delay_minutes is 1, it should say "1 minute".

"Publish Post #%{post_number} and deliver it to the followers of the Group Actors in %{minutes} minutes."

https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L248 Same as above.

"Publish %{count} unpublished posts in Topic #%{topic_id}. Posts will not be delivered to the followers of the Group Actors."

https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L293

If only 1 post is unpublished, you would say "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."

https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L42 I think this one depends on max_length. If max_length is 1, you would say "letter, number, dash or underscore". But I am not sure if there are other languages where min_length is relevant too.

"Username must be %{min_length} to %{max_length} letters, numbers, dashes or underscores."

https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/server.en.yml#L156 Same as above.

"%{count} of %{total} posts in this topic are published."

https://github.com/discourse/discourse-activity-pub/blob/a49ec5c4f5acac28bafbc1c57c57161c067e8f6e/config/locales/client.en.yml#L279 This one is a little more complex because it depends on two variables: count and total. For example:

  • 1 of 1post in this topic is published
  • 1 of 3posts in this topic is published
  • 2 of 3posts in this topic are published


Discuss this on our forum.
3 Likes