1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Externalize string

This commit is contained in:
Anton Leherbauer 2009-01-14 09:40:43 +00:00
parent 8b59db76b8
commit 4ae53aa136
3 changed files with 40 additions and 1 deletions

View file

@ -28,6 +28,7 @@ import org.eclipse.core.variables.IStringVariable;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.IValueVariable;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.osgi.util.NLS;
/**
* This supplier suplies the macros that represent the Eclipse variables
@ -82,7 +83,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
if (!canExpandVariable(fVariable.getName(), fArgument)) {
final String expression= "${"+fName+"}"; //$NON-NLS-1$//$NON-NLS-2$
throw new CdtVariableException(ICdtVariableStatus.TYPE_MACRO_REFERENCE_INCORRECT,
"Illegal usage of Eclipse variable: " + expression,
NLS.bind(Messages.EclipseVariablesVariableSupplier_illegal_variable, expression),
null,
fVariable.getName(), expression, null);
}

View file

@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.cdtvariables;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME= "org.eclipse.cdt.internal.core.cdtvariables.messages"; //$NON-NLS-1$
public static String EclipseVariablesVariableSupplier_illegal_variable;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,12 @@
###############################################################################
# Copyright (c) 2009 Wind River Systems and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Wind River Systems - initial API and implementation
###############################################################################
EclipseVariablesVariableSupplier_illegal_variable=Illegal usage of Eclipse variable: {0}