import { CrowdinApi , ResponseList } from '../core' ; export class TranslationStatus extends CrowdinApi { param projectId param branchId param limit param offset getBranchProgress ( projectId , branchId , limit ? , offset ? ) { const url = `${ this . url }/projects/${ projectId }/branches/${ branchId }/languages/progress` ; return this . getList ( url , limit , offset ) ; } param projectId param directoryId param limit param offset getDirectoryProgress ( projectId , directoryId , limit ? , offset ? ) { const url = `${ this . url }/projects/${ projectId }/directories/${ directoryId }/languages/progress` ; return this . getList ( url , limit , offset ) ; } param projectId param languageId param limit param offset getLanguageProgress ( projectId , languageId , limit ? , offset ? ) { const url = `${ this . url }/projects/${ projectId }/languages/${ languageId }/progress` ; return this . getList ( url , limit , offset ) ; } param projectId param limit param offset param languageIds getProjectProgress ( projectId , limit ? , offset ? , languageIds ? ) { let url = `${ this . url }/projects/${ projectId }/languages/progress` ; url = this . addQueryParam ( url , 'languageIds' , languageIds ) ; return this . getList ( url , limit , offset ) ; } param projectId param fileId param limit param offset getFileProgress ( projectId , fileId , limit ? , offset ? ) { const url = `${ this . url }/projects/${ projectId }/files/${ fileId }/languages/progress` ; return this . getList ( url , limit , offset ) ; } param projectId param limit param offset param category param validation param languageIds listQaCheckIssues ( projectId , limit ? , offset ? , category ? , validation ? , languageIds ? ) ; listQaCheckIssues ( projectId , limitOrRequest ? , offset ? , category ? , validation ? , languageIds ? ) { let url = `${ this . url }/projects/${ projectId }/qa-checks` ; let request ; if ( limitOrRequest && typeof limitOrRequest === 'object' ) { request = limitOrRequest ; } else { request = { limit : limitOrRequest , offset , category , validation , languageIds } ; } url = this . addQueryParam ( url , 'category' , request . category ) ; url = this . addQueryParam ( url , 'validation' , request . validation ) ; url = this . addQueryParam ( url , 'languageIds' , request . languageIds ) ; return this . getList ( url , request . limit , request . offset ) ; } } export namespace TranslationStatusModel { export interface LanguageProgress { languageId : string ; words : Words ; phrases : Words ; translationProgress : number ; approvalProgress : number ; eTag : string ; } export interface FileProgress { fileId : number ; words : Words ; phrases : Words ; translationProgress : number ; approvalProgress : number ; eTag : string ; } export interface Words { total : number ; translated : number ; approved : number ; } export enum Category { EMPTY = 'empty' , VARIABLES = 'variables' , TAGS = 'tags' , PUNCTUATION = 'punctuation' , SYMBOL_REGISTER = 'symbol_register' , SPACES = 'spaces' , SIZE = 'size' , SPECIAL_SYMBOLS = 'special_symbols' , WRONG_TRANSLATION = 'wrong_translation' , SPELLCHECK = 'spellcheck' , ICU = 'icu' } export enum Validation { EMPTY_STRING_CHECK = 'empty_string_check' , EMPTY_SUGGESTION_CHECK = 'empty_suggestion_check' , MAX_LENGTH_CHECK = 'max_length_check' , TAGS_CHECK = 'tags_check' , MISMATCH_IDS_CHECK = 'mismatch_ids_check' , CDATA_CHECK = 'cdata_check' , SPECIALS_SYMBOLS_CHECK = 'specials_symbols_check' , LEADING_NEWLINES_CHECK = 'leading_newlines_check' , TRAILING_NEWLINES_CHECK = 'trailing_newlines_check' , LEADING_SPACES_CHECK = 'leading_spaces_check' , TRAILING_SPACES_CHECK = 'trailing_spaces_check' , MULTIPLE_SPACES_CHECK = 'multiple_spaces_check' , CUSTOM_BLOCKED_VARIABLES_CHECK = 'custom_blocked_variables_check' , HIGHEST_PRIORITY_CUSTOM_VARIABLES_CHECK = 'highest_priority_custom_variables_check' , HIGHEST_PRIORITY_VARIABLES_CHECK = 'highest_priority_variables_check' , C_VARIABLES_CHECK = 'c_variables_check' , PYTHON_VARIABLES_CHECK = 'python_variables_check' , RAILS_VARIABLES_CHECK = 'rails_variables_check' , JAVA_VARIABLES_CHECK = 'java_variables_check' , DOT_NET_VARIABLES_CHECK = 'dot_net_variables_check' , TWIG_VARIABLES_CHECK = 'twig_variables_check' , PHP_VARIABLES_CHECK = 'php_variables_check' , FREEMARKER_VARIABLES_CHECK = 'freemarker_variables_check' , LOWEST_PRIORITY_VARIABLE_CHECK = 'lowest_priority_variable_check' , LOWEST_PRIORITY_CUSTOM_VARIABLES_CHECK = 'lowest_priority_custom_variables_check' , PUNCTUATION_CHECK = 'punctuation_check' , SPACES_BEFORE_PUNCTUATION_CHECK = 'spaces_before_punctuation_check' , SPACES_AFTER_PUNCTUATION_CHECK = 'spaces_after_punctuation_check' , NON_BREAKING_SPACES_CHECK = 'non_breaking_spaces_check' , CAPITALIZE_CHECK = 'capitalize_check' , MULTIPLE_UPPERCASE_CHECK = 'multiple_uppercase_check' , PARENTHESES_CHECK = 'parentheses_check' , ENTITIES_CHECK = 'entities_check' , ESCAPED_QUOTES_CHECK = 'escaped_quotes_check' , WRONG_TRANSLATION_ISSUE_CHECK = 'wrong_translation_issue_check' , SPELLCHECK = 'spellcheck' , ICU_CHECK = 'icu_check' } export interface ListQaCheckIssuesRequest { limit ? : number ; offset ? : number ; category ? : Category ; validation ? : Validation ; languageIds ? : string ; } export interface QaCheck { stringId : number ; languageId : string ; category : Category ; categoryDescription : string ; validation : Validation ; validationDescription : string ; pluralId : number ; text : string ; } }