Commit b26515e9 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Add translation for AccessibleArea name

parent 1a788909
......@@ -54,6 +54,19 @@ class ActionSerializer(serializers.ModelSerializer):
date, hour = timestamp_str.split()
return date + ' às ' + hour
def get_accesible_area_name(self, name):
accesible_areas = {
'Dashboard': 'Painel Inicial',
'Chat Main Page': 'Conversas',
'Profile Page': 'Página de perfil',
'Notes': 'Anotações',
'Classrooms': 'Salas',
'Courses': 'Lista de Espaços Formativos',
'Messages': 'Mensagens',
'Forums': 'Fóruns',
}
return accesible_areas.get(name, name)
def get_object_type(self, obj):
if isinstance(obj, Course):
return ' no curso ' + obj.name
......@@ -64,7 +77,7 @@ class ActionSerializer(serializers.ModelSerializer):
if isinstance(obj, Forum):
return ' no fórum ' + obj.title
if isinstance(obj, AccessibleArea):
return ' na área ' + obj.name
return ' na área ' + self.get_accesible_area_name(obj.name)
return ''
def get_action_phrase(self, obj):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment