From 20e03c700aa36932a5fc7dcfdf98351f1373362a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 14 Dec 2014 00:18:33 +0530 Subject: [PATCH] Update UI strings in user module - Fixed an i18n issue. - Marked more messages for i18n. --- .../modules/users/templates/users_change_password.html | 2 +- plinth/modules/users/templates/users_delete.html | 7 +++---- plinth/modules/users/templates/users_list.html | 4 ---- plinth/modules/users/templates/users_update.html | 6 +++--- plinth/modules/users/views.py | 10 +++++----- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/plinth/modules/users/templates/users_change_password.html b/plinth/modules/users/templates/users_change_password.html index aeff523c4..d35eae3f6 100644 --- a/plinth/modules/users/templates/users_change_password.html +++ b/plinth/modules/users/templates/users_change_password.html @@ -22,7 +22,7 @@ {% block content %} -

Change password of {{ form.user.username }}

+

Change Password for {{ form.user.username }}

diff --git a/plinth/modules/users/templates/users_delete.html b/plinth/modules/users/templates/users_delete.html index 5a7a88e6c..27e8f6b20 100644 --- a/plinth/modules/users/templates/users_delete.html +++ b/plinth/modules/users/templates/users_delete.html @@ -22,10 +22,9 @@ {% block content %} -

Delete User {{ object.username }}

-

- Deleting is permanent. Are you sure? -

+

Delete User {{ object.username }}

+ +

Delete user permanently?

{% csrf_token %} diff --git a/plinth/modules/users/templates/users_list.html b/plinth/modules/users/templates/users_list.html index a4d3f5273..e1ccde1b1 100644 --- a/plinth/modules/users/templates/users_list.html +++ b/plinth/modules/users/templates/users_list.html @@ -22,10 +22,6 @@ {% block content %} -

Users

-

- You can edit or delete users here. -

diff --git a/plinth/modules/users/templates/users_update.html b/plinth/modules/users/templates/users_update.html index 8ff430def..56328c7e5 100644 --- a/plinth/modules/users/templates/users_update.html +++ b/plinth/modules/users/templates/users_update.html @@ -30,13 +30,13 @@ {% block content %} -

Edit {{ object.username }}

+

Edit User {{ object.username }}

Use the - Change password form - to change the password of {{ object.username }}. + change password form + to change the password.


diff --git a/plinth/modules/users/views.py b/plinth/modules/users/views.py index 3950a86f0..7235ba985 100644 --- a/plinth/modules/users/views.py +++ b/plinth/modules/users/views.py @@ -56,7 +56,7 @@ class UserCreate(PlinthContextMixin, SuccessMessageMixin, CreateView): form_class = UserCreationForm template_name = 'users_create.html' model = User - success_message = "%(username)s was created successfully" + success_message = _('User %(username)s created.') success_url = reverse_lazy('users:create') title = _('Create User') @@ -64,7 +64,7 @@ class UserCreate(PlinthContextMixin, SuccessMessageMixin, CreateView): class UserList(PlinthContextMixin, ListView): model = User template_name = 'users_list.html' - title = _('Edit or Delete User') + title = _('Users') class UserUpdate(PlinthContextMixin, SuccessMessageMixin, UpdateView): @@ -72,9 +72,9 @@ class UserUpdate(PlinthContextMixin, SuccessMessageMixin, UpdateView): form_class = UserForm model = User slug_field = "username" - success_message = "User %(username)s was changed successfully" fields = ['username', 'password'] exclude = ('last_login', 'email', 'first_name', 'last_name') + success_message = _('User %(username)s updated.') title = _('Edit User') def get_success_url(self): @@ -99,7 +99,7 @@ class UserDelete(PlinthContextMixin, DeleteView): The SuccessMessageMixin doesn't work with the DeleteView on Django1.7, so set the success message manually here. """ - message = _("User %s was deleted" % self.kwargs['slug']) + message = _('User %s deleted.') % self.kwargs['slug'] output = super(UserDelete, self).delete(*args, **kwargs) messages.success(self.request, message) return output @@ -111,7 +111,7 @@ class UserChangePassword(PlinthContextMixin, SuccessMessageMixin, FormView): slug_field = "username" model = User title = _('Create User') - success_message = _("The password was changed successfully") + success_message = _('Password changed successfully.') def get_form_kwargs(self): """Make the user object available to the form"""