Translating %{filter} in headings for discovery routes

AI-generated summary

The discussion is about translating %{filter} in headings for discovery routes. Moin is having difficulty translating these into German due to adjective form changes depending on context. Moin suggests adding ‘all’ to the strings, but this might be overkill. Nat notes that changing the current implementation would generate many more strings. Awesomerobot suggests simplifying the strings to be more breadcrumb-like. Awesomerobot also points out that %{tags} in category_tag: should use the singular version %{tag}. Later, awesomerobot reworks the headings to have full strings to translate, which can be found in the Discourse GitHub repository.

I have some difficulty translating the following texts into German. In German, adjectives like “hot” or “unread” change form depending on context, so one static %{filter} doesn’t work grammatically.

Are other languages affected too? @translators, how are you solving this in your language?

One idea I had was to add “all” to the strings where it’s currently missing in English - for example: “all %{filter} topics in %{category}”. But adding “all” everywhere might be overkill.

Here’s a table showing how the adjective endings change in German:

%{filter} “All %{filter} topics” “%{filter} topics in %{category}”
latest Alle aktuellen Themen Aktuelle Themen in %{category}
top Alle angesagten Themen Angesagte Themen in %{category}
hot Alle heißen Themen Heiße Themen in %{category}
new Alle neuen Themen Neue Themen in %{category}
unread Alle ungelesenen Themen Ungelesene Themen in %{category}
unseen Alle ungesehenen Themen Ungesehene Themen in %{category}

I also wondered if %{tags} in category_tag: always refers to more than one tag. In the lines above, %{tag} is used for a single tag, and %{tags} for multiple tags, but I didn’t find versions for a category and a single tag.

The strings I am talking about for reference
    discovery:
      headings:
        all:
          default: "All %{filter} topics"
          posted: "All topics you’ve posted in"
          bookmarks: "All topics you’ve bookmarked"

        category:
          default: "%{filter} topics in %{category}"
          posted: "Topics in %{category} you’ve posted in"
          bookmarks: "Topics in %{category} you’ve bookmarked"

        no_tags:
          all_default: "All topics without tags"
          category_default: "%{filter} topics in %{category} without tags"
          all:
            posted: "All topics without tags you've posted in"
            bookmarks: "All topics without tags you've bookmarked"
          category:
            posted: "Topics in %{category} without tags you've posted in"
            bookmarks: "Topics in %{category} without tags you've bookmarked"

        single_tag:
          default: "%{filter} topics tagged %{tag}"
          posted: "Topics tagged %{tag} you've posted in"
          bookmarks: "Topics tagged %{tag} you’ve bookmarked"

        multi_tag:
          default: "%{filter} topics tagged %{tags}"
          posted: "Topics tagged %{tags} you've posted in"
          bookmarks: "Topics tagged %{tags} you’ve bookmarked"

        category_tag:
          default: "%{filter} topics in %{category} tagged %{tags}"
          posted: "Topics in %{category} tagged %{tags} you’ve posted in"
          bookmarks: "Topics in %{category} tagged %{tags} you’ve bookmarked"

        categories: "All categories"

        filter_labels:
          latest: "Latest"
          top: "Top"
          new: "New"
          unread: "Unread"
          hot: "Hot"
          unseen: "Unseen"

3 Likes

Thanks for the feedback @Moin. I’ve informed our teammate who’s in charge of this feature but we’ll have to see what’s the path of least resistance out here since it would generate quite a few more strings as you can imagine.

1 Like

Ah I see, that makes sense… maybe hold off on attempting to translate until we get some other feedback. Hopefully there’s a solution that works for most languages. Perhaps structuring these like a sentence was too ambitious and they should be simplified to be more breadcrumb-like.

Yes good catch, this should use the singular version because we can’t do category and multi-tag using the filters. I’ll switch that to %{tag}

3 Likes

I’ve reworked these headings in A11Y: Update accessible headings for more flexible translations by awesomerobot · Pull Request #32863 · discourse/discourse · GitHub

Now each route will have a full string to translate:

2 Likes