diff --git a/lib/Features/Microsoft.php b/lib/Features/Microsoft.php index 69c9fed..31da467 100644 --- a/lib/Features/Microsoft.php +++ b/lib/Features/Microsoft.php @@ -148,4 +148,22 @@ public function overrideReviseJobQA( $jobQA, $id_job, $password_job, $job_words ]; } + /** + * Because of a bug in filters we force languages conversion to it-IT when isCJK + * @param array $array + * + * @return array + */ + public function overrideConversionRequest( $language ){ + if( \CatUtils::isCJK( $language ) ){ + $language = 'it-IT'; + } + return $language; + } + + public function overrideConversionResult( $documentContent, $language ){ + return preg_replace( '/target-language=".*?"/', "target-language=\"{$language}\"", $documentContent ); + } + + } \ No newline at end of file diff --git a/lib/Features/Microsoft/Controller/TranslatedConnectorController.php b/lib/Features/Microsoft/Controller/TranslatedConnectorController.php index ef83fb1..875e5a4 100644 --- a/lib/Features/Microsoft/Controller/TranslatedConnectorController.php +++ b/lib/Features/Microsoft/Controller/TranslatedConnectorController.php @@ -11,9 +11,9 @@ use API\V2\KleinController; use API\V2\Validators\JobPasswordValidator; use API\V2\Json\ProjectUrls; +use DataAccess\ShapelessConcreteStruct; use Features\Microsoft\Utils\Email\ConfirmedQuotationEmail; use Features\Microsoft\Utils\Email\ErrorQuotationEmail; -use Features\Microsoft\View\API\JSON\MicrosoftUrlsDecorator; use Features\Microsoft; use \Features\Outsource\Traits\Translated as TranslatedTrait; @@ -21,11 +21,17 @@ class TranslatedConnectorController extends KleinController { use TranslatedTrait; + protected $job; + protected $project; + protected function afterConstruct() { $jobValidator = ( new JobPasswordValidator( $this ) ); $jobValidator->onSuccess( function () use ( $jobValidator ) { - $this->job = $jobValidator->getJob(); + $job = new \Jobs_JobStruct(); + $job->id = $jobValidator->getJob()->id; + $job->password = $jobValidator->getJob()->password; + $this->job = ( new \Jobs_JobDao() )->read( $job )[ 0 ]; $this->project = $this->job->getProject(); } ); @@ -45,15 +51,15 @@ public function sendJob() { $this->config = Microsoft::getConfig(); - $eq_word = \Jobs_JobDao::getTODOWords($this->job); + $eq_word = \Jobs_JobDao::getTODOWords( $this->job ); $this->setSuccessMailSender( new ConfirmedQuotationEmail( Microsoft::getPluginBasePath() . '/Features/Microsoft/View/Emails/confirmed_quotation.html' ) ); $this->setFailureMailSender( new ErrorQuotationEmail( Microsoft::getPluginBasePath() . '/Features/Microsoft/View/Emails/error_quotation.html' ) ); - $response = $this->requestJobQuote($this->job, $eq_word, $this->project, $formatted); - if(!empty($response)){ - $this->response->body( "ok - ".$this->getExternalProjectId() ); - }else{ - $this->response->body( "ko" ); + $response = $this->requestJobQuote( $this->job, $eq_word, $this->project, $formatted ); + if ( !empty( $response ) ) { + $this->response->body( "ok - " . $this->getExternalProjectId() ); + } else { + $this->response->body( "ko" ); } } diff --git a/lib/Features/Microsoft/Decorator/AnalyzeDecorator.php b/lib/Features/Microsoft/Decorator/AnalyzeDecorator.php new file mode 100644 index 0000000..35f1a70 --- /dev/null +++ b/lib/Features/Microsoft/Decorator/AnalyzeDecorator.php @@ -0,0 +1,19 @@ +template->enable_outsource = false; + } + + +} \ No newline at end of file diff --git a/lib/Features/Microsoft/Decorator/ManageDecorator.php b/lib/Features/Microsoft/Decorator/ManageDecorator.php index 8e09135..62af192 100644 --- a/lib/Features/Microsoft/Decorator/ManageDecorator.php +++ b/lib/Features/Microsoft/Decorator/ManageDecorator.php @@ -13,6 +13,8 @@ class ManageDecorator extends AbstractDecorator { public function decorate() { $this->template->append( 'css_resources', Routes::staticBuild( '/microsoft-build.css' ) ); + + $this->template->enable_outsource = false; } diff --git a/lib/Features/Microsoft/Utils/Constants/Revise.php b/lib/Features/Microsoft/Utils/Constants/Revise.php index 74e80bd..9272af0 100644 --- a/lib/Features/Microsoft/Utils/Constants/Revise.php +++ b/lib/Features/Microsoft/Utils/Constants/Revise.php @@ -14,11 +14,10 @@ class Revise extends \Constants_Revise{ * Max allowed errors for category */ const WORD_INTERVAL = 1000; - const MAX_TYPING = 1; - const MAX_TRANSLATION = 1; + const MAX_TYPING = 2; + const MAX_TRANSLATION = 2; const MAX_TERMINOLOGY = 1; - const MAX_QUALITY = 1; - const MAX_STYLE = 5; - + const MAX_QUALITY = 3; + const MAX_STYLE = 7; } \ No newline at end of file diff --git a/static/src/css/sass/microsoft-core.scss b/static/src/css/sass/microsoft-core.scss index 5e8af56..33dec9c 100644 --- a/static/src/css/sass/microsoft-core.scss +++ b/static/src/css/sass/microsoft-core.scss @@ -26,6 +26,14 @@ body.review { display: none; } } + +body:not(.review) { + footer { + .wrapper nav ul li:nth-child(2) { + display: none; + } + } +} body .tab-switcher-notes { display: none; } diff --git a/static/src/js/cat_source/microsoft-core.extension.js b/static/src/js/cat_source/microsoft-core.extension.js index b8d86f2..7103965 100644 --- a/static/src/js/cat_source/microsoft-core.extension.js +++ b/static/src/js/cat_source/microsoft-core.extension.js @@ -1,9 +1,9 @@ - (function(SF, QA_GLOSSARY) { let original_closeFilter = SF.closeFilter; let filte_size = '50'; let filter_type = 'regular_intervals'; + $.extend(UI, { showFixWarningsModal: function ( ) { APP.confirm({ @@ -14,6 +14,16 @@ cancelTxt: 'Mark as complete', msg: 'Unresolved glossary and/or tag issues are preventing you from completing your translation.
Please fix the issues.' }); + }, + showFixWarningsOnDownload( continueDownloadFunction ) { + APP.confirm({ + name: 'confirmDownload', // <-- this is the name of the function that gets invoked? + cancelTxt: 'Fix errors', + onCancel: 'goToFirstError', + callback: continueDownloadFunction, + okTxt: 'Download anyway', + msg: 'Unresolved glossary and/or tag issues may prevent downloading your translation. Please fix the issues.

If you continue downloading, part of the content may be untranslated - look for the string UNTRANSLATED_CONTENT in the downloaded files.' + }); } });