mirror of
https://github.com/mirego/accent.git
synced 2024-09-11 18:58:14 +03:00
Fix reviewers abilities and translated default to true for main language
This commit is contained in:
parent
4cd6476e5f
commit
5bbe9ba0ac
@ -52,6 +52,13 @@ defmodule Accent.RoleAbilities do
|
||||
hook_update
|
||||
)a ++ @read_actions
|
||||
|
||||
@reviewer_actions ~w(
|
||||
correct_all_revision
|
||||
uncorrect_all_revision
|
||||
correct_translation
|
||||
uncorrect_translation
|
||||
)a ++ @any_actions
|
||||
|
||||
@developer_actions ~w(
|
||||
peek_sync
|
||||
peek_merge
|
||||
@ -72,7 +79,7 @@ defmodule Accent.RoleAbilities do
|
||||
delete_project_machine_translations_config
|
||||
save_project_prompt_config
|
||||
delete_project_prompt_config
|
||||
)a ++ @any_actions
|
||||
)a ++ @reviewer_actions
|
||||
|
||||
@admin_actions ~w(
|
||||
create_slave
|
||||
@ -88,13 +95,6 @@ defmodule Accent.RoleAbilities do
|
||||
delete_project
|
||||
)a ++ @developer_actions
|
||||
|
||||
@reviewer_actions ~w(
|
||||
correct_all_revision
|
||||
uncorrect_all_revision
|
||||
correct_translation
|
||||
uncorrect_translation
|
||||
)a ++ @any_actions
|
||||
|
||||
@actions_with_target ~w(machine_translations_translate use_prompt_improve_text)a
|
||||
|
||||
def actions_for(role, target)
|
||||
|
@ -7,6 +7,7 @@ defmodule Accent.PreviousTranslation do
|
||||
corrected_text
|
||||
conflicted_text
|
||||
conflicted
|
||||
translated
|
||||
removed
|
||||
value_type
|
||||
placeholders
|
||||
@ -30,7 +31,7 @@ defmodule Accent.PreviousTranslation do
|
||||
iex> Accent.PreviousTranslation.from_translation(nil)
|
||||
%Accent.PreviousTranslation{}
|
||||
iex> Accent.PreviousTranslation.from_translation(%Accent.Translation{translated: true, proposed_text: "a", corrected_text: "b", conflicted_text: "c", conflicted: true, removed: false, value_type: "string", placeholders: ["foo"]})
|
||||
%Accent.PreviousTranslation{translated: false, proposed_text: "a", corrected_text: "b", conflicted_text: "c", conflicted: true, removed: false, value_type: "string", placeholders: ["foo"]}
|
||||
%Accent.PreviousTranslation{translated: true, proposed_text: "a", corrected_text: "b", conflicted_text: "c", conflicted: true, removed: false, value_type: "string", placeholders: ["foo"]}
|
||||
"""
|
||||
def from_translation(nil), do: from_translation(%{})
|
||||
|
||||
|
@ -37,6 +37,7 @@ defmodule Movement.Builders.NewSlave do
|
||||
plural: translation.plural,
|
||||
locked: translation.locked,
|
||||
placeholders: translation.placeholders,
|
||||
translation_id: translation.id,
|
||||
options: assigns.new_slave_options,
|
||||
machine_translations_enabled: machine_translations_enabled
|
||||
})
|
||||
|
@ -57,7 +57,7 @@ defmodule Movement.Migration.Translation do
|
||||
file_index: operation.file_index,
|
||||
file_comment: operation.file_comment,
|
||||
removed: operation.previous_translation && operation.previous_translation.removed,
|
||||
translated: (operation.previous_translation && operation.previous_translation.translated) || false,
|
||||
translated: is_nil(operation.translation_id),
|
||||
revision_id: operation.revision_id,
|
||||
document_id: operation.document_id,
|
||||
version_id: operation.version_id,
|
||||
|
Loading…
Reference in New Issue
Block a user