2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

More work on translations

This commit is contained in:
Oliver Walters
2020-02-12 10:25:46 +11:00
parent 28e9d842bf
commit 50fee1bfe5
7 changed files with 644 additions and 189 deletions

View File

@ -6,6 +6,7 @@ Django views for interacting with Company app
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
from django.views.generic import DetailView, ListView, UpdateView
from django.urls import reverse
@ -93,12 +94,12 @@ class CompanyImage(AjaxUpdateView):
""" View for uploading an image for the Company """
model = Company
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Update Company Image'
ajax_form_title = _('Update Company Image')
form_class = CompanyImageForm
def get_data(self):
return {
'success': 'Updated company image',
'success': _('Updated company image'),
}
@ -108,11 +109,11 @@ class CompanyEdit(AjaxUpdateView):
form_class = EditCompanyForm
context_object_name = 'company'
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Edit Company'
ajax_form_title = _('Edit Company')
def get_data(self):
return {
'info': 'Edited company information',
'info': _('Edited company information'),
}
@ -122,11 +123,11 @@ class CompanyCreate(AjaxCreateView):
context_object_name = 'company'
form_class = EditCompanyForm
ajax_template_name = 'modal_form.html'
ajax_form_title = "Create new Company"
ajax_form_title = _("Create new Company")
def get_data(self):
return {
'success': "Created new company",
'success': _("Created new company"),
}
@ -136,12 +137,12 @@ class CompanyDelete(AjaxDeleteView):
model = Company
success_url = '/company/'
ajax_template_name = 'company/delete.html'
ajax_form_title = 'Delete Company'
ajax_form_title = _('Delete Company')
context_object_name = 'company'
def get_data(self):
return {
'danger': 'Company was deleted',
'danger': _('Company was deleted'),
}
@ -166,7 +167,7 @@ class SupplierPartEdit(AjaxUpdateView):
context_object_name = 'part'
form_class = EditSupplierPartForm
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Edit Supplier Part'
ajax_form_title = _('Edit Supplier Part')
class SupplierPartCreate(AjaxCreateView):
@ -175,7 +176,7 @@ class SupplierPartCreate(AjaxCreateView):
model = SupplierPart
form_class = EditSupplierPartForm
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Create new Supplier Part'
ajax_form_title = _('Create new Supplier Part')
context_object_name = 'part'
def get_form(self):
@ -232,7 +233,7 @@ class SupplierPartDelete(AjaxDeleteView):
success_url = '/supplier/'
ajax_template_name = 'company/partdelete.html'
ajax_form_title = 'Delete Supplier Part'
ajax_form_title = _('Delete Supplier Part')
parts = []
@ -302,7 +303,7 @@ class PriceBreakCreate(AjaxCreateView):
model = SupplierPriceBreak
form_class = EditPriceBreakForm
ajax_form_title = 'Add Price Break'
ajax_form_title = _('Add Price Break')
ajax_template_name = 'modal_form.html'
def get_data(self):
@ -337,7 +338,7 @@ class PriceBreakEdit(AjaxUpdateView):
model = SupplierPriceBreak
form_class = EditPriceBreakForm
ajax_form_title = 'Edit Price Break'
ajax_form_title = _('Edit Price Break')
ajax_template_name = 'modal_form.html'
def get_form(self):
@ -352,5 +353,5 @@ class PriceBreakDelete(AjaxDeleteView):
""" View for deleting a supplier price break """
model = SupplierPriceBreak
ajax_form_title = "Delete Price Break"
ajax_form_title = _("Delete Price Break")
ajax_template_name = 'modal_delete_form.html'