private void updateTranslationProgressMap ( String appid , String langCode , int value ) { if ( dao == null || getDefaultLanguageCode ( ) . equals ( langCode ) ) { return ; } double defsize = getDefaultLanguage ( appid ) . size ( ) ; double approved = value ; Map < String , Integer > progress = getTranslationProgressMap ( appid ) ; Integer percent = progress . get ( langCode ) ; if ( value == PLUS ) { approved = Math . round ( percent * ( defsize / 100 ) + 1 ) ; } else if ( value == MINUS ) { approved = Math . round ( percent * ( defsize / 100 ) - 1 ) ; } int allowedUntranslated = defsize > 10 ? 5 : 0 ; // allow 3 identical words per language (i.e. Email, etc) if ( approved >= defsize - allowedUntranslated ) { approved = defsize ; } if ( ( ( int ) defsize ) == 0 ) { progress . put ( langCode , 0 ) ; } else { progress . put ( langCode , ( int ) ( ( approved / defsize ) * 100 ) ) ; } Sysprop updatedProgress = new Sysprop ( progressKey ) ; for ( Map . Entry < String , Integer > entry : progress . entrySet ( ) ) { updatedProgress . addProperty ( entry . getKey ( ) , entry . getValue ( ) ) ; } langProgressCache = updatedProgress ; if ( percent < 100 && ! percent . equals ( progress . get ( langCode ) ) ) { dao . create ( appid , updatedProgress ) ; } }
Updates the progress for all languages .