Singular text no longer works after customizing plural variant

Editing the plural version of a site text seems to break the singular version.

The text I used for this example is

admin.site_settings.default_categories.modal_description

Preparation

We need a category that is only included in the sidebar of exactly one user. So either create a new category and add it to your sidebar or ensure a category is in no one’s sidebar by adding it to default navigation menu categories and removing it, confirming that it should be removed for all existing users. Then add it to your sidebar.
The latter has the advantage that you can try out the modal in question beforehand.

Steps to reproduce

  1. Navigate to admin > site texts
  2. Search for admin.site_settings.default_categories.modal_description
  3. Click Edit next to admin.site_settings.default_categories.modal_description.other
  4. Edit the text (I added “Edit” at the end) and save the change
  5. Reload the site so your changes take effect
  6. Add the category from the preparation step to the default navigation menu categories site setting and save the change. Deny the question whether this should affect existing users.
    You should see the edited text in the modal.
  7. Now remove the category from the setting. When you save, you will see the modal asking whether you want to change this for 1 user. But the text isn’t shown.
  8. Don’t forget to reset the customized text.
2 Likes

Interesting, when we have a localizable piece of text it has multiple translations:

        categories:
          one: "Found %{count} category"
          other: "Found %{count} categories"

Does our override system have no way of targeting the .one and .other variants?

It does, you can see both texts in the screenshot:

In this case, I didn’t want to change both. But changing only one breaks the other. Editing the singular version but not the plural version results in a broken plural.


2 Likes

interesting, if you edit both does it work?

3 Likes

Yes


2 Likes