From e49d00294163cc4c79d1201c72247e4a529ef657 Mon Sep 17 00:00:00 2001 From: bgamard Date: Thu, 2 Nov 2017 15:39:50 +0100 Subject: [PATCH] #111: translate templates --- .../controller/settings/SettingsSecurity.js | 2 +- docs-web/src/main/webapp/src/locale/en.json | 125 +++++++++++++++++- .../src/partial/docs/directive.acledit.html | 2 +- .../src/partial/docs/directive.auditlog.html | 2 +- .../src/partial/docs/settings.group.edit.html | 37 +++--- .../src/partial/docs/settings.group.html | 7 +- .../webapp/src/partial/docs/settings.html | 20 +-- .../webapp/src/partial/docs/settings.log.html | 8 +- .../docs/settings.security.disabletotp.html | 10 +- .../src/partial/docs/settings.security.html | 32 ++--- .../src/partial/docs/settings.session.html | 17 ++- .../src/partial/docs/settings.user.edit.html | 73 +++++----- .../src/partial/docs/settings.user.html | 9 +- .../src/partial/docs/settings.vocabulary.html | 14 +- .../webapp/src/partial/docs/tag.default.html | 12 +- .../webapp/src/partial/docs/tag.edit.html | 12 +- .../src/main/webapp/src/partial/docs/tag.html | 10 +- .../webapp/src/partial/docs/user.profile.html | 14 +- .../src/partial/docs/usergroup.default.html | 4 +- .../webapp/src/partial/docs/usergroup.html | 6 +- docs-web/src/main/webapp/src/style/main.less | 5 +- 21 files changed, 263 insertions(+), 158 deletions(-) diff --git a/docs-web/src/main/webapp/src/app/docs/controller/settings/SettingsSecurity.js b/docs-web/src/main/webapp/src/app/docs/controller/settings/SettingsSecurity.js index 91d007c9..27946f37 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/settings/SettingsSecurity.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/settings/SettingsSecurity.js @@ -12,7 +12,7 @@ angular.module('docs').controller('SettingsSecurity', function($scope, User, $di * Enable TOTP. */ $scope.enableTotp = function() { - var title = $translate.instant('settings.security.enable_totp_title'); + var title = $translate.instant('settings.security.enable_totp'); var msg = $translate.instant('settings.security.enable_totp_message'); var btns = [ { result:'cancel', label: $translate.instant('cancel') }, diff --git a/docs-web/src/main/webapp/src/locale/en.json b/docs-web/src/main/webapp/src/locale/en.json index 17cc5573..61d8b4fe 100644 --- a/docs-web/src/main/webapp/src/locale/en.json +++ b/docs-web/src/main/webapp/src/locale/en.json @@ -143,34 +143,117 @@ } }, "tag": { + "new_tag": "New tag", + "search": "Search", + "edit_tag": "Edit tag", + "default": { + "title": "Tags", + "message_1": "Tags are labels associated to documents.", + "message_2": "A document can be tagged by multiple tags, and a tag can be applied to multiple documents.", + "message_3": "Using the button, you can edit permissions on a tag.", + "message_4": "If a tag can be read by another user or group, associated documents can also be read by those people.", + "message_5": "For example, tag your company documents with a tag MyCompany and add the permission Read to a group employees" + }, "edit": { "delete_tag_title": "Delete tag", - "delete_tag_message": "Do you really want to delete this tag?" + "delete_tag_message": "Do you really want to delete this tag?", + "name": "Name", + "color": "Color", + "parent": "Parent", + "info": "Permissions on this tag will also be applied to documents tagged {{ name }}" } }, "group": { - "rofile": { + "profile": { "members": "Members", "no_members": "No member", "related_links": "Related links", "edit_group": "Edit {{ name }} group" } }, + "user": { + "profile": { + "groups": "Groups", + "quota_used": "Quota used", + "percent_used": "{{ percent | number: 0 }}% Used", + "related_links": "Related links", + "document_created": "Documents created by {{ username }}", + "edit_user": "Edit {{ username }} user" + } + }, + "usergroup": { + "search_groups": "Search in groups", + "search_users": "Search in users", + "you": "It's you!", + "default": { + "title": "Users & Groups", + "message": "Here you can view informations about users and groups." + } + }, "settings": { + "menu_personal_settings": "Personal settings", + "menu_user_account": "User account", + "menu_two_factor_auth": "Two-factor authentication", + "menu_opened_sessions": "Opened sessions", + "menu_general_settings": "General settings", + "menu_users": "Users", + "menu_groups": "Groups", + "menu_vocabularies": "Vocabularies", + "menu_configuration": "Configuration", + "menu_server_logs": "Server logs", "user": { + "title": "Users management", + "add_user": "Add a user", + "username": "Username", + "create_date": "Create date", "edit": { "delete_user_title": "Delete user", - "delete_user_message": "Do you really want to delete this user? All associated documents, files and tags will be deleted" + "delete_user_message": "Do you really want to delete this user? All associated documents, files and tags will be deleted", + "edit_user_title": "Edit \"{{ username }}\"", + "add_user_title": "Add user", + "username": "Username", + "email": "E-mail", + "groups": "Groups", + "storage_quota": "Storage quota", + "storage_quota_placeholder": "Storage quota (in MB)", + "password": "Password", + "password_confirm": "Password (confirm)" } }, "security": { - "enable_totp_title": "Enable two-factor authentication", - "enable_totp_message": "Make sure you have a TOTP-compatible application on your phone ready to add a new account" + "enable_totp": "Enable two-factor authentication", + "enable_totp_message": "Make sure you have a TOTP-compatible application on your phone ready to add a new account", + "title": "Two-factor authentication", + "message_1": "Two-factor authentication allows you to add a layer of security on your {{ appName }} account.
Before activating this feature, make sure you have a TOTP-compatible app on your phone:", + "message_google_authenticator": "For Android, iOS, and Blackberry: Google Authenticator", + "message_duo_mobile": "For Android and iOS: Duo Mobile", + "message_authenticator": "For Windows Phone: Authenticator", + "message_2": "Those applications automatically generate a validation code that changes after a certain period of time.
You will be required to enter this validation code each time you login on {{ appName }}.", + "secret_key": "Your secret key is: {{ secret }}", + "secret_key_warning": "Configure your TOTP app on your phone with this secret key now, you will not be able to access it later.", + "totp_enabled_message": "Two-factor authentication is enabled on your account.
Each time you login on {{ appName }}, you will be asked a validation code from your configured phone app.
If you loose your phone, you will not be able to login into your account but active sessions will allow you to regenerate a secrey key.", + "disable_totp": { + "disable_totp": "Disable two-factor authentication", + "message": "Your account will not be protected by the two-factor authentication anymore.", + "confirm_password": "Confirm your password", + "submit": "Disable two-factor authentication" + } }, "group": { + "title": "Groups management", + "add_group": "Add a group", + "name": "Name", "edit": { "delete_group_title": "Delete group", - "delete_group_message": "Do you really want to delete this group?" + "delete_group_message": "Do you really want to delete this group?", + "edit_group_title": "Edit \"{{ name }}\"", + "add_group_title": "Add group", + "name": "Name", + "parent_group": "Parent group", + "search_group": "Search a group", + "members": "Members", + "new_member": "New member", + "search_user": "Search a user" } }, "account": { @@ -191,6 +274,31 @@ "logo": "Logo (squared size)", "background_image": "Background image", "uploading_image": "Uploading the image..." + }, + "log": { + "title": "Server logs", + "date": "Date", + "tag": "Tag", + "message": "Message" + }, + "session": { + "title": "Opened sessions", + "created_date": "Created date", + "last_connection_date": "Last connection date", + "user_agent": "From", + "current": "Current", + "current_session": "This is the current session", + "clear_message": "All other devices connected to this account will be disconnected", + "clear": "Clear all other sessions" + }, + "vocabulary": { + "title": "Vocabulary entries", + "choose_vocabulary": "Choose a vocabulary to edit", + "type": "Type", + "coverage": "Coverage", + "rights": "Rights", + "value": "Value", + "order": "Order" } }, "directive": { @@ -230,7 +338,10 @@ "required": "Required", "too_short": "Too short", "too_long": "Too long", - "password_confirm": "Password and password confirmation must match" + "email": "Must be a valid e-mail", + "password_confirm": "Password and password confirmation must match", + "number": "Number required", + "no_space": "Space are not allowed" }, "ok": "OK", "cancel": "Cancel", diff --git a/docs-web/src/main/webapp/src/partial/docs/directive.acledit.html b/docs-web/src/main/webapp/src/partial/docs/directive.acledit.html index 2f542bcc..83cb6051 100644 --- a/docs-web/src/main/webapp/src/partial/docs/directive.acledit.html +++ b/docs-web/src/main/webapp/src/partial/docs/directive.acledit.html @@ -9,7 +9,7 @@ - {{ a.perm }} + {{ 'acl.' + a.perm | translate }} diff --git a/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html b/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html index e8527c54..61794c1a 100644 --- a/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html +++ b/docs-web/src/main/webapp/src/partial/docs/directive.auditlog.html @@ -28,7 +28,7 @@ {{ 'see' | translate }} - {{ log.message }} + {{ 'acl.' + log.message | translate }} {{ log.message }} diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html b/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html index 1a49d88c..221dbedc 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html @@ -1,33 +1,29 @@
-

Edit - "{{ group.name }}" -

-

Add - group -

+

+

+
- - +
+ ng-minlength="3" ng-maxlength="50" placeholder="{{ 'settings.group.edit.name' | translate }}" ng-model="group.name"/>
- Required - Too short - Too long + {{ 'validation.required' | translate }} + {{ 'validation.too_short' | translate }} + {{ 'validation.too_long' | translate }}
- +
@@ -35,29 +31,30 @@
-

Members

+

{{ 'settings.group.edit.members' | translate }}

- +
-
- +
Groups management Add a group +

+ + {{ 'settings.group.add_group' | translate }} +

- + diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.html b/docs-web/src/main/webapp/src/partial/docs/settings.html index 6c574a65..a022d7b2 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.html @@ -1,22 +1,22 @@
diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.log.html b/docs-web/src/main/webapp/src/partial/docs/settings.log.html index 32769daa..f6843bed 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.log.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.log.html @@ -1,10 +1,10 @@ -

Server logs

+

Name{{ 'settings.group.name' | translate }}
- - - + + + diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.security.disabletotp.html b/docs-web/src/main/webapp/src/partial/docs/settings.security.disabletotp.html index 9d13d383..8a41aef9 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.security.disabletotp.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.security.disabletotp.html @@ -1,18 +1,18 @@ \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.security.html b/docs-web/src/main/webapp/src/partial/docs/settings.security.html index eaa75515..33ed422d 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.security.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.security.html @@ -1,43 +1,33 @@

- Two-factor authentication + {{ user.totp_enabled ? 'Enabled' : 'Disabled' }}

-

- Two-factor authentication allows you to add a layer of security on your {{ appName }} account.
- Before activating this feature, make sure you have a TOTP-compatible app on your phone: -

+

+

- Those applications automatically generate a validation code that changes after a certain period of time.
- You will be required to enter this validation code each time you login on {{ appName }}. -

-

- +

-

Your secret key is: {{ secret }}

+

- Configure your TOTP app on your phone with this secret key now, you will not be able to access it later. + {{ 'settings.security.secret_key_warning' | translate }}

+

- Two-factor authentication is enabled on your account.
- Each time you login on {{ appName }}, you will be asked a validation code from your configured phone app.
- If you loose your phone, you will not be able to login into your account but active sessions will allow you to regenerate a secrey key. -

-

- +

\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.session.html b/docs-web/src/main/webapp/src/partial/docs/settings.session.html index 2b5c015b..e7da00d7 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.session.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.session.html @@ -1,11 +1,11 @@ -

Opened sessions

+

DateTagMessage{{ 'settings.log.date' | translate }}{{ 'settings.log.tag' | translate }}{{ 'settings.log.message' | translate }}
- - - - + + + + @@ -14,11 +14,14 @@
Created dateLast connection dateFromCurrent{{ 'settings.session.created_date' | translate }}{{ 'settings.session.last_connection_date' | translate }}{{ 'settings.session.user_agent' | translate }}{{ 'settings.session.current' | translate }}
{{ session.last_connection_date | date: 'yyyy-MM-dd HH:mm' }} {{ session.ip }} - +
- +
\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html b/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html index 88d44636..69d98f96 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html @@ -1,45 +1,41 @@
-

Edit - "{{ user.username }}" -

-

Add - user -

+

+

+
- - +
+ ng-minlength="3" ng-maxlength="50" placeholder="{{ 'settings.user.edit.username' | translate }}" ng-model="user.username"/>
- Required - Too short - Too long + {{ 'validation.required' | translate }} + {{ 'validation.too_short' | translate }} + {{ 'validation.too_long' | translate }}
+
- - +
+ ng-minlength="1" ng-maxlength="100" placeholder="{{ 'settings.user.edit.username' | translate }}" ng-model="user.email"/>
- Required - Must be a valid e-mail - Too short - Too long + {{ 'validation.required' | translate }} + {{ 'validation.email' | translate }} + {{ 'validation.too_short' | translate }} + {{ 'validation.too_long' | translate }}
-
- +
+
-
- +
+
-
MB
+ ng-pattern="/[0-9]*/" placeholder="{{ 'settings.user.edit.storage_quota_placeholder' | translate }}" ng-model="user.storage_quota"/> +
{{ 'filter.filesize.mb' | translate }}
- Number required + {{ 'validation.number' | translate }}
+
- - +
+ ng-minlength="8" ng-maxlength="50" placeholder="{{ 'settings.user.edit.password' | translate }}" ng-model="user.password"/>
- Required - Too short - Too long + {{ 'validation.required' | translate }} + {{ 'validation.too_short' | translate }} + {{ 'validation.too_long' | translate }}
+
- - +
+ placeholder="{{ 'settings.user.edit.password_confirm' | translate }}" ng-model="user.passwordconfirm"/>
- Password and password confirmation must match + {{ 'validation.password_confirm' | translate }}
+
diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.user.html b/docs-web/src/main/webapp/src/partial/docs/settings.user.html index 2f4e991e..e0a9fb64 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.user.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.user.html @@ -1,12 +1,15 @@ -

Users management Add a user

+

+ + {{ 'settings.user.add_user' | translate }} +

- - + + diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.vocabulary.html b/docs-web/src/main/webapp/src/partial/docs/settings.vocabulary.html index a7a1e82a..7d6c871b 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.vocabulary.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.vocabulary.html @@ -1,13 +1,13 @@ -

Vocabulary entries

+

- +
@@ -15,8 +15,8 @@
UsernameCreate date{{ 'settings.user.username' | translate }}{{ 'settings.user.create_date' | translate }}
- - + + diff --git a/docs-web/src/main/webapp/src/partial/docs/tag.default.html b/docs-web/src/main/webapp/src/partial/docs/tag.default.html index f9af3e0f..763a9872 100644 --- a/docs-web/src/main/webapp/src/partial/docs/tag.default.html +++ b/docs-web/src/main/webapp/src/partial/docs/tag.default.html @@ -1,6 +1,6 @@ -

Tags

-

Tags are labels associated to documents.

-

A document can be tagged by multiple tags, and a tag can be applied to multiple documents.

-

Using the button, you can edit permissions on a tag.

-

If a tag can be read by another user or group, associated documents can also be read by those people.

-

For example, tag your company documents with a tag MyCompany and add the permission Read to a group employees

\ No newline at end of file +

{{ 'tag.default.title' | translate }}

+

+

+

+

+

\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/tag.edit.html b/docs-web/src/main/webapp/src/partial/docs/tag.edit.html index 398470b6..d8d56de7 100644 --- a/docs-web/src/main/webapp/src/partial/docs/tag.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/tag.edit.html @@ -1,5 +1,5 @@
- +
ValueOrder{{ 'settings.vocabulary.value' | translate }}{{ 'settings.vocabulary.order' | translate }}
@@ -25,7 +25,7 @@ {{ tag.name }} diff --git a/docs-web/src/main/webapp/src/partial/docs/user.profile.html b/docs-web/src/main/webapp/src/partial/docs/user.profile.html index b67c0f6c..96a9ac1d 100644 --- a/docs-web/src/main/webapp/src/partial/docs/user.profile.html +++ b/docs-web/src/main/webapp/src/partial/docs/user.profile.html @@ -2,34 +2,34 @@

{{ user.username }} {{ user.email }}

-

Groups

+

{{ 'user.profile.groups' | translate }}

-

Quota used

+

{{ 'user.profile.quota_used' | translate }}

-
+
- {{ (user.storage_current / user.storage_quota * 100) }}% Used + {{ 'user.profile.percent_used' | translate: '{ percent: user.storage_current / user.storage_quota * 100 }' }}
-

Related links

+

{{ 'user.profile.related_links' | translate }}

\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/usergroup.default.html b/docs-web/src/main/webapp/src/partial/docs/usergroup.default.html index 5899b461..f53aee74 100644 --- a/docs-web/src/main/webapp/src/partial/docs/usergroup.default.html +++ b/docs-web/src/main/webapp/src/partial/docs/usergroup.default.html @@ -1,2 +1,2 @@ -

Users & Groups

-

Here you can view informations about users and groups.

\ No newline at end of file +

{{ 'usergroup.default.title' | translate }}

+

{{ 'usergroup.default.message' | translate }}

diff --git a/docs-web/src/main/webapp/src/partial/docs/usergroup.html b/docs-web/src/main/webapp/src/partial/docs/usergroup.html index 6e0000b1..1f169664 100644 --- a/docs-web/src/main/webapp/src/partial/docs/usergroup.html +++ b/docs-web/src/main/webapp/src/partial/docs/usergroup.html @@ -3,7 +3,7 @@

- +

- +
@@ -21,7 +21,7 @@

- +

@@ -31,7 +31,7 @@ diff --git a/docs-web/src/main/webapp/src/style/main.less b/docs-web/src/main/webapp/src/style/main.less index 070ca65f..95c27a17 100644 --- a/docs-web/src/main/webapp/src/style/main.less +++ b/docs-web/src/main/webapp/src/style/main.less @@ -35,11 +35,12 @@ // Documents list .table-documents { thead th { - cursor: pointer; + cursor: pointer; + white-space: nowrap; } tbody tr { - cursor: pointer; + cursor: pointer; } .cell-tags {
{{ user.username }} - It's you! + {{ 'usergroup.you' | translate }}