Problem/Motivation

As a fallback to free licenses, we have added "All rights reserved" in OpenCulturas. Although no URL has been configured for that entry, an empty link is rendered. The same would happen when adding a fallback "Fair use" copyright notice which is quite common in the USA.

Furthermore: problematic translation

With the generic translatable strings {{ 'by'|trans }}, {{ 'at'|trans }}, {{ 'as'|trans }} it's close to impossible to nail a suitable translation for attributions without side-effects.

Even more when people do not 100% understand what's expected or use the fields freehand to solve their current need.

Proposed resolution

Optimize the templates:

  • Replacing translatable strings with special characters (dash, slash)
  • Handling each field with or without given URL separately

Comments

hexabinaer created an issue. See original summary.

hexabinaer’s picture

Here's our template override for attribution-creative-commons-refined.html.twig:

<div{{ attributes }}>
  {% if license or source or author %}
    {% if license %}
      {% if license.link %}
        <a class="attribution--license" href="{{ license.link }}">{% if license.name %}{{ license.name }}{% else %}{{ license.link }}{% endif %}</a>
      {% elseif license.name %}
        {{ license.name }}
      {% endif %}
    {% endif %}

    {% if license and author %}
      <span class="attribution--separator attribution--dash">—</span>
    {% endif %}

    {% if author %}
      {% if author.link %}
        <a class="attribution--author" href="{{ author.link }}">{% if author.name %}{{ author.name }}{% else %}{{ author.link }}{% endif %}</a>
      {% elseif author.name %}
        {{ author.name }}
      {% endif %}
    {% endif %}

    {% if author and source %}
      <span class="attribution--separator attribution--slash">/</span>
    {% elseif license and source %}
        <span class="attribution--separator attribution--slash">/</span>
    {% endif %}

    {% if source %}
      {% if source.link %}
        <a class="attribution--source" href="{{ source.link }}">{% if source.name %}{{ source.name }}{% else %}{{ source.link }}{% endif %}</a>
      {% elseif source.name %}
        {{ source.name }}
      {% endif %}
    {% endif %}
  {% endif %}
</div>
tobiasb’s picture

Version: 1.0.x-dev » 1.1.x-dev