mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
externalization fixes
This commit is contained in:
parent
50a30712fb
commit
d93eede391
6 changed files with 26 additions and 6 deletions
|
@ -1396,7 +1396,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
Throwable cause = e.getStatus().getException();
|
||||
if(cause instanceof IllegalArgumentException){
|
||||
//can not acquire the root rule
|
||||
Job j = new Job("save build info job"){
|
||||
Job j = new Job("save build info job"){ //$NON-NLS-1$
|
||||
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.dataprovider;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
|
@ -27,6 +28,20 @@ public class DataProviderMessages {
|
|||
return RESOURCE_BUNDLE.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
public static String getResourceString(String key) {
|
||||
return getString(key);
|
||||
}
|
||||
|
||||
public static String getFormattedString(String key, String arg) {
|
||||
return MessageFormat.format(getResourceString(key), new String[] { arg });
|
||||
}
|
||||
|
||||
public static String getFormattedString(String key, String[] args) {
|
||||
return MessageFormat.format(getResourceString(key), args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,11 @@
|
|||
# Intel Corporation - Initial API and implementation
|
||||
###############################################################################
|
||||
ProjectConverter.0=the specified project is not an CDT project
|
||||
ProjectConverter.0=failed to load the build info for the old-style project
|
||||
ProjectConverter.1=the specified project is not an old style make project, the owner ID is
|
||||
ProjectConverter.10=project conversion failed
|
||||
ProjectConverter.11=project conversion failed for project {0} with the following error:\n {1}
|
||||
ProjectConverter.13=failed to load the build info for the old-style project
|
||||
ProjectConverter.2=the specified project is not an old style project: the number of configurations is
|
||||
ProjectConverter.3=the specified project is not an old style project: the number of configurations is
|
||||
ProjectConverter.4=the specified project is not an old style make project: nature IDs are
|
||||
|
|
|
@ -81,7 +81,7 @@ public class ProjectConverter implements ICProjectConverter {
|
|||
private static final Object LOCK = new Object();
|
||||
private static ResourcePropertyHolder PROPS = new ResourcePropertyHolder(true);
|
||||
|
||||
private static String CONVERSION_FAILED_MSG_ID = "conversionFailed";
|
||||
private static String CONVERSION_FAILED_MSG_ID = "conversionFailed"; //$NON-NLS-1$
|
||||
|
||||
public boolean canConvertProject(IProject project, String oldOwnerId, ICProjectDescription oldDes) {
|
||||
try {
|
||||
|
@ -135,14 +135,14 @@ public class ProjectConverter implements ICProjectConverter {
|
|||
try {
|
||||
synchronized (LOCK) {
|
||||
if(PROPS.getProperty(project, CONVERSION_FAILED_MSG_ID) != null)
|
||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), "failed to load the build info for the old-style project"));
|
||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), DataProviderMessages.getString("ProjectConverter.0"))); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
newDes = model.createProjectDescription(project, false);
|
||||
info = convertManagedBuildInfo(project, newDes);
|
||||
} catch (CoreException e) {
|
||||
synchronized (LOCK) {
|
||||
displayInfo(project, CONVERSION_FAILED_MSG_ID, "project conversion failed", "project conversion failed for project " + project.getName() + " with the following error:\n" + e.getLocalizedMessage());
|
||||
displayInfo(project, CONVERSION_FAILED_MSG_ID, DataProviderMessages.getString("ProjectConverter.10"), DataProviderMessages.getFormattedString("ProjectConverter.11", new String[]{project.getName(), e.getLocalizedMessage()})); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
@ -554,7 +554,7 @@ public class ProjectConverter implements ICProjectConverter {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), "failed to load the build info for the old-style project"));
|
||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), DataProviderMessages.getString("ProjectConverter.13"))); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return info;
|
||||
|
|
|
@ -43,3 +43,4 @@ UpdateManagedProjectManager.3=Update Managed Build Project
|
|||
UpdateManagedProjectManager.4=The project {0} build settings are stored in a format that is no longer supported (version {1}).\n\nWould you like to convert it to the newer version ({2})?\n\nNOTE: Converted projects can no longer be loaded by previous versions of the Managed Build System.\nIf you select "No", project settings will NOT be available.
|
||||
UpdateManagedProjectManager.5=Managed Make project conversion failed: \n Managed Build System version {0} is not equivalent to the Managed Make project version {1} (project ID = {2})
|
||||
UpdateManagedProjectManager.6=the project .cdtbuild file does not exist
|
||||
UpdateManagedProjectManager.7=project conversion was cancelled
|
||||
|
|
|
@ -330,7 +330,7 @@ public class UpdateManagedProjectManager {
|
|||
|
||||
if (!shouldUpdate){
|
||||
fIsInfoReadOnly = true;
|
||||
throw new CoreException(new Status(IStatus.CANCEL, ManagedBuilderCorePlugin.getUniqueIdentifier(), "project conversion was cancelled"));
|
||||
throw new CoreException(new Status(IStatus.CANCEL, ManagedBuilderCorePlugin.getUniqueIdentifier(), ConverterMessages.getResourceString("UpdateManagedProjectManager.7"))); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
IFile projectFile = fProject.getFile(".project"); //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue