<tomcatRunPath>/archiva</tomcatRunPath>
<archiva.devMode>true</archiva.devMode>
<archiva.javascriptLog>true</archiva.javascriptLog>
+ <archiva.logMissingI18n>true</archiva.logMissingI18n>
</properties>
<dependencies>
<archiva.user.configFileName>${project.build.directory}/appserver-base/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
<archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
+ <archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n>
</systemProperties>
</configuration>
<dependencies>
<archiva.user.configFileName>${project.build.directory}/appserver-base/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
<archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
+ <archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n>
</systemProperties>
</configuration>
<dependencies>
<archiva.user.configFileName>${project.build.directory}/appserver-base/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
<archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
+ <archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n>
</systemProperties>
</configuration>
<dependencies>
import org.apache.archiva.web.runtime.ArchivaRuntimeInfo;
import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
implements RuntimeInfoService
{
+ private Logger i18nLogger = LoggerFactory.getLogger( "archivaMissingi18n.logger" );
+
private ArchivaRuntimeInfo archivaRuntimeInfo;
@Inject
applicationRuntimeInfo.setVersion( this.archivaRuntimeInfo.getVersion() );
return applicationRuntimeInfo;
}
+
+ public Boolean logMissingI18n( String key )
+ {
+ i18nLogger.info( "missing i18n key : '{}'", key );
+ return Boolean.TRUE;
+ }
}
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
/**
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
@RedbackAuthorization( noRestriction = true )
ApplicationRuntimeInfo getApplicationRuntimeInfo();
+
+
+ @Path( "logMissingI18n" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+ @RedbackAuthorization( noRestriction = true )
+ Boolean logMissingI18n( @QueryParam( "key" ) String key );
}
private String copyrightRange;
+ private boolean logMissingI18n;
+
public ApplicationRuntimeInfo()
{
this.javascriptLog = Boolean.getBoolean( "archiva.javascriptLog" );
+ this.logMissingI18n = Boolean.getBoolean( "archiva.logMissingI18n" );
+
this.copyrightRange = "2005 - " + Calendar.getInstance().get( Calendar.YEAR );
}
this.copyrightRange = copyrightRange;
}
+ public boolean isLogMissingI18n()
+ {
+ return logMissingI18n;
+ }
+
+ public void setLogMissingI18n( boolean logMissingI18n )
+ {
+ this.logMissingI18n = logMissingI18n;
+ }
+
@Override
public String toString()
{
sb.append( ", buildNumber='" ).append( buildNumber ).append( '\'' );
sb.append( ", timestamp=" ).append( timestamp );
sb.append( ", copyrightRange='" ).append( copyrightRange ).append( '\'' );
+ sb.append( ", logMissingI18n=" ).append( logMissingI18n );
sb.append( '}' );
return sb.toString();
}
language: '',
path: '',
mode: 'vars',
- cache: false,
+ cache: false,
encoding: 'UTF-8',
callback: null
};
*/
$.i18n.prop = function(key /* Add parameters as function arguments as necessary */) {
var value = $.i18n.map[key];
- if (value == null)
+ if (value == null) {
+ if (window.archivaRuntimeInfo.logMissingI18n){
+ $.get('restServices/archivaUiServices/runtimeInfoService/logMissingI18n?key='+encodeURIComponent(key));
+ }
return '[' + key + ']';
+ }
// if(arguments.length < 2) // No arguments.
// //if(key == 'spv.lbl.modified') {alert(value);}