Browse Source

More i18n.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269639 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
a3bafc4dc6
2 changed files with 22 additions and 10 deletions
  1. +16
    -8
      proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java
  2. +6
    -2
      proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties

+ 16
- 8
proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java View File

@@ -8,12 +8,14 @@
package org.apache.myrmidon.components.deployer; package org.apache.myrmidon.components.deployer;


import java.io.File; import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.avalon.excalibur.i18n.ResourceManager;
import org.apache.avalon.excalibur.i18n.Resources;
import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.SAXConfigurationHandler; import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
@@ -27,6 +29,9 @@ import org.xml.sax.XMLReader;
*/ */
public class Deployment public class Deployment
{ {
private static final Resources REZ =
ResourceManager.getPackageResources( Deployment.class );

public final static String DESCRIPTOR_NAME = "META-INF/ant-descriptor.xml"; public final static String DESCRIPTOR_NAME = "META-INF/ant-descriptor.xml";


private File m_file; private File m_file;
@@ -55,7 +60,8 @@ public class Deployment
try { return m_file.getCanonicalFile().toURL(); } try { return m_file.getCanonicalFile().toURL(); }
catch( final IOException ioe ) catch( final IOException ioe )
{ {
throw new DeploymentException( "Unable to form url", ioe );
final String message = REZ.getString( "bad-url.error", m_file );
throw new DeploymentException( message, ioe );
} }
} }


@@ -80,16 +86,18 @@ public class Deployment
} }
catch( final SAXException se ) catch( final SAXException se )
{ {
throw new DeploymentException( "Malformed configuration data", se );
final String message = REZ.getString( "bad-descriptor.error" );
throw new DeploymentException( message, se );
} }
catch( final ParserConfigurationException pce ) catch( final ParserConfigurationException pce )
{ {
throw new DeploymentException( "Error configuring parser", pce );
final String message = REZ.getString( "bad-parser.error" );
throw new DeploymentException( message, pce );
} }
catch( final IOException ioe ) catch( final IOException ioe )
{ {
throw new DeploymentException( "Error reading configuration", ioe );
final String message = REZ.getString( "bad-read.error" );
throw new DeploymentException( message, ioe );
} }
} }
} }


+ 6
- 2
proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties View File

@@ -1,8 +1,8 @@
register-converter.notice=Registered converter {0} that converts from {1} to {2}. register-converter.notice=Registered converter {0} that converts from {1} to {2}.
register-role.notice=Registered {0}/{1} as {2}. register-role.notice=Registered {0}/{1} as {2}.

url-deploy.notice=Deploying {0}. url-deploy.notice=Deploying {0}.
file-deploy.notice=Deploying AntLib file ({0}). file-deploy.notice=Deploying AntLib file ({0}).

deploy-lib.error=Error deploying library from {0}. deploy-lib.error=Error deploying library from {0}.
deploy-converter.error=Failed to deploy {0} converter. deploy-converter.error=Failed to deploy {0} converter.
bad-descriptor.error=Malformed descriptor. bad-descriptor.error=Malformed descriptor.
@@ -10,4 +10,8 @@ deploy-type.error=Failed to deploy {0} type.
unknown-name4role.error=RoleManager does not know name for role {0}. unknown-name4role.error=RoleManager does not know name for role {0}.
unknown-role4name.error=RoleManager does not know role for name {0}. unknown-role4name.error=RoleManager does not know role for name {0}.
no-file.error=Could not find application archive at {0}. no-file.error=Could not find application archive at {0}.
file-is-dir.error=Could not find application archive at {0} as it is a directory.
file-is-dir.error=Could not find application archive at {0} as it is a directory.

bad-url.error=Unable to form url from file {0}.
bad-parser.error=Error configuring parser.
bad-read.error=Error reading configuration.

Loading…
Cancel
Save