""" This module holds the template tags of the ``assessments`` app. """

from django import template

register = template.Library()


@register.filter
def get_localized_name(value, group):
    """Get the localized name of the dimension or competency according its group.

    Parameters
    ----------
    value : Dimension or Competency
        The dimension or the competency which want localize.
    group : Group
        The group used to find the localization.

    Returns
    -------
    str
        The localized name.

    """

    return value.group_version(group=group).name
