From cb02c6e4a638d47027a2950167d486b25af92c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Mendon=C3=A7a?= Date: Sat, 8 Jul 2017 09:06:09 +0100 Subject: [PATCH 01/45] i18n review (#118) * Change "Todo" -> "Task" for consistency of terms * Change "To-do"/"To-to" -> "Task" for consistency of terms * Change "id" to "ID" for consistency of terms and merge similar strings. This will reduce the strings number Typo correction "milestoe" * Correct typos * Correct typos in "Sorry! You..." strings and improve consistency * Remove unnecessary ending space " " * Change "To Do" -> "Task" for consistency of terms * Change settings titles to improve consistency * Change "Co-worker" strings to improve consistency and merge similar strings * Change "Co-worker" strings to improve consistency and merge similar strings (#2) * Merge similar strings * Gettext/textdomain issues Add missing gettext functions Add missing textdomains Change wrong textdomains * Change strings to improve consistency and merge similar strings --- class/activity.php | 34 ++++++++-------- class/admin.php | 18 ++++----- class/ajax.php | 20 +++++----- class/project.php | 2 +- class/task.php | 32 +++++++-------- class/validator.php | 2 +- includes/cpm-api/class-cpm-json-comments.php | 30 +++++++------- includes/cpm-api/class-cpm-json-lists.php | 26 ++++++------ includes/cpm-api/class-cpm-json-messages.php | 22 +++++----- .../cpm-api/class-cpm-json-milestones.php | 28 ++++++------- includes/cpm-api/class-cpm-json-projects.php | 12 +++--- includes/cpm-api/class-cpm-json-tasks.php | 36 ++++++++--------- includes/functions.php | 16 ++++---- includes/html.php | 40 +++++++++---------- includes/integrations/erp/views/fields.php | 2 +- includes/integrations/erp/views/task-form.php | 6 +-- includes/lib/class-wedevs-insights.php | 14 +++---- views/blanktemplate/todolist.php | 8 ++-- views/emails/complete-task.php | 2 +- views/emails/new-message.php | 4 +- views/emails/new-task.php | 2 +- views/js-templates/blanktemplate/todolist.php | 8 ++-- views/js-templates/list-comment-form.php | 4 +- views/js-templates/list-comments.php | 2 +- views/js-templates/list-corner-menu.php | 4 +- views/js-templates/new-task-form.php | 12 +++--- views/js-templates/task-comment-form.php | 4 +- views/js-templates/todo-list-form.php | 4 +- views/js-templates/todo-list-single.php | 4 +- views/js-templates/todo-list.php | 2 +- views/project/overview.php | 4 +- views/project/wp-mail.php | 8 ++-- views/task/index.php | 2 +- views/task/single.php | 2 +- views/task/task-single.php | 4 +- 35 files changed, 210 insertions(+), 210 deletions(-) diff --git a/class/activity.php b/class/activity.php index 292fbe3bd..335941e8d 100644 --- a/class/activity.php +++ b/class/activity.php @@ -86,7 +86,7 @@ function message_new( $message_id, $project_id ) { } $msg = get_post( $message_id ); $message = sprintf( - __( 'Message %s created by %s', 'cpm' ), $this->message_url( $message_id, $project_id, $msg->post_title ), $this->user_url() + __( 'Message "%s" created by %s', 'cpm' ), $this->message_url( $message_id, $project_id, $msg->post_title ), $this->user_url() ); $this->log( $project_id, $message ); @@ -98,7 +98,7 @@ function message_update( $message_id, $project_id ) { } $msg = get_post( $message_id ); $message = sprintf( - __( 'Message %s updated by %s', 'cpm' ), $this->message_url( $message_id, $project_id, $msg->post_title ), $this->user_url() + __( 'Message "%s" updated by %s', 'cpm' ), $this->message_url( $message_id, $project_id, $msg->post_title ), $this->user_url() ); $this->log( $project_id, $message ); @@ -140,7 +140,7 @@ function tasklist_new( $list_id, $project_id ) { $list = get_post( $list_id ); $message = sprintf( - __( 'To-do list %s created by %s', 'cpm' ), $this->list_url( $list_id, $project_id, $list->post_title ), $this->user_url() + __( 'Task list "%s" created by %s', 'cpm' ), $this->list_url( $list_id, $project_id, $list->post_title ), $this->user_url() ); $this->log( $project_id, $message ); @@ -153,7 +153,7 @@ function tasklist_update( $list_id, $project_id ) { $list = get_post( $list_id ); $message = sprintf( - __( 'To-do list %s updated by %s', 'cpm' ), $this->list_url( $list_id, $project_id, $list->post_title ), $this->user_url() + __( 'Task list "%s" updated by %s', 'cpm' ), $this->list_url( $list_id, $project_id, $list->post_title ), $this->user_url() ); $this->log( $project_id, $message ); @@ -166,7 +166,7 @@ function tasklist_delete( $list_id ) { $list = get_post( $list_id ); $message = sprintf( - __( 'To-do list "%s" deleted by %s', 'cpm' ), $list->post_title, $this->user_url() + __( 'Task list "%s" deleted by %s', 'cpm' ), $list->post_title, $this->user_url() ); $this->log( $list->post_parent, $message ); @@ -190,7 +190,7 @@ function task_new( $list_id, $task_id ) { $task = get_post( $task_id ); $message = sprintf( - __( 'To-do %s added on to-do list %s by %s', 'cpm' ), $this->task_url( $task_id, $list_id, $list->post_parent, $task->post_title ), $this->list_url( $list_id, $list->post_parent, $list->post_title ), $this->user_url() + __( 'Task "%s" added to task list "%s" by %s', 'cpm' ), $this->task_url( $task_id, $list_id, $list->post_parent, $task->post_title ), $this->list_url( $list_id, $list->post_parent, $list->post_title ), $this->user_url() ); $this->log( $list->post_parent, $message ); @@ -206,7 +206,7 @@ function task_update( $list_id, $task_id ) { $task = get_post( $task_id ); $message = sprintf( - __( 'To-do %s updated by %s', 'cpm' ), $this->task_url( $task_id, $list_id, $list->post_parent, $task->post_title ), $this->user_url() + __( 'Task "%s" updated by %s', 'cpm' ), $this->task_url( $task_id, $list_id, $list->post_parent, $task->post_title ), $this->user_url() ); $this->log( $list->post_parent, $message ); @@ -222,10 +222,10 @@ function task_done( $task_id ) { $list = get_post( $task->post_parent ); $message = sprintf( - __( 'To-do %s completed by %s', 'cpm' ), $this->task_url( $task_id, $list->ID, $list->post_parent, $task->post_title ), $this->user_url() + __( 'Task "%s" completed by %s', 'cpm' ), $this->task_url( $task_id, $list->ID, $list->post_parent, $task->post_title ), $this->user_url() ); - $task_message = sprintf( __( 'Marked to-do as done', 'cpm' ) ); + $task_message = sprintf( __( 'Marked task as done', 'cpm' ) ); $this->log( $list->post_parent, $message ); $this->log( $task_id, $task_message ); @@ -240,10 +240,10 @@ function task_undo( $task_id ) { $list = get_post( $task->post_parent ); $message = sprintf( - __( 'To-do %s marked un-done by %s', 'cpm' ), $this->task_url( $task_id, $list->ID, $list->post_parent, $task->post_title ), $this->user_url() + __( 'Task "%s" marked as undone by %s', 'cpm' ), $this->task_url( $task_id, $list->ID, $list->post_parent, $task->post_title ), $this->user_url() ); - $task_message = sprintf( __( 'Re-opened to-do', 'cpm' ) ); + $task_message = sprintf( __( 'Reopened task', 'cpm' ) ); $this->log( $list->post_parent, $message ); $this->log( $task_id, $task_message ); @@ -258,7 +258,7 @@ function task_delete( $task_id ) { $list = get_post( $task->post_parent ); $message = sprintf( - __( 'To-do "%s" deleted from to-do list %s by %s', 'cpm' ), $task->post_title, $this->list_url( $list->ID, $list->post_parent, $list->post_title ), $this->user_url() + __( 'Task "%s" deleted from task list "%s" by %s', 'cpm' ), $task->post_title, $this->list_url( $list->ID, $list->post_parent, $list->post_title ), $this->user_url() ); $this->log( $list->post_parent, $message ); @@ -299,7 +299,7 @@ function milestone_new( $milestone_id, $project_id ) { } $milestone = get_post( $milestone_id ); - $message = sprintf( __( 'Milestone "%s" added by %s ', 'cpm' ), $milestone->post_title, $this->user_url() ); + $message = sprintf( __( 'Milestone "%s" added by %s', 'cpm' ), $milestone->post_title, $this->user_url() ); $this->log( $project_id, $message ); } @@ -310,7 +310,7 @@ function milestone_update( $milestone_id, $project_id ) { } $milestone = get_post( $milestone_id ); - $message = sprintf( __( 'Milestone "%s" updated by %s ', 'cpm' ), $milestone->post_title, $this->user_url() ); + $message = sprintf( __( 'Milestone "%s" updated by %s', 'cpm' ), $milestone->post_title, $this->user_url() ); $this->log( $project_id, $message ); } @@ -321,7 +321,7 @@ function milestone_delete( $milestone_id ) { } $milestone = get_post( $milestone_id ); - $message = sprintf( __( 'Milestone "%s" deleted by %s ', 'cpm' ), $milestone->post_title, $this->user_url() ); + $message = sprintf( __( 'Milestone "%s" deleted by %s', 'cpm' ), $milestone->post_title, $this->user_url() ); $this->log( $_POST['project_id'], $message ); } @@ -332,7 +332,7 @@ function milestone_done( $milestone_id ) { } $milestone = get_post( $milestone_id ); - $message = sprintf( __( 'Milestone "%s" marked as complete by %s ', 'cpm' ), $milestone->post_title, $this->user_url() ); + $message = sprintf( __( 'Milestone "%s" marked as complete by %s', 'cpm' ), $milestone->post_title, $this->user_url() ); $this->log( $_POST['project_id'], $message ); } @@ -343,7 +343,7 @@ function milestone_open( $milestone_id ) { } $milestone = get_post( $milestone_id ); - $message = sprintf( __( 'Milestone "%s" marked as incomplete by %s ', 'cpm' ), $milestone->post_title, $this->user_url() ); + $message = sprintf( __( 'Milestone "%s" marked as incomplete by %s', 'cpm' ), $milestone->post_title, $this->user_url() ); $this->log( $_POST['project_id'], $message ); } diff --git a/class/admin.php b/class/admin.php index ba973852f..63a7e1ad6 100644 --- a/class/admin.php +++ b/class/admin.php @@ -63,9 +63,9 @@ static function get_settings_fields() { } $role_names = $wp_roles->get_names(); - $url_links['backend'] = 'Link to Backend'; + $url_links['backend'] = __( 'Link to Backend', 'cpm' ); if ( cpm_is_pro() ) { - $url_links['frontend'] = 'Link to Front-end'; + $url_links['frontend'] = __( 'Link to Front-end', 'cpm' ); }; $settings_fields['cpm_general'] = apply_filters( 'cpm_settings_field_general', array( @@ -73,7 +73,7 @@ static function get_settings_fields() { 'name' => 'upload_limit', 'label' => __( 'File Upload Limit', 'cpm' ), 'default' => '2', - 'desc' => __( 'File Size in Megabytes. e.g: 2' ) + 'desc' => __( 'File Size in Megabytes. e.g: 2', 'cpm' ) ), array( 'name' => 'pagination', @@ -84,26 +84,26 @@ static function get_settings_fields() { ), array( 'name' => 'todolist_show', - 'label' => __( 'To-do List Style', 'cpm' ), + 'label' => __( 'Task List Style', 'cpm' ), 'type' => 'radio', 'default' => 'pagination', - 'options' => array( 'pagination' => 'Pagination', 'load_more' => 'Load More', 'lazy_load' => 'Lazy Load' ) + 'options' => array( 'pagination' => __( 'Pagination', 'cpm' ), 'load_more' => __( 'Load More', 'cpm' ), 'lazy_load' => __( 'Lazy Load', 'cpm' ) ) ), array( 'name' => 'show_todo', - 'label' => __( 'To-do Lists Per Page', 'cpm' ), + 'label' => __( 'Task Lists Per Page', 'cpm' ), 'type' => 'text', 'default' => '5', ), array( 'name' => 'show_incomplete_tasks', - 'label' => __( 'Incomplete tasks per page', 'cpm' ), + 'label' => __( 'Incomplete Tasks Per Page', 'cpm' ), 'type' => 'text', 'default' => '50', ), array( 'name' => 'show_completed_tasks', - 'label' => __( 'Completed tasks per page', 'cpm' ), + 'label' => __( 'Completed Tasks Per Page', 'cpm' ), 'type' => 'text', 'default' => '50', ), @@ -156,7 +156,7 @@ static function get_settings_fields() { 'label' => __( 'Send email via Bcc', 'cpm' ), 'type' => 'checkbox', 'default' => 'off', - 'desc' => __( 'Enable Bcc' ) + 'desc' => __( 'Enable Bcc', 'cpm' ) ), ) ); diff --git a/class/ajax.php b/class/ajax.php index ea9bae926..df8749beb 100644 --- a/class/ajax.php +++ b/class/ajax.php @@ -209,7 +209,7 @@ function initial_todo_list() { $project_id = absint( $_POST['project_id'] ); if ( ! $project_id ) { - wp_send_json_error( array( 'error' => __( 'Invalid project id', 'cpm' ) ) ); + wp_send_json_error( array( 'error' => __( 'Invalid project ID.', 'cpm' ) ) ); } $permission = $permission = $this->permissions( $project_id ); @@ -402,7 +402,7 @@ function create_user() { function form_validate( $postdata ) { if ( empty( $postdata[ 'user_name' ] ) ) { - return new WP_Error( 'error', __( 'Username required ', 'cpm' ) ); + return new WP_Error( 'error', __( 'Username required', 'cpm' ) ); } if ( empty( $postdata[ 'user_email' ] ) ) { @@ -558,7 +558,7 @@ function user_role_table_generator( $project ) { id="cpm-co-worker-" name="role[]" value="co_worker"> - @@ -683,7 +683,7 @@ function update_task() { wp_send_json_error( array( 'error' => $error->get_error_messages() ) ); } - wp_send_json_success( array( 'success' => __( 'The task has been updated successfully..', 'cpm' ), 'task' => $task ) ); + wp_send_json_success( array( 'success' => __( 'The task has been updated successfully.', 'cpm' ), 'task' => $task ) ); } function check_task_access() { @@ -807,7 +807,7 @@ function add_tasklist() { ]; $error_messages = [ - 'tasklist_name.required' => __( 'Todo list name is required.', 'cpm' ), + 'tasklist_name.required' => __( 'Task list name is required.', 'cpm' ), ]; if ( !$validator->validate( $posted, $rules, $error_messages ) ) { @@ -838,7 +838,7 @@ function add_tasklist() { wp_send_json_error( array( 'error' => $error->get_error_messages() ) ); } - wp_send_json_success( array( 'success' => __( 'A new todo list has been created successfully.', 'cpm' ), 'list' => $response ) ); + wp_send_json_success( array( 'success' => __( 'A new task list has been created successfully.', 'cpm' ), 'list' => $response ) ); } function update_tasklist() { @@ -856,7 +856,7 @@ function update_tasklist() { ]; $error_messages = [ - 'tasklist_name.required' => __( 'Todo list name is required.', 'cpm' ), + 'tasklist_name.required' => __( 'Task list name is required.', 'cpm' ), ]; if ( !$validator->validate( $posted, $rules, $error_messages ) ) { @@ -884,7 +884,7 @@ function update_tasklist() { wp_send_json_error( array( 'error' => $list_id->get_error_messages() ) ); } - wp_send_json_success( array( 'list' => $list, 'success' => __( 'Todo list has been updated successfully.', 'cpm' ) ) ); + wp_send_json_success( array( 'list' => $list, 'success' => __( 'Task list has been updated successfully.', 'cpm' ) ) ); } function add_new_list_kyes( $list, $project_id ) { @@ -923,7 +923,7 @@ function delete_tasklist() { CPM_Task::getInstance()->delete_list( $_POST[ 'list_id' ], true ); do_action( 'cpm_delete_tasklist_after', $_POST[ 'list_id' ] ); - wp_send_json_success( array( 'success' => __( 'Todo list has been deleted successfully.', 'cpm' ) ) ); + wp_send_json_success( array( 'success' => __( 'Task list has been deleted successfully.', 'cpm' ) ) ); } else { $error = new WP_Error( 'permission', 'You do not have permission to add new todo list', 'cpm' ); wp_send_json_error( array( 'error' => $error->get_error_messages() ) ); @@ -1569,7 +1569,7 @@ function create_user_meta( $display_name, $user_id ) { - diff --git a/class/project.php b/class/project.php index c9a6472df..a4c5b76b3 100644 --- a/class/project.php +++ b/class/project.php @@ -698,7 +698,7 @@ function nav_links( $project_id ) { 'count' => $project_info->discussion, 'class' => 'message cpm-sm-col-12' ), - __( 'To-do Lists', 'cpm' ) => array( + __( 'Task Lists', 'cpm' ) => array( 'url' => cpm_url_tasklist_index( $project_id ), 'count' => $project_info->todolist, 'class' => 'to-do-list cpm-sm-col-12' diff --git a/class/task.php b/class/task.php index f866252b6..e2a61af0c 100644 --- a/class/task.php +++ b/class/task.php @@ -39,23 +39,23 @@ function show_message( $message ) { 'project_obj' => $project_obj, 'base_url' => CPM_URL, 'static_text' => array ( - 'confirm_pin' => __( 'Sure to confirm pin task list' ), - 'confirm_unpin' => __( 'Sure to confirm un-pin task list' ), + 'confirm_pin' => __( 'Sure to confirm pin task list', 'cpm' ), + 'confirm_unpin' => __( 'Sure to confirm un-pin task list', 'cpm' ), 'file_upload' => __( 'File uploads', 'cpm' ), 'attach_file' => __( 'Attach a File', 'cpm' ), 'submit' => __( 'Submit', 'cpm' ), 'update_btn_text' => __( 'Update', 'cpm' ), 'cancel' => __( 'Cancel', 'cpm' ), - 'tasklist_submit_btn_text' => __( 'Add Task List' ), - 'tasklist_update_btn_text' => __( 'Update Task List' ), - 'add_task_btn' => __( "Add Task" ), - 'confirm_update' => __( "Are you confirm to update task status?" ), + 'tasklist_submit_btn_text' => __( 'Add Task List', 'cpm' ), + 'tasklist_update_btn_text' => __( 'Update Task List', 'cpm' ), + 'add_task_btn' => __( 'Add Task', 'cpm' ), + 'confirm_update' => __( 'Are you confirm to update task status?', 'cpm' ), // - 'add_a_new_todo' => __( "Add a new to-do", 'cpm' ), - 'add_todo_details_text' => __( 'Add extra details about this to-do (optional)', 'cpm' ), + 'add_a_new_todo' => __( "Add a new task", 'cpm' ), + 'add_todo_details_text' => __( 'Add extra details about this task (optional)', 'cpm' ), 'title' => __( 'Title', 'cpm' ), 'start_date' => __( 'Start Date', 'cpm' ), - 'due_date' => __( 'Due date', 'cpm' ), + 'due_date' => __( 'Due Date', 'cpm' ), 'to_attach' => __( 'To attach', 'cpm' ), 'select_file' => __( 'select files', 'cpm' ), 'from_computer' => __( 'from your computer', 'cpm' ), @@ -69,14 +69,14 @@ function show_message( $message ) { 'add_comment' => __( 'Add Comment', 'cpm' ), 'delete_confirm' => __( 'Are you sure to delete this file?', 'cpm' ), 'empty_comment' => __( 'Please write something in comments!', 'cpm' ), - 'backtotasklist' => __( 'Back to To-do Lists', 'cpm' ), - 'todolist' => __( 'To-Do Lists', 'cpm' ), - 'todolist_n_title' => __( 'You can list all your Tasks in a single thread using a To-Do list. Use these lists to divide a project into several sectors, assign co-workers and check progress.', 'cpm' ), - 'when_use_todo' => __( 'When to use To-Do lists?', 'cpm' ), + 'backtotasklist' => __( 'Back to Task Lists', 'cpm' ), + 'todolist' => __( 'Task Lists', 'cpm' ), + 'todolist_n_title' => __( 'You can list all your Tasks in a single thread using a Task list. Use these lists to divide a project into several sectors, assign co-workers and check progress.', 'cpm' ), + 'when_use_todo' => __( 'When to use Task Lists?', 'cpm' ), 'to_pertition_a_project' => __( 'To partition a project internals.', 'cpm' ), 'to_mark_milestone' => __( 'To mark milestone points.', 'cpm' ), 'to_assign_people_task' => __( 'To assign people to tasks.', 'cpm' ), - 'add_new_todo_btn' => __( 'Add New To-do List', 'cpm' ), + 'add_new_todo_btn' => __( 'Add New Task List', 'cpm' ), '' => __( '', 'cpm' ), '' => __( '', 'cpm' ), ), @@ -217,7 +217,7 @@ function tasks_scripts() { function add_list( $project_id, $postdata, $list_id = 0 ) { if ( empty( $postdata[ 'tasklist_name' ] ) ) { - return new WP_Error( 'tasklist_name', __( 'Task list name required', 'cpm' ) ); + return new WP_Error( 'tasklist_name', __( 'Task list name is required.', 'cpm' ) ); } $is_update = ( $list_id ) ? true : false; @@ -277,7 +277,7 @@ function update_list( $project_id, $posted, $list_id ) { function add_task( $list_id, $postdata, $task_id = 0 ) { if ( empty( $postdata[ 'task_title' ] ) ) { - return new WP_Error( 'task_title', __( 'Task name required', 'cpm' ) ); + return new WP_Error( 'task_title', __( 'Task name is required.', 'cpm' ) ); } $files = isset( $postdata[ 'cpm_attachment' ] ) ? $postdata[ 'cpm_attachment' ] : array (); diff --git a/class/validator.php b/class/validator.php index 917e6a255..b533f1176 100644 --- a/class/validator.php +++ b/class/validator.php @@ -136,7 +136,7 @@ protected function date( $key, $value ) { * ]; * * $error_messages = [ - * 'tasklist_name.required' => __( 'Todo list name is required.', 'cpm' ), + * 'tasklist_name.required' => __( 'Task list name is required.', 'cpm' ), * 'tasklist_detail.required' => __( 'Todo list detail is required.', 'cpm' ), * 'tasklist_detail.email' => __( 'Todo list detail is email field.', 'cpm' ), * ]; diff --git a/includes/cpm-api/class-cpm-json-comments.php b/includes/cpm-api/class-cpm-json-comments.php index 305f198e1..482a8da16 100755 --- a/includes/cpm-api/class-cpm-json-comments.php +++ b/includes/cpm-api/class-cpm-json-comments.php @@ -101,14 +101,14 @@ function check_get_comment_permission( $project_id, $post_id ) { return true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you are not assigned in this project', 'cpm' ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You are not assigned to this project.', 'cpm' ) ); } else { $message = cpm()->message->get( $post_id ); if ( isset( $message->message_privacy ) && $task->task_privacy == 'yes' ) { if ( !cpm_user_can_access( $project_id, 'msg_view_private' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comments', 'cpm' ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comments.', 'cpm' ) ); } } } @@ -120,17 +120,17 @@ function check_get_comment_permission( $project_id, $post_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you are not assinged in this project', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( !cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comment.', 'cpm' ), array( 'status' => 404 ) ); } else { $task = cpm()->task->get_task( $post_id ); if ( isset( $task->task_privacy ) && $task->task_privacy == 'yes' ) { if ( !cpm_user_can_access( $project_id, 'todo_view_private' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comment.', 'cpm' ), array( 'status' => 404 ) ); } } @@ -142,13 +142,13 @@ function check_get_comment_permission( $project_id, $post_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { return true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you are not assinged in this project', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else { $task_list = cpm()->task->get_task_list( $post_id ); if ( isset( $milestone->_tasklist_privacy ) && $task->_tasklist_privacy == 'yes' ) { if ( !cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comment.', 'cpm' ), array( 'status' => 404 ) ); } } } @@ -211,7 +211,7 @@ function check_comment_edit_permission( $project_id, $post_id ) { $post_type = $post->post_type; if ( ! cpm_user_can_delete_edit( $project_id, $post ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to edit this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to edit this comment.', 'cpm' ), array( 'status' => 404 ) ); } return true; @@ -299,10 +299,10 @@ function check_create_comment_permission( $project_id, $post_id ) { return true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you are not assigned in this project', 'cpm' ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You are not assigned to this project.', 'cpm' ) ); } else if ( !cpm_user_can_access( $project_id, 'create_message' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comments', 'cpm' ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comments.', 'cpm' ) ); } break; @@ -312,13 +312,13 @@ function check_create_comment_permission( $project_id, $post_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you are not assinged in this project', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( !cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comment.', 'cpm' ), array( 'status' => 404 ) ); } else if ( !cpm_user_can_access( $project_id, 'create_todo' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comment.', 'cpm' ), array( 'status' => 404 ) ); } break; case 'cpm_task_list': @@ -327,10 +327,10 @@ function check_create_comment_permission( $project_id, $post_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { return true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you are not assinged in this project', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( !cpm_user_can_access( $project_id, 'create_todolist' ) ) { - return array( 'key' => 'permission', 'message' => __( 'Sorry! you do not have permission to view this comment', 'cpm' ), array( 'status' => 404 ) ); + return array( 'key' => 'permission', 'message' => __( 'Sorry! You do not have permission to view this comment.', 'cpm' ), array( 'status' => 404 ) ); } break; } diff --git a/includes/cpm-api/class-cpm-json-lists.php b/includes/cpm-api/class-cpm-json-lists.php index a22a8af79..cb6f9baf3 100644 --- a/includes/cpm-api/class-cpm-json-lists.php +++ b/includes/cpm-api/class-cpm-json-lists.php @@ -50,7 +50,7 @@ public function get_list( $project_id, $list_id ) { } if ( empty( $list_id ) ) { - return new WP_Error( 'json_post_invalid_id', __( 'Invalid todo list ID.' ), array( 'status' => 404 ) ); + return new WP_Error( 'json_post_invalid_id', __( 'Invalid task list ID.' ), array( 'status' => 404 ) ); } $manage_capability = cpm_can_manage_projects(); @@ -58,7 +58,7 @@ public function get_list( $project_id, $list_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { $condition = true; @@ -71,7 +71,7 @@ public function get_list( $project_id, $list_id ) { if ( isset( $posts_list->private ) && $posts_list->private == 'yes' ) { if ( !cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have persmission to view this todo list', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to view this task list.', 'cpm' ), array( 'status' => 404 ) ); } } } @@ -104,7 +104,7 @@ public function get_lists( $project_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { $condition = true; @@ -153,16 +153,16 @@ public function create_list( $project_id, $data ) { if ( ! $manage_capability && ! cpm_is_single_project_manager( $project_id ) ) { if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } if ( !cpm_user_can_access( $project_id, 'create_todolist' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to create todo list', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to create task list.', 'cpm' ), array( 'status' => 404 ) ); } } if ( empty( $data['tasklist_name'] ) ) { - return new WP_Error( 'task_list_name', __( 'Task List Name Required', 'cpm' ) ); + return new WP_Error( 'task_list_name', __( 'Task list name is required.', 'cpm' ) ); } $data['tasklist_milestone'] = isset( $data['tasklist_milestone'] ) ? $data['tasklist_milestone'] : '-1'; @@ -200,15 +200,15 @@ public function edit_list( $project_id, $list_id, $data ) { $project_id = (int) $project_id; if ( ! $project_id ) { - return new WP_Error( 'project_id', __( 'Invalid project id.', 'cpm' ) ); + return new WP_Error( 'project_id', __( 'Invalid project ID.', 'cpm' ) ); } if ( ! $list_id ) { - return new WP_Error( 'list_id', __( 'Invalid list id', 'cpm' ) ); + return new WP_Error( 'list_id', __( 'Invalid list ID.', 'cpm' ) ); } if ( empty( $data['tasklist_name'] ) ) { - return new WP_Error( 'task_list_name', __( 'Task List Name Required', 'cpm' ) ); + return new WP_Error( 'task_list_name', __( 'Task list name is required.', 'cpm' ) ); } $post = get_post( $list_id ); @@ -228,7 +228,7 @@ public function edit_list( $project_id, $list_id, $data ) { return $response; } else { - return new WP_Error( 'create_capability', __( 'Sorry! permission deny to edit todolist' ), array( 'status' => 404 ) ); + return new WP_Error( 'create_capability', __( 'Sorry! Permission denied to edit task list.' ), array( 'status' => 404 ) ); } } @@ -251,11 +251,11 @@ public function delete_list( $project_id, $list_id, $force = false ) { $project_id = (int) $project_id; if ( ! $project_id ) { - return new WP_Error( 'project_id', __( 'Invalid project id.', 'cpm' ) ); + return new WP_Error( 'project_id', __( 'Invalid project ID.', 'cpm' ) ); } if ( ! $list_id ) { - return new WP_Error( 'list_id', __( 'Invalid list id', 'cpm' ) ); + return new WP_Error( 'list_id', __( 'Invalid list ID.', 'cpm' ) ); } $project_id = intval( $project_id ); diff --git a/includes/cpm-api/class-cpm-json-messages.php b/includes/cpm-api/class-cpm-json-messages.php index d3d29ba37..347685e08 100644 --- a/includes/cpm-api/class-cpm-json-messages.php +++ b/includes/cpm-api/class-cpm-json-messages.php @@ -58,7 +58,7 @@ public function get_message( $project_id, $message_id ) { if ( $manage_capability && cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( cpm_user_can_access( $project_id, 'msg_view_private' ) ) { $condition = true; @@ -71,7 +71,7 @@ public function get_message( $project_id, $message_id ) { if ( isset( $message->private ) && $message->private == 'yes' ) { if ( ! cpm_user_can_access( $project_id, 'msg_view_private' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to view this message', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to view this message.', 'cpm' ), array( 'status' => 404 ) ); } } } @@ -105,7 +105,7 @@ public function get_messages( $project_id ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( cpm_user_can_access( $project_id, 'msg_view_private' ) ) { $condition = true; @@ -148,7 +148,7 @@ public function create_message( $project_id, $data ) { } if ( empty( $data['message_title'] ) ) { - return new WP_Error( 'message_title', __( 'Message Name Required', 'cpm' ) ); + return new WP_Error( 'message_title', __( 'Message name is required.', 'cpm' ) ); } $manage_capability = cpm_can_manage_projects(); @@ -156,11 +156,11 @@ public function create_message( $project_id, $data ) { if ( ! $manage_capability && ! cpm_is_single_project_manager( $project_id ) ) { if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } if ( !cpm_user_can_access( $project_id, 'create_message' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to create message', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to create message.', 'cpm' ), array( 'status' => 404 ) ); } } @@ -211,17 +211,17 @@ public function edit_message( $project_id, $message_id, $data ) { return new WP_Error( 'json_post_invalid_id', __( 'Invalid project ID.' ), array( 'status' => 404 ) ); } if ( ! $message_id ) { - return new WP_Error( 'message_id', __( 'Invalid message id', 'cpm' ) ); + return new WP_Error( 'message_id', __( 'Invalid message ID.', 'cpm' ) ); } if ( empty( $data['message_title'] ) ) { - return new WP_Error( 'message_title', __( 'Message Name Required', 'cpm' ) ); + return new WP_Error( 'message_title', __( 'Message name is required.', 'cpm' ) ); } $message = get_post( $message_id ); if ( ! cpm_user_can_delete_edit( $project_id, $message ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to edit this message', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to edit this message.', 'cpm' ), array( 'status' => 404 ) ); } $message_id = cpm()->message->update( $message_id, $data, $message_id ); @@ -256,11 +256,11 @@ public function delete_message( $project_id, $message_id, $force = false ) { } if ( ! $message_id ) { - return new WP_Error( 'message_id', __( 'Invalid message id', 'cpm' ) ); + return new WP_Error( 'message_id', __( 'Invalid message ID.', 'cpm' ) ); } if ( ! cpm_user_can_delete_edit( $project_id, $message ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to edit this message', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to edit this message.', 'cpm' ), array( 'status' => 404 ) ); } $force = $force ? true : false; diff --git a/includes/cpm-api/class-cpm-json-milestones.php b/includes/cpm-api/class-cpm-json-milestones.php index 5f035d437..18b32262e 100644 --- a/includes/cpm-api/class-cpm-json-milestones.php +++ b/includes/cpm-api/class-cpm-json-milestones.php @@ -60,7 +60,7 @@ public function get_milestone( $project_id, $milestone_id ) { if ( ! $manage_capability && ! cpm_is_single_project_manager( $project_id ) ) { $condition = true; } if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! permission deny', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! Permission denied.', 'cpm' ), array( 'status' => 404 ) ); } @@ -70,7 +70,7 @@ public function get_milestone( $project_id, $milestone_id ) { $milestone = cpm()->milestone->get( $milestone_id ); if ( isset( $milestone->private ) && $task->private == 'yes' ) { if ( !cpm_user_can_access( $project_id, 'msg_view_private' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to view this milestone', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to view this milestone.', 'cpm' ), array( 'status' => 404 ) ); } } } @@ -105,7 +105,7 @@ public function get_milestones( $project_id ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( cpm_user_can_access( $project_id, 'milestone_view_private' ) ) { $condition = true; @@ -148,7 +148,7 @@ public function create_milestone( $project_id, $data ) { } if ( isset( $data['milestone_name'] ) && empty( $data['milestone_name'] ) ) { - return new WP_Error( 'milestone_name', __( 'Milestone Name Required', 'cpm' ) ); + return new WP_Error( 'milestone_name', __( 'Milestone name is required.', 'cpm' ) ); } $manage_capability = cpm_can_manage_projects(); @@ -156,11 +156,11 @@ public function create_milestone( $project_id, $data ) { if ( !$manage_capability && !cpm_is_single_project_manager( $project_id ) ) { if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } if ( !cpm_user_can_access( $project_id, 'create_milestone' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to create milestone', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to create milestone.', 'cpm' ), array( 'status' => 404 ) ); } } @@ -209,25 +209,25 @@ public function edit_milestone( $project_id, $milestone_id, $data ) { $milestone_id = intval( $milestone_id ); if ( ! $project_id ) { - return new WP_Error( 'milestone_id', __( 'Invalid project id', 'cpm' ) ); + return new WP_Error( 'milestone_id', __( 'Invalid project ID.', 'cpm' ) ); } if ( ! $milestone_id ) { - return new WP_Error( 'milestone_id', __( 'Invalid milestoe id', 'cpm' ) ); + return new WP_Error( 'milestone_id', __( 'Invalid milestone ID.', 'cpm' ) ); } if ( ! isset( $data['milestone_name'] ) ) { - return new WP_Error( 'milestone_name', __( 'Milestone Name Required', 'cpm' ) ); + return new WP_Error( 'milestone_name', __( 'Milestone name is required.', 'cpm' ) ); } if ( empty( $data['milestone_name'] ) ) { - return new WP_Error( 'milestone_name', __( 'Milestone Name Required', 'cpm' ) ); + return new WP_Error( 'milestone_name', __( 'Milestone name is required.', 'cpm' ) ); } $milestone = get_post( $milestone_id ); if ( ! cpm_user_can_delete_edit( $project_id, $milestone ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to edit this milestone', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to edit this milestone.', 'cpm' ), array( 'status' => 404 ) ); } $milestone_id = cpm()->milestone->update( $project_id, $milestone_id ); @@ -258,17 +258,17 @@ public function delete_milestone( $project_id, $milestone_id, $force = false ) { $milestone_id = intval( $milestone_id ); if ( ! $project_id ) { - return new WP_Error( 'milestone_id', __( 'Invalid project id', 'cpm' ) ); + return new WP_Error( 'milestone_id', __( 'Invalid project ID.', 'cpm' ) ); } if ( ! $milestone_id ) { - return new WP_Error( 'milestone_id', __( 'Invalid milestoe id', 'cpm' ) ); + return new WP_Error( 'milestone_id', __( 'Invalid milestone ID.', 'cpm' ) ); } $milestone = get_post( $milestone_id ); if ( ! cpm_user_can_delete_edit( $project_id, $milestone ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to delete this milestone', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to delete this milestone.', 'cpm' ), array( 'status' => 404 ) ); } $force = $force ? true : false; diff --git a/includes/cpm-api/class-cpm-json-projects.php b/includes/cpm-api/class-cpm-json-projects.php index 2c6457b97..2e202c325 100644 --- a/includes/cpm-api/class-cpm-json-projects.php +++ b/includes/cpm-api/class-cpm-json-projects.php @@ -61,7 +61,7 @@ public function get_project( $project_id ) { $manage_capability = cpm_can_manage_projects(); if( ! $manage_capability && ! cpm_project_user_role_pre_chache( $id ) ) { - return new WP_Error( 'assigned_user', __( 'Sorry! You are not assigned in this project' ), array( 'status' => 404 ) ); + return new WP_Error( 'assigned_user', __( 'Sorry! You are not assigned to this project.' ), array( 'status' => 404 ) ); } $post = get_post( $id, ARRAY_A ); @@ -100,11 +100,11 @@ public function create_project( $data ) { } if ( !isset( $data['project_name'] ) ) { - return new WP_Error( 'project_name', __( 'Project Name Required', 'cpm' ) ); + return new WP_Error( 'project_name', __( 'Project name is required.', 'cpm' ) ); } if ( empty( $data['project_name'] ) ) { - return new WP_Error( 'project_name', __( 'Project Name Required', 'cpm' ) ); + return new WP_Error( 'project_name', __( 'Project name is required.', 'cpm' ) ); } $data['project_notify'] = false; @@ -148,7 +148,7 @@ public function edit_project( $project_id, $data ) { $manage_capability = cpm_can_manage_projects(); if ( ! $manage_capability && ! cpm_project_user_role_pre_chache( $id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } if ( ! cpm_user_can_access( $id ) ) { @@ -156,7 +156,7 @@ public function edit_project( $project_id, $data ) { } if ( empty( $data['project_name'] ) ) { - return new WP_Error( 'project_name', __( 'Project Name Required', 'cpm' ) ); + return new WP_Error( 'project_name', __( 'Project name is required.', 'cpm' ) ); } $data['project_notify'] = false; @@ -196,7 +196,7 @@ public function delete_project( $project_id, $force = false ) { $manage_capability = cpm_can_manage_projects(); if ( ! $manage_capability && ! cpm_project_user_role_pre_chache( $id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } if ( ! cpm_user_can_access( $id ) ) { diff --git a/includes/cpm-api/class-cpm-json-tasks.php b/includes/cpm-api/class-cpm-json-tasks.php index 26ef938b7..5d6e9af1c 100644 --- a/includes/cpm-api/class-cpm-json-tasks.php +++ b/includes/cpm-api/class-cpm-json-tasks.php @@ -52,7 +52,7 @@ public function get_task( $project_id, $list_id, $task_id ) { } if ( empty( $list_id ) ) { - return new WP_Error( 'json_post_invalid_id', __( 'Invalid todo list ID.' ), array( 'status' => 404 ) ); + return new WP_Error( 'json_post_invalid_id', __( 'Invalid task list ID.' ), array( 'status' => 404 ) ); } $posts_list = cpm()->task->get_task_list( $list_id ); $manage_capability = cpm_can_manage_projects(); @@ -60,10 +60,10 @@ public function get_task( $project_id, $list_id, $task_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( $posts_list->private == 'yes' && !cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to view this todo list', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to view this task list.', 'cpm' ), array( 'status' => 404 ) ); } @@ -74,7 +74,7 @@ public function get_task( $project_id, $list_id, $task_id ) { if ( isset( $task->task_privacy ) && $task->task_privacy == 'yes' ) { if ( ! cpm_user_can_access( $project_id, 'todo_view_private' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to view this task', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to view this task.', 'cpm' ), array( 'status' => 404 ) ); } } } @@ -106,7 +106,7 @@ public function get_tasks( $project_id, $list_id ) { } if ( empty( $list_id ) ) { - return new WP_Error( 'json_post_invalid_id', __( 'Invalid todo list ID.' ), array( 'status' => 404 ) ); + return new WP_Error( 'json_post_invalid_id', __( 'Invalid task list ID.' ), array( 'status' => 404 ) ); } $posts_list = cpm()->task->get_task_list( $list_id ); @@ -115,10 +115,10 @@ public function get_tasks( $project_id, $list_id ) { if ( $manage_capability || cpm_is_single_project_manager( $project_id ) ) { $condition = true; } else if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } else if ( $posts_list->private == 'yes' && !cpm_user_can_access( $project_id, 'tdolist_view_private' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to view this todo list', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to view this task list.', 'cpm' ), array( 'status' => 404 ) ); } else if ( cpm_user_can_access( $project_id, 'todo_view_private' ) ) { $condition = true; @@ -164,11 +164,11 @@ public function create_task( $project_id, $list_id, $data ) { } if ( ! $list_id ) { - return new WP_Error( 'json_post_invalid_id', __( 'Invalid todo list ID.' ), array( 'status' => 404 ) ); + return new WP_Error( 'json_post_invalid_id', __( 'Invalid task list ID.' ), array( 'status' => 404 ) ); } if ( empty( $data['task_text'] ) ) { - return new WP_Error( 'task_text', __( 'Task Name Required', 'cpm' ) ); + return new WP_Error( 'task_text', __( 'Task name is required.', 'cpm' ) ); } $posts_list = cpm()->task->get_task_list( $list_id ); $manage_capability = cpm_can_manage_projects(); @@ -176,15 +176,15 @@ public function create_task( $project_id, $list_id, $data ) { if ( !$manage_capability && !cpm_is_single_project_manager( $project_id ) ) { if ( ! cpm_project_user_role_pre_chache( $project_id ) ) { - return new WP_Error( 'permission', __( 'Sorry! you are not assigned in this project', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You are not assigned to this project.', 'cpm' ), array( 'status' => 404 ) ); } if ( ! cpm_user_can_access( $project_id, 'create_todolist' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to create todo list', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to create task list.', 'cpm' ), array( 'status' => 404 ) ); } if ( !cpm_user_can_access( $project_id, 'create_todo' ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to create todo', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to create task.', 'cpm' ), array( 'status' => 404 ) ); } } @@ -242,21 +242,21 @@ public function edit_task( $project_id, $list_id, $task_id, $data ) { } if ( ! $list_id ) { - return new WP_Error( 'list_id', __( 'Invalid list id', 'cpm' ) ); + return new WP_Error( 'list_id', __( 'Invalid list ID.', 'cpm' ) ); } if ( ! $task_id ) { - return new WP_Error( 'task_id', __( 'Invalid task id', 'cpm' ) ); + return new WP_Error( 'task_id', __( 'Invalid task ID.', 'cpm' ) ); } if ( empty( $data['task_text'] ) ) { - return new WP_Error( 'task_text', __( 'Task Name Required', 'cpm' ) ); + return new WP_Error( 'task_text', __( 'Task name is required.', 'cpm' ) ); } $task = get_post( $task_id ); if ( ! cpm_user_can_delete_edit( $project_id, $task ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to edit this task', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to edit this task.', 'cpm' ), array( 'status' => 404 ) ); } add_filter( 'cpm_new_task_notification', array( $this, 'change_notification_status' ) ); @@ -293,13 +293,13 @@ public function delete_task( $project_id, $list_id, $task_id, $force = false ) { } if ( ! $task_id ) { - return new WP_Error( 'task_id', __( 'Invalid task id', 'cpm' ) ); + return new WP_Error( 'task_id', __( 'Invalid task ID.', 'cpm' ) ); } $task = get_post( $task_id ); if ( !cpm_user_can_delete_edit( $project_id, $task ) ) { - return new WP_Error( 'permission', __( 'Sorry! you do not have permission to edit this task', 'cpm' ), array( 'status' => 404 ) ); + return new WP_Error( 'permission', __( 'Sorry! You do not have permission to edit this task.', 'cpm' ), array( 'status' => 404 ) ); } $force = $force ? true : false; diff --git a/includes/functions.php b/includes/functions.php index 1f764ea31..2985de233 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -116,7 +116,7 @@ function cpm_tasks_filter_pending( $task ) { */ function cpm_dropdown_users( $selected = array() ) { - $placeholder = __( 'Select co-workers', 'cpm' ); + $placeholder = __( 'Select Co-Workers', 'cpm' ); $sel = ' selected="selected"'; $users = get_users(); @@ -487,13 +487,13 @@ function cpm_project_summary_info( $info, $project_id ) { ); $summary['todo'] = array( - 'label' => _n( 'To-do list', 'To-do lists', $info->todolist, 'cpm' ), + 'label' => _n( 'Task List', 'Task Lists', $info->todolist, 'cpm' ), 'count' => $info->todolist, 'url' => cpm_url_tasklist_index( $project_id ) ); $summary['todos'] = array( - 'label' => _n( 'To-do', 'To-dos', $info->todos, 'cpm' ), + 'label' => _n( 'Task', 'Tasks', $info->todos, 'cpm' ), 'count' => $info->todos, 'url' => cpm_url_tasklist_index( $project_id ) ); @@ -1149,8 +1149,8 @@ function cpm_pagination( $total, $limit, $pagenum ) { $page_links = paginate_links( array( 'base' => add_query_arg( 'pagenum', '%#%' ), 'format' => '', - 'prev_text' => __( '«', 'aag' ), - 'next_text' => __( '»', 'aag' ), + 'prev_text' => __( '«', 'cpm' ), + 'next_text' => __( '»', 'cpm' ), 'add_args' => false, 'total' => $num_of_pages, 'current' => $pagenum, @@ -1306,10 +1306,10 @@ function cpm_message() { $message = array( 'report_frm_field_limit' => __( 'You can not use this field more than once!', 'cpm' ), 'report_total_frm_field_limit' => __( 'You can not create more than 4 action', 'cpm' ), - 'new_todo' => __( 'New Todo List', 'cpm' ), - 'update_todo' => __( 'Update Todo List', 'cpm' ), + 'new_todo' => __( 'New Task List', 'cpm' ), + 'update_todo' => __( 'Update Task List', 'cpm' ), 'comment_placeholder' => __( 'Write a comment...', 'cpm' ), - 'confirm' => __( 'Are you sure!', 'cpm' ), + 'confirm' => __( 'Are you sure?', 'cpm' ), ); return apply_filters( 'cpm_message', $message ); diff --git a/includes/html.php b/includes/html.php index 09aca583f..92f0c5ebc 100644 --- a/includes/html.php +++ b/includes/html.php @@ -128,7 +128,7 @@ function cpm_task_html( $task, $project_id, $list_id, $single = false ) {
- $single, 'list_id' => $list_id, 'project_id' => $project_id, 'task_id' => $task->ID, 'confirm' => __( 'Are you sure to delete this to-do?', 'cpm' ) ) ); ?>> + $single, 'list_id' => $list_id, 'project_id' => $project_id, 'task_id' => $task->ID, 'confirm' => __( 'Are you sure to delete this task?', 'cpm' ) ) ); ?>> completed != '1' ) { ?> @@ -172,7 +172,7 @@ function cpm_task_new_form( $list_id, $project_id, $task = null, $single = false $action = 'cpm_task_add'; $task_title = $task_content = $task_due = $task_start = ''; $assigned_to = '-1'; - $submit_button = __( 'Add this to-do', 'cpm' ); + $submit_button = __( 'Add this task', 'cpm' ); //for update form if ( ! is_null( $task ) ) { @@ -204,24 +204,24 @@ function cpm_task_new_form( $list_id, $project_id, $task = null, $single = false
- +
- +
- - + +
- - + +
@@ -277,11 +277,11 @@ function cpm_tasklist_form( $project_id, $list = null ) {
- +
- +
@@ -330,8 +330,8 @@ function cpm_task_list_html( $list, $project_id, $singlePage = false ) {
- - + +
comment_content; - $submit_button = __( 'Update comment', 'cpm' ); + $submit_button = __( 'Update Comment', 'cpm' ); } ob_start(); @@ -841,7 +841,7 @@ function cpm_milestone_form( $project_id, $milestone = null ) {
- +
@@ -908,7 +908,7 @@ function cpm_show_milestone( $milestone, $project_id ) {