Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As @jpic says, you could do it with contextual markers. It would actually be simpler with the site name embedded in the template, as then it would be picked up by django's <code>makemessages</code>. </p> <pre><code>&lt;link rel="alternate" type="application/atom+xml" title="Novinky pre {% trans 'Akadémia Trojstenu' context '4th' %}" href="{% url "news_feed" %}" /&gt; </code></pre> <p>Since that is probably not simple with multiple sites, you could instead make an extra .po file and manually enter all the site names and their translations and context names. </p> <p>This is sort of error-prone, as you're manually synchronizing a translation file and some database values, but at least it's all in one place and outside the templates.</p> <pre><code>msgctxt "1st" msgid "Akadémia Trojstenu" msgstr "Akadémia Trojstenu" msgctxt "2nd" msgid "Akadémia Trojstenu" msgstr "????? Trojstenu" msgctxt "3rd" msgid "Akadémia Trojstenu" msgstr "Akadémie Trojstenu" msgctxt "4th" msgid "Akadémia Trojstenu" msgstr "Akadémiu Trojstenu" ... msgctxt "3rd" msgid "Klub Trojstenu" msgstr "Klubu Trojstenu" ... </code></pre> <p>Stick the extra .po in another directory and register the directory in the <code>LOCALE_PATHS</code> setting. Remember you did this, so you know where to look when someone adds a new site or changes the name of one and starts wondering why the translations are broken.</p> <p>With this done, you should be able to use the site name like this:</p> <pre><code>&lt;link rel="alternate" type="application/atom+xml" title="Novinky pre {% trans site.name context '4th' %}" href="{% url "news_feed" %}" /&gt; </code></pre> <p>Of course, if the problem is limited to just the site name, you might instead stick a few more fields on your Site model to hold the other cases (subclass it). Since site objects never really change, I don't think this sort of denormalization would cause any trouble.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload