Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialized i18n and added Spanish support to cases page #100

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions caselaw/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# SecurityMiddleware must be listed before other middleware
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.locale.LocaleMiddleware",
darkshredder marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to indicate position. Something like:

   # LocaleMiddleware should be listed after SessionMiddleware, but before CommonMiddleware

"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
Expand Down
Binary file added legal_db/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
86 changes: 86 additions & 0 deletions legal_db/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-20 04:44+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Comment on lines +1 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update / fill in the metadata


#: models.py:41
msgid "Unreviewed"
msgstr "no revisado"

#: models.py:42
msgid "Review in Progress"
msgstr "Revisión en progreso"

#: models.py:43
msgid "Published"
msgstr "Publicada"

#: models.py:44
msgid "Rejected"
msgstr "Rechazada"

#: templates/legal_db/case/index.html:9
msgid "Cases"
msgstr "Casos"

#: templates/legal_db/case/index.html:14
msgid "Contribute"
msgstr "Contribuir"

#: templates/legal_db/case/index.html:15
msgid "Do you want to submit a legal dispute to the database?"
msgstr "¿Quiere enviar una disputa legal a la base de datos?"

#: templates/legal_db/case/index.html:16
msgid "Submit a case"
msgstr "Presentar un caso"

#: templates/legal_db/case/index.html:21
msgid ""
"Here you will find information on litigation that involves or directly "
"affects Creative Commons legal tools. Click on the link to each case name "
"for more details on the dispute."
msgstr ""
"Aquí encontrará información sobre litigios que involucran o afectan "
"directamente a las herramientas legales de Creative Commons. Haga clic en el "
"enlace al nombre de cada caso para obtener más detalles sobre la disputa."

#: templates/legal_db/case/index.html:49
msgid "Country"
msgstr "País"

#: templates/legal_db/case/index.html:50
msgid "Case name"
msgstr "Nombre del caso"

#: templates/legal_db/case/index.html:51
msgid "License"
msgstr "Licencia"

#: templates/legal_db/case/index.html:52
msgid "Year of resolution"
msgstr "Año de resolución"

#: templates/legal_db/case/index.html:61
msgid "Unknown"
msgstr "Desconocida"

#: templates/legal_db/case/index.html:67
msgid "No cases are available. Try different filters or search terms."
msgstr ""
"No hay casos disponibles. Pruebe diferentes filtros o términos de búsqueda."
23 changes: 12 additions & 11 deletions legal_db/templates/legal_db/case/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{% extends 'legal_db/base.html' %}
{% load static %}
{% load i18n %}

{% block body_content %}
<section class="hero case">
<div class="container">
{% include "legal_db/partials/_breadcrumb.html" %}
<h1 class="hero-title title is-2">Cases</h1>
<h1 class="hero-title title is-2">{% trans "Cases" %}</h1>
<div class="contribute-card">
<article class="card entry-post link no-border is-hidden-touch">
<a href="{% url 'case_submit' %}" class="has-background-tomato">
<span class="card-content has-bottom-link">
<h2 class="card-title">Contribute</h2>
<span class="content">Do you want to submit a legal dispute to the database?</span>
<strong class="link-arrow">Submit a case <i class="icon chevron-right"></i></strong>
<h2 class="card-title">{% trans "Contribute" %}</h2>
<span class="content">{% trans "Do you want to submit a legal dispute to the database?" %}</span>
<strong class="link-arrow">{% trans "Submit a case" %} <i class="icon chevron-right"></i></strong>
</span>
</a>
</article>
</div>
<p class="hero-description body-big">Here you will find information on litigation that involves or directly affects Creative Commons legal tools. Click on the link to each case name for more details on the dispute.</p>
<p class="hero-description body-big">{% trans "Here you will find information on litigation that involves or directly affects Creative Commons legal tools. Click on the link to each case name for more details on the dispute." %}</p>
</div>
</section>

Expand Down Expand Up @@ -45,10 +46,10 @@ <h2 class="card-title">Contribute</h2>
<table class="table is-bordered is-striped is-fullwidth">
<thead>
<tr>
<th>Country</th>
<th>Case name</th>
<th>License</th>
<th>Year of resolution</th>
<th>{% trans "Country" %}</th>
<th>{% trans "Case name" %}</th>
<th>{% trans "License" %}</th>
<th>{% trans "Year of resolution" %}</th>
</tr>
</thead>
<tbody>
Expand All @@ -57,13 +58,13 @@ <h2 class="card-title">Contribute</h2>
<td>{{ case.country.name }}</td>
<td><a href="{% url 'case_detail' case.id %}" class="has-text-dark-slate-blue">{{ case.name }}</a> </td>
<td class="is-narrow">
{% if not case.license %} <span class="has-text-grey">Unknown</span>
{% if not case.license %} <span class="has-text-grey">{% trans "Unknown" %}</span>
{% else %} {{ case.license }} {% endif %}
</td>
<td class="number-cell">{{ case.decision_year|default:"" }}</td>
</tr>
{% empty %}
<tr><td class="has-text-centered" colspan="4">No cases are available. Try different filters or search terms.</td></tr>
<tr><td class="has-text-centered" colspan="4">{% trans "No cases are available. Try different filters or search terms." %}</td></tr>
{% endfor %}
</tbody>
</table>
Expand Down