From 7cd5244fdca15f074948bdcf50251300c26e2684 Mon Sep 17 00:00:00 2001 From: Levi Date: Fri, 15 Jul 2016 00:14:51 -0500 Subject: [PATCH 01/14] Added PostListViewUngleichTest, Added PostDetailViewUngleich, Converted detail ungleich post view into Class Based Django view, Added translations to ungleich landing page --- hosting/test_views.py | 4 +- .../djangocms_blog/includes/blog_item.html | 4 +- ungleich/test_views.py | 114 ++++++++++++++++++ ungleich/urls.py | 5 +- ungleich/views.py | 46 +++++-- ungleich_page/locale/de/LC_MESSAGES/django.mo | Bin 4845 -> 8679 bytes ungleich_page/locale/de/LC_MESSAGES/django.po | 58 +++++++-- .../templates/ungleich_page/404.html | 2 +- .../ungleich_page/includes/_services.html | 5 +- .../templates/ungleich_page/landing.html | 13 +- utils/tests.py | 1 + 11 files changed, 217 insertions(+), 35 deletions(-) create mode 100644 ungleich/test_views.py diff --git a/hosting/test_views.py b/hosting/test_views.py index 99bc0427..c3777840 100644 --- a/hosting/test_views.py +++ b/hosting/test_views.py @@ -1,6 +1,6 @@ from unittest import mock from django.conf import settings -from django.test import TestCase, RequestFactory +from django.test import TestCase from django.core.urlresolvers import reverse from django.core.urlresolvers import resolve from django.contrib.auth.tokens import default_token_generator @@ -115,7 +115,7 @@ class HostingPricingViewTest(TestCase): found = resolve(self.url) self.assertEqual(found.func.__name__, self.view.__name__) - def get(self): + def test_get(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200) self.assertEqual(self.view.get_context_data(), self.expected_context) diff --git a/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html b/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html index 0ec8535a..50c1b0ce 100644 --- a/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html +++ b/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html @@ -17,13 +17,13 @@ Posted {% if post.author %} by - + {% if post.author.get_full_name %} {{ post.author.get_full_name }} {% else %} {{ post.author }} {% endif %} - + {% endif %} on {{ post.date_published|date:"DATE_FORMAT" }}

diff --git a/ungleich/test_views.py b/ungleich/test_views.py new file mode 100644 index 00000000..09375894 --- /dev/null +++ b/ungleich/test_views.py @@ -0,0 +1,114 @@ +from utils.tests import BaseTestCase +from django.conf import settings +from django.core.urlresolvers import reverse +from django.core.urlresolvers import resolve +from django.utils.translation import get_language +from django.utils.translation import activate +from djangocms_blog.settings import get_setting +from djangocms_blog.models import Post + +from model_mommy import mommy + +from .views import PostListViewUngleich, PostDetailViewUngleich + + +class PostListViewUngleichTest(BaseTestCase): + + DE_LANGUAGE_CODE = 'de' + EN_LANGUAGE_CODE = 'en-us' + + def setUp(self): + super(PostListViewUngleichTest, self).setUp() + self.url = reverse('ungleich:post-list') + self.view = PostListViewUngleich + self.expected_template = 'djangocms_blog/post_list_ungleich.html' + en_post_titles = ['post-title-1', 'post-title-2'] + self.en_posts = [mommy.make(Post, title=x, publish=True) for x in en_post_titles] + # activate DE language in order to create DE POSTS + activate(self.DE_LANGUAGE_CODE) + de_post_titles = ['post-title-3', 'post-title-4'] + self.de_posts = [mommy.make(Post, title=x, publish=True) for x in de_post_titles] + + self.expected_context = { + 'TRUNCWORDS_COUNT': get_setting('POSTS_LIST_TRUNCWORDS_COUNT'), + 'languages': settings.LANGUAGES, + 'current_language': get_language() + + } + + def test_url_resolve_to_view_correctly(self): + found = resolve(self.url) + self.assertEqual(found.func.__name__, self.view.__name__) + + def test_queryset(self): + # testing EN-US Post queryset + activate(self.EN_LANGUAGE_CODE) + view = self.setup_view(self.view()) + queryset = view.get_queryset() + self.assertEqual(self.en_posts, list(queryset.order_by('id'))) + + # testing DE Post queryset + activate(self.DE_LANGUAGE_CODE) + view = self.setup_view(self.view()) + queryset = view.get_queryset() + self.assertEqual(self.de_posts, list(queryset.order_by('id'))) + + def test_get_context(self): + view = self.setup_view(self.view()) + queryset = view.get_queryset() + view.object_list = queryset + context = view.get_context_data() + self.assertEqual(self.expected_context.get('current_language'), + context['current_language']) + + +class DetailsViewTest(BaseTestCase): + + DE_LANGUAGE_CODE = 'de' + EN_LANGUAGE_CODE = 'en-us' + + def setUp(self): + super(DetailsViewTest, self).setUp() + self.url = reverse('ungleich:post-list') + self.view = PostDetailViewUngleich + self.expected_template = 'djangocms_blog/post_detail.html' + self.en_post = mommy.make(Post, publish=True, title='post-title-en') + # activate DE language in order to create DE POSTS + activate(self.DE_LANGUAGE_CODE) + self.de_post = mommy.make(Post, publish=True, title='post-title-de') + + self.en_post_kwargs = { + 'slug': self.en_post.slug, + 'year': self.en_post.date_created.year, + 'month': self.en_post.date_created.month, + 'day': self.en_post.date_created.day + } + self.en_post_url = reverse('ungleich:post-detail', kwargs=self.en_post_kwargs) + + self.de_post_kwargs = { + 'slug': self.de_post.slug, + 'year': self.de_post.date_created.year, + 'month': self.de_post.date_created.month, + 'day': self.de_post.date_created.day + } + self.de_post_url = reverse('ungleich:post-detail', kwargs=self.de_post_kwargs) + + def test_url_resolve_to_view_correctly(self): + found = resolve(self.en_post_url) + self.assertEqual(found.func.__name__, self.view.__name__) + + found = resolve(self.de_post_url) + self.assertEqual(found.func.__name__, self.view.__name__) + + def test_get_object(self): + # Testing get_object view method on an EN Post instance + activate(self.EN_LANGUAGE_CODE) + view = self.setup_view(self.view(), **self.en_post_kwargs) + obj = view.get_object() + self.assertEqual(self.en_post, obj) + + # Testing get_object view method on an DE Post instance + activate(self.DE_LANGUAGE_CODE) + view = self.setup_view(self.view(), **self.de_post_kwargs) + obj = view.get_object() + self.assertEqual(self.de_post, obj) diff --git a/ungleich/urls.py b/ungleich/urls.py index afdef4de..e833f03d 100644 --- a/ungleich/urls.py +++ b/ungleich/urls.py @@ -1,9 +1,10 @@ from django.conf.urls import url from . import views +from .views import PostDetailViewUngleich urlpatterns = [ - url(r'^$', views.PostListViewUngleich.as_view()), + url(r'^$', views.PostListViewUngleich.as_view(), name="post-list"), # url(r'^$',views.PostListView.as_view()), url(r'^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\w[-\w]*)/$', - views.details) + PostDetailViewUngleich.as_view(), name="post-detail") ] diff --git a/ungleich/views.py b/ungleich/views.py index 5e829693..8f73a8cb 100644 --- a/ungleich/views.py +++ b/ungleich/views.py @@ -1,12 +1,13 @@ from django.conf import settings +from django.http import Http404 from django.shortcuts import render +from django.views.generic import DetailView from django.utils.translation import get_language from djangocms_blog.models import Post from djangocms_blog.views import PostListView from djangocms_blog.settings import get_setting - def blog(request): posts = Post.objects.all() context = { @@ -41,12 +42,39 @@ class PostListViewUngleich(PostListView): return queryset -def details(request, year, month, day, slug): - #should be this way - language = get_language() - #but currently the posts are not trasnlated - # language = 'en-us' - post = Post.objects.translated(language, slug=slug).first() - context = {'post': post} - return render(request, 'ungleich/djangocms_blog/post_detail.html', context=context) +class PostDetailViewUngleich(DetailView): + model = Post + template_name = 'ungleich/djangocms_blog/post_detail.html' + context_object_name = 'post' + slug_field = 'slug' + slug_url_kwarg = 'slug' + def get_object(self, queryset=None): + + # Use a custom queryset if provided; this is required for subclasses + # like DateDetailView + + language = get_language() + if queryset is None: + queryset = self.get_queryset() + # Next, try looking up by primary key. + pk = self.kwargs.get(self.pk_url_kwarg) + slug = self.kwargs.get(self.slug_url_kwarg) + if pk is not None: + queryset = queryset.filter(pk=pk) + # Next, try looking up by slug. + if slug is not None and (pk is None or self.query_pk_and_slug): + slug_field = self.get_slug_field() + queryset = queryset.translated(language, **{slug_field: slug}) + # If none of those are defined, it's an error. + if pk is None and slug is None: + raise AttributeError("Generic detail view %s must be called with " + "either an object pk or a slug." + % self.__class__.__name__) + try: + # Get the single item from the filtered queryset + obj = queryset.first() + except queryset.model.DoesNotExist: + raise Http404(_("No %(verbose_name)s found matching the query") % + {'verbose_name': queryset.model._meta.verbose_name}) + return obj diff --git a/ungleich_page/locale/de/LC_MESSAGES/django.mo b/ungleich_page/locale/de/LC_MESSAGES/django.mo index b44e0c322186db93d543c900779a04a0693b89e1..4af4e24165b9f3867f4a2a30699f7d02be72ecec 100644 GIT binary patch literal 8679 zcmbW6TZ|;YUk9_jSjNvEK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)j|WWgT)NK-Dq(ZFnRb6OG3%JZ({Y0p0Ts zRwm)SloULBoS*Wa1it22?x)|?P^)H{_tW&hXuPnBKd0a9j_;!Rjxr@<-xREUDJ125 zH@#F%u$V96%juYl$$AeK^IYX&ZSfmM>{z0ZA@4@$4ZGuO*@~viG%Mm^sDeAd{HpfU zCMXy9tr|+g6w6QBXeVb|Frm(Ij%Y(rJt zkIHugC+PBhj4{6zs?E~qkWCYuKvjMbmH0NQ)l;SWi>OMTAvtUfDbChW6Mw`Z+(f;X zU{&+jhw4lYTk#ua81|R1^XM}BCJv!mo2WITIW~iBIEPB`3Ux--aTWjIetgU9Tv`sZ z_yzUeBIWnuJ5*;2*o{9t`mc&((PHHt$o5+=D&aZQp}L7$=p@$TLsV-YBe`r9k75q# zY#4f9p_c0%yd3&RCz)k@6Hgj;YJ4>39!T8Jj&99oK@e~qeAs9Ws} z9Ylq?!7ha7OIxI1jh4^_;a(^jp5W4D_*c}mTHVa(V5lqFbM2c#`>aFge|Lw2%hh+C zpsFTP=BH|Z1=s4P9sjep?VjvTpGu_9oK2q&veAg+d+}S0c(5E_ae}3$4~{?DvJ<>$ KeeL+e$>o2WU1H+^ diff --git a/ungleich_page/locale/de/LC_MESSAGES/django.po b/ungleich_page/locale/de/LC_MESSAGES/django.po index f8b938ce..a34ca6e6 100644 --- a/ungleich_page/locale/de/LC_MESSAGES/django.po +++ b/ungleich_page/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-09 16:47-0500\n" +"POT-Creation-Date: 2016-07-11 22:04-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -159,20 +159,23 @@ msgstr "" msgid "our services" msgstr "Unsere Dienstleistungen" -#: templates/ungleich_page/includes/_services.html:9 +#: templates/ungleich_page/includes/_services.html:10 msgid "We support our clients in all areas of Unix infrastructure." msgstr "" +"Wir unterstützen unsere Klienten in allen Bereichen der Unix Infrastruktur." -#: templates/ungleich_page/includes/_services.html:10 +#: templates/ungleich_page/includes/_services.html:11 msgid "" "Our top notch configuration management is refreshingly simple and reliable." msgstr "" +"Unser erstklassiges Konfigurationsmanagement ist erfrischend einfach und " +"zuverlässig." -#: templates/ungleich_page/includes/_services.html:18 +#: templates/ungleich_page/includes/_services.html:20 msgid "Hosting" msgstr "Hosting" -#: templates/ungleich_page/includes/_services.html:20 +#: templates/ungleich_page/includes/_services.html:22 msgid "" "Ruby on Rails. Java hosting, Django hosting, we make it everything run " "smooth and safe." @@ -180,11 +183,11 @@ msgstr "" "Ruby on Rails. Java hosting, Django hosting, wir garantieren einen " "reibungslosen Ablauf" -#: templates/ungleich_page/includes/_services.html:28 +#: templates/ungleich_page/includes/_services.html:30 msgid "Configuration as a Service" msgstr "Konfiguration als Service" -#: templates/ungleich_page/includes/_services.html:30 +#: templates/ungleich_page/includes/_services.html:32 msgid "" "Ruby on Rails, Django, Java, Webserver, Mailserver, any infrastructure that " "needs to configured, we provide comprehensive solutions. Amazon, rackspace " @@ -194,11 +197,11 @@ msgstr "" "welche eine Konfiguration braucht, wir offerieren umfassende Lösungen, " "Amazon, Rackspace oder Bare Metal Servers, wir konfigurieren alles." -#: templates/ungleich_page/includes/_services.html:38 +#: templates/ungleich_page/includes/_services.html:40 msgid "Linux System Engineering" msgstr "Linux System Engineering" -#: templates/ungleich_page/includes/_services.html:41 +#: templates/ungleich_page/includes/_services.html:43 msgid "" "Let your developers develop! We take care of your system administration. " "Gentoo, Archlinux, Debian, Ubuntu, and many more." @@ -230,7 +233,7 @@ msgid "" "\t\t\t engineers to work more efficiently and comfortable\n" "\t\t\t than before.\"\n" "\t\t\t " -msgstr "" +msgstr "\n ungleich half uns mit unserer internen Infrastruktur, gehostet auf physikalischen Servern, in einer gemeinsamen Unterbringung in einem Datenzentrum in Zürich. Von der Planung des Netzwerk-Layouts und der Virtualisierung der Einrichtung, Offertanfragen und Sicherstellung eines sehr guten Angebots von einem Hardwarelieferanten bis hin zur Installisierung von einfachen Dienstleistungen, wie DNS, VPN und Firewalls durch den Gebrauch der Konfigurationsmanagement-Software cdist, wir konnten auf den Support von ungleich zählen. Am Ende haben wir eine hochverfügbare Infrastruktur-Einrichtung erhalten, welche es unseren Technikern ermöglicht effizienter und bequemer zu arbeiten als zuvor." #: templates/ungleich_page/includes/_team.html:51 msgid "" @@ -242,7 +245,7 @@ msgid "" "\t\t\t significantly not only in cost but also in time\n" "\t\t\t saving, which is crucial for IT companies like ours.\"\n" "\t\t\t \t" -msgstr "" +msgstr "\n Vielen Dank an das ungleich Team, welches unsere Firmen-Linux-Infrastruktur konfiguriert hat, unsere Systeme sind sehr einfach zu verwalten. Ihr innovatives Konfigurationsmanagement-System cdist half uns signifikant nicht nur in der Kosteneinsparung aber auch zur Zeiteinsparung, was für IT-Firmen sehr wichtig ist." #: templates/ungleich_page/includes/_team.html:67 msgid "" @@ -259,7 +262,7 @@ msgid "" "\t\t\t recommend them to any companies with high demand in\n" "\t\t\t solid infrastructures.\"\n" "\t\t\t " -msgstr "" +msgstr "\n ungleich bietete einen exzellenten Service bei der Gestaltung unserer System-Architektur und erstellte sichere und stabile Geräte. Für uns ist es wichtig eine dauerhafte Stabilität in unserem System zu haben und das Konfigurationsmanagement-System cdist ist sehr einfach zu bedienen für die Systemadministration. Wir hatten eine erfolgreiche Kollaboration mit ungleich während einer Zeit mit einer sehr hohen Arbeitsauslastung und ihre Projektführung war hochqualifiziert und sehr zuverlässig. Ich würde sie allen Firmen empfehlen, bei denen eine solide Infrastruktur stark gefragt ist." #: templates/ungleich_page/includes/_team.html:82 msgid "" @@ -273,6 +276,32 @@ msgstr "" msgid "*ungleich means not equal to (≠) U+2260." msgstr "*ungleich bedeutet nicht gleich wie (≠) U+2260." +#: templates/ungleich_page/landing.html:85 +#, fuzzy +#| msgid "our services" +msgid "Services" +msgstr "Unsere Dienstleistungen" + +#: templates/ungleich_page/landing.html:90 +msgid "products" +msgstr "PRODUKTE" + +#: templates/ungleich_page/landing.html:93 +msgid "About" +msgstr "ÜBER" + +#: templates/ungleich_page/landing.html:96 +msgid "WHY UNGLEICH?" +msgstr "WARUM UNGLEICH?" + +#: templates/ungleich_page/landing.html:99 +msgid "BLOG" +msgstr "BLOG" + +#: templates/ungleich_page/landing.html:102 +msgid "CONTACT" +msgstr "KONTAKT" + #: urls.py:8 #, fuzzy #| msgid "Contact Us" @@ -287,3 +316,8 @@ msgstr "Nachricht erfolgreich versendet" msgid "If you have any question, just send us an email." msgstr "" "Wenn Sie irgendwelche Fragen haben, schicken Sie uns einfach eine E-Mail." + +#, fuzzy +#~| msgid "Contact Us" +#~ msgid "Contact" +#~ msgstr "Kontaktieren Sie uns" diff --git a/ungleich_page/templates/ungleich_page/404.html b/ungleich_page/templates/ungleich_page/404.html index c3cd260d..4d817937 100644 --- a/ungleich_page/templates/ungleich_page/404.html +++ b/ungleich_page/templates/ungleich_page/404.html @@ -48,7 +48,7 @@ - + diff --git a/ungleich_page/templates/ungleich_page/includes/_services.html b/ungleich_page/templates/ungleich_page/includes/_services.html index d07e1336..5a0ef848 100644 --- a/ungleich_page/templates/ungleich_page/includes/_services.html +++ b/ungleich_page/templates/ungleich_page/includes/_services.html @@ -6,7 +6,10 @@

{% trans "our services" %}

-

{% trans "" %}

+

+ {% trans "We support our clients in all areas of Unix infrastructure." %}
+ {% trans "Our top notch configuration management is refreshingly simple and reliable." %} +

diff --git a/ungleich_page/templates/ungleich_page/landing.html b/ungleich_page/templates/ungleich_page/landing.html index 59bb8fd3..0eaf0a2c 100644 --- a/ungleich_page/templates/ungleich_page/landing.html +++ b/ungleich_page/templates/ungleich_page/landing.html @@ -1,5 +1,6 @@ {% load static %} {% load bootstrap3 %} +{% load i18n %} @@ -81,24 +82,24 @@
  • - services
  • + {% trans "Services"%}
  • - products
  • + {% trans "products"%}
  • - About + {% trans "About"%}
  • - WHY UNGLEICH? + {% trans "WHY UNGLEICH?"%}
  • - BLOG + {% trans "BLOG"%}
  • - Contact + {% trans "CONTACT"%}
  • diff --git a/utils/tests.py b/utils/tests.py index 42831050..d40f2c40 100644 --- a/utils/tests.py +++ b/utils/tests.py @@ -81,4 +81,5 @@ class BaseTestCase(TestCase): view.request = self.request view.args = args view.kwargs = kwargs + view.config = None return view From e05c7bbf46078687bb3e7fef12a46b847e534897 Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 16 Jul 2016 11:58:43 -0500 Subject: [PATCH 02/14] #hotfix fixed 404 font issue --- ungleich_page/templates/ungleich_page/404.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/404.html b/ungleich_page/templates/ungleich_page/404.html index 4d817937..bcd2260b 100644 --- a/ungleich_page/templates/ungleich_page/404.html +++ b/ungleich_page/templates/ungleich_page/404.html @@ -19,7 +19,7 @@ - + @@ -40,7 +40,7 @@

     

    404

    -

    +

    "Sorry, we could not find the page you are looking for!"

    From d7f7d498f5b6c0dc58ea81b236b11587eb7c828a Mon Sep 17 00:00:00 2001 From: Levi Date: Mon, 18 Jul 2016 21:24:44 -0500 Subject: [PATCH 03/14] Created .po translation file for login.html, signup.html, reset_password.html, confirm_reset_password.html, base_short.html, order_detail.html. Created .po translation file for orders.html, virtual_machine_detail.html, virtual_machines. created .po translation file for virtual_machine_key.html, notifications.html --- hosting/locale/de/LC_MESSAGES/django.po | 359 ++++++++++++++++++ hosting/templates/hosting/base_short.html | 33 +- .../hosting/confirm_reset_password.html | 9 +- hosting/templates/hosting/login.html | 11 +- hosting/templates/hosting/notifications.html | 12 +- hosting/templates/hosting/order_detail.html | 27 +- hosting/templates/hosting/orders.html | 30 +- hosting/templates/hosting/reset_password.html | 8 +- hosting/templates/hosting/signup.html | 8 +- .../hosting/virtual_machine_detail.html | 44 ++- .../hosting/virtual_machine_key.html | 13 +- .../templates/hosting/virtual_machines.html | 16 +- 12 files changed, 470 insertions(+), 100 deletions(-) create mode 100644 hosting/locale/de/LC_MESSAGES/django.po diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po new file mode 100644 index 00000000..f599639a --- /dev/null +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,359 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-17 11:34-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \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" + +#: templates/emails/password_reset_email.html:2 +#: templates/emails/password_reset_email.txt:2 +#, python-format +msgid "" +"You're receiving this email because you requested a password reset for your " +"user account at %(site_name)s." +msgstr "" + +#: templates/emails/password_reset_email.html:4 +#: templates/emails/password_reset_email.txt:4 +msgid "Please go to the following page and choose a new password:" +msgstr "" + +#: templates/emails/password_reset_email.html:9 +#: templates/emails/password_reset_email.txt:9 +msgid "Thanks for using our site!" +msgstr "" + +#: templates/emails/password_reset_email.html:11 +#: templates/emails/password_reset_email.txt:11 +#, python-format +msgid "The %(site_name)s team" +msgstr "" + +#: templates/hosting/base_short.html:67 +msgid "My Virtual Machines" +msgstr "" + +#: templates/hosting/base_short.html:72 templates/hosting/orders.html.py:12 +msgid "My Orders" +msgstr "" + +#: templates/hosting/base_short.html:77 +msgid "Notifications " +msgstr "" + +#: templates/hosting/base_short.html:84 +msgid "Logout" +msgstr "" + +#: templates/hosting/base_short.html:89 templates/hosting/base_short.html:131 +msgid "How it works" +msgstr "" + +#: templates/hosting/base_short.html:92 templates/hosting/base_short.html:134 +msgid "Your infrastructure" +msgstr "" + +#: templates/hosting/base_short.html:95 templates/hosting/base_short.html:137 +msgid "Our inftrastructure" +msgstr "" + +#: templates/hosting/base_short.html:98 templates/hosting/base_short.html:140 +msgid "Pricing" +msgstr "" + +#: templates/hosting/base_short.html:101 templates/hosting/base_short.html:144 +msgid "Contact" +msgstr "" + +#: templates/hosting/base_short.html:104 templates/hosting/login.html.py:29 +#: templates/hosting/login.html:38 templates/hosting/reset_password.html:24 +#: templates/hosting/signup.html:24 +msgid "Login" +msgstr "" + +#: templates/hosting/base_short.html:127 +msgid "Home" +msgstr "" + +#: templates/hosting/confirm_reset_password.html:19 +msgid "Set your new password" +msgstr "" + +#: templates/hosting/confirm_reset_password.html:28 +#: templates/hosting/reset_password.html:20 +msgid "Reset" +msgstr "" + +#: templates/hosting/confirm_reset_password.html:32 +#: templates/hosting/reset_password.html:24 templates/hosting/signup.html:24 +msgid "Already have an account ?" +msgstr "" + +#: templates/hosting/confirm_reset_password.html:32 +msgid "Log in" +msgstr "" + +#: templates/hosting/login.html:22 +msgid "You haven been logged out" +msgstr "" + +#: templates/hosting/login.html:42 +msgid "Don't have an account yet ? " +msgstr "" + +#: templates/hosting/login.html:42 templates/hosting/signup.html.py:11 +#: templates/hosting/signup.html:20 +msgid "Sign up" +msgstr "" + +#: templates/hosting/login.html:44 +msgid "Forgot your password ? " +msgstr "" + +#: templates/hosting/notifications.html:9 +msgid "Notifications" +msgstr "" + +#: templates/hosting/notifications.html:16 +msgid "Unread" +msgstr "" + +#: templates/hosting/notifications.html:26 +msgid "All" +msgstr "" + +#: templates/hosting/notifications.html:38 +msgid "Unread notifications" +msgstr "" + +#: templates/hosting/notifications.html:48 +msgid "Mark as read" +msgstr "" + +#: templates/hosting/notifications.html:59 +msgid "All notifications" +msgstr "" + +#: templates/hosting/order_detail.html:10 +msgid "Invoice" +msgstr "" + +#: templates/hosting/order_detail.html:10 +msgid "Order #" +msgstr "" + +#: templates/hosting/order_detail.html:16 +#: templates/hosting/order_detail.html:24 +msgid "Billed To:" +msgstr "" + +#: templates/hosting/order_detail.html:26 +msgid "Status:" +msgstr "" + +#: templates/hosting/order_detail.html:38 +msgid "Payment Method:" +msgstr "" + +#: templates/hosting/order_detail.html:49 +msgid "Order summary" +msgstr "" + +#: templates/hosting/order_detail.html:52 +msgid "Type" +msgstr "" + +#: templates/hosting/order_detail.html:54 +#: templates/hosting/virtual_machine_detail.html:96 +msgid "Configuration" +msgstr "" + +#: templates/hosting/order_detail.html:56 +#: templates/hosting/virtual_machine_detail.html:75 +msgid "Cores" +msgstr "" + +#: templates/hosting/order_detail.html:58 +#: templates/hosting/virtual_machine_detail.html:81 +msgid "Memory" +msgstr "" + +#: templates/hosting/order_detail.html:60 +msgid "Disk space" +msgstr "" + +#: templates/hosting/order_detail.html:62 +msgid "Total" +msgstr "" + +#: templates/hosting/order_detail.html:68 +msgid "Finish Configuration" +msgstr "" + +#: templates/hosting/orders.html:17 +#: templates/hosting/virtual_machine_detail.html:121 +msgid "Date" +msgstr "" + +#: templates/hosting/orders.html:18 +#: templates/hosting/virtual_machine_detail.html:122 +#: templates/hosting/virtual_machines.html:15 +msgid "Amount" +msgstr "" + +#: templates/hosting/orders.html:19 +#: templates/hosting/virtual_machine_detail.html:36 +#: templates/hosting/virtual_machine_detail.html:123 +#: templates/hosting/virtual_machines.html:16 +msgid "Status" +msgstr "" + +#: templates/hosting/orders.html:30 +#: templates/hosting/virtual_machine_detail.html:134 +msgid "Approved" +msgstr "" + +#: templates/hosting/orders.html:32 +#: templates/hosting/virtual_machine_detail.html:136 +msgid "Declined" +msgstr "" + +#: templates/hosting/orders.html:37 +#: templates/hosting/virtual_machine_detail.html:140 +#: templates/hosting/virtual_machines.html:38 +msgid "View Detail" +msgstr "" + +#: templates/hosting/orders.html:41 +msgid "Cancel Order" +msgstr "" + +#: templates/hosting/orders.html:56 +msgid "Do You want do delete your order?" +msgstr "" + +#: templates/hosting/orders.html:64 +msgid "Close" +msgstr "" + +#: templates/hosting/orders.html:66 +msgid "Delete" +msgstr "" + +#: templates/hosting/orders.html:83 templates/hosting/virtual_machines.html:49 +msgid "previous" +msgstr "" + +#: templates/hosting/orders.html:89 templates/hosting/virtual_machines.html:55 +msgid "next" +msgstr "" + +#: templates/hosting/reset_password.html:11 +msgid "Reset your password" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:19 +msgid "Settings" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:25 +msgid "Billing" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:31 +msgid "Orders" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:60 +msgid "Ip not assigned yet" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:87 +msgid "Disk" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:106 +msgid "Current pricing" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:152 +msgid "Current status" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:172 +msgid "Cancel Virtual Machine" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:181 +msgid "Cancel your Virtual Machine" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:184 +msgid "Are you sure do you want to cancel your Virtual Machine " +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:184 +msgid "plan?" +msgstr "" + +#: templates/hosting/virtual_machine_detail.html:187 +msgid "Cancel" +msgstr "" + +#: templates/hosting/virtual_machine_key.html:10 +msgid "SSH Private Key" +msgstr "" + +#: templates/hosting/virtual_machine_key.html:15 +#: templates/hosting/virtual_machine_key.html:29 +msgid "Warning!" +msgstr "" + +#: templates/hosting/virtual_machine_key.html:15 +msgid "" +"You can view your SSH private key once. Copy it or if it wasn't downloaded " +"automatically, just click on Download to start it." +msgstr "" + +#: templates/hosting/virtual_machine_key.html:24 +msgid "Copy to Clipboard" +msgstr "" + +#: templates/hosting/virtual_machine_key.html:25 +msgid "Download" +msgstr "" + +#: templates/hosting/virtual_machine_key.html:29 +msgid "" +"Your SSH private key was already generated and downloaded, if you lost it, " +"contact us. " +msgstr "" + +#: templates/hosting/virtual_machine_key.html:32 +msgid "Go to my Virtual Machine Dashboard" +msgstr "" + +#: templates/hosting/virtual_machines.html:9 +msgid "Virtual Machines" +msgstr "" + +#: templates/hosting/virtual_machines.html:13 +msgid "ID" +msgstr "" + +#: templates/hosting/virtual_machines.html:14 +msgid "Location" +msgstr "" diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 29fb2861..1eacd26a 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -1,4 +1,5 @@ {% load staticfiles bootstrap3%} +{% load i18n %} @@ -63,44 +64,44 @@ {% if request.user.is_authenticated %}
  • - My Virtual Machines + {% trans "My Virtual Machines"%}
  • - My Orders + {% trans "My Orders"%}
  • - Notifications + {% trans "Notifications "%}
  • {% else %}
  • - How it works + {% trans "How it works"%}
  • - Your infrastructure + {% trans "Your infrastructure"%}
  • - Our inftrastructure + {% trans "Our inftrastructure"%}
  • - Pricing + {% trans "Pricing" %}
  • - Contact + {% trans "Contact"%}
  • - Login + {% trans "Login"%}
  • {% endif %} @@ -123,24 +124,24 @@
    diff --git a/hosting/templates/hosting/confirm_reset_password.html b/hosting/templates/hosting/confirm_reset_password.html index 92513ced..ce4f3ba3 100644 --- a/hosting/templates/hosting/confirm_reset_password.html +++ b/hosting/templates/hosting/confirm_reset_password.html @@ -1,12 +1,13 @@ {% extends "hosting/base_short.html" %} {% load staticfiles bootstrap3%} +{% load i18n %} + {% block content %}
     
    - {% if messages %}
      {% for message in messages %} @@ -15,7 +16,7 @@
    {% endif %} -

    Set your new password

    +

    {% trans "Set your new password"%}

    {% csrf_token %} @@ -24,11 +25,11 @@ {% endfor %} {% buttons %} {% endbuttons %}
    - Already have an account ? Log in + {% trans "Already have an account ?"%}{% trans "Log in"%}
    diff --git a/hosting/templates/hosting/login.html b/hosting/templates/hosting/login.html index 08d1220f..2161f712 100644 --- a/hosting/templates/hosting/login.html +++ b/hosting/templates/hosting/login.html @@ -1,4 +1,5 @@ {% extends "hosting/base_short.html" %} +{% load i18n %} {% load staticfiles bootstrap3%} {% block content %} @@ -18,14 +19,14 @@ {% if request.GET.logged_out %}
    × - You haven been logged out + {% trans "You haven been logged out"%}
    {% endif %} {% endblock %}
    -

    Login

    +

    {% trans "Login"%}

    {% csrf_token %} {% for field in form %} @@ -34,13 +35,13 @@

    {{form.non_field_errors|striptags}}

    {% buttons %} {% endbuttons %}
    - Don't have an account yet ? Sign up + {% trans "Don't have an account yet ? "%}{% trans "Sign up"%}
    - Forgot your password ? + {% trans "Forgot your password ? "%}