"""Shared utility functions"""

from django.template.defaultfilters import slugify as django_slugify

def slugify(value):
    """
    Normalizes string, converts to lowercase, removes non-alpha characters,
    converts spaces to hyphens, and truncates to 50 characters.
    """
    slug = django_slugify(value)
    slug = slug[:50]
    return slug.rstrip('-')

"""Shared utility functions"""

from django.conf import settings
from django.template.defaultfilters import slugify as django_slugify
from django.utils.translation import ugettext as _

def get_language_name(language_code):
    """Convert a language code into its full (localized) name"""
    languages = dict(settings.LANGUAGES)
    return _(languages[language_code])
    

def slugify(value):
    """
    Normalizes string, converts to lowercase, removes non-alpha characters,
    converts spaces to hyphens, and truncates to 50 characters.
    """
    slug = django_slugify(value)
    slug = slug[:50]
    return slug.rstrip('-')

Add utility function to convert a language code to a its full name
Add utility function to convert a language code to a its full name

  """Shared utility functions"""
  
+ from django.conf import settings
  from django.template.defaultfilters import slugify as django_slugify
+ from django.utils.translation import ugettext as _
+ 
+ def get_language_name(language_code):
+     """Convert a language code into its full (localized) name"""
+     languages = dict(settings.LANGUAGES)
+     return _(languages[language_code])
+     
  
  def slugify(value):
      """
      Normalizes string, converts to lowercase, removes non-alpha characters,
      converts spaces to hyphens, and truncates to 50 characters.
      """
      slug = django_slugify(value)
      slug = slug[:50]
      return slug.rstrip('-')
  
Add utility function to convert a language code to a its full name
## Code Before:
"""Shared utility functions"""

from django.template.defaultfilters import slugify as django_slugify

def slugify(value):
    """
    Normalizes string, converts to lowercase, removes non-alpha characters,
    converts spaces to hyphens, and truncates to 50 characters.
    """
    slug = django_slugify(value)
    slug = slug[:50]
    return slug.rstrip('-')

## Instruction:
Add utility function to convert a language code to a its full name
## Code After:
"""Shared utility functions"""

from django.conf import settings
from django.template.defaultfilters import slugify as django_slugify
from django.utils.translation import ugettext as _

def get_language_name(language_code):
    """Convert a language code into its full (localized) name"""
    languages = dict(settings.LANGUAGES)
    return _(languages[language_code])
    

def slugify(value):
    """
    Normalizes string, converts to lowercase, removes non-alpha characters,
    converts spaces to hyphens, and truncates to 50 characters.
    """
    slug = django_slugify(value)
    slug = slug[:50]
    return slug.rstrip('-')
