mirror of
https://github.com/peterdell/wudsn-ide.git
synced 2024-09-28 16:54:30 +00:00
Make "Assmbler"/"Compiler" text language dependent and have correct
sentence/title case in messages
This commit is contained in:
parent
fc48aa17e9
commit
1e11d6326c
@ -50,15 +50,15 @@ public final class LanguageUtility {
|
|||||||
* Gets the text for type of compilers for a language.
|
* Gets the text for type of compilers for a language.
|
||||||
*
|
*
|
||||||
* @param language The language, not <code>null</code>.
|
* @param language The language, not <code>null</code>.
|
||||||
* @return The text, not empty and not <code>null</code>.
|
* @return The text in sentence case, not empty and not <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public static String getCompilerTextLower(Language language) {
|
public static String getCompilerText(Language language) {
|
||||||
switch (language) {
|
switch (language) {
|
||||||
case ASM:
|
case ASM:
|
||||||
return "assembler"; // TODO: Have translation, so lower/upper is correct in German
|
return Texts.LANGUAGE_ASSEMBLER_TEXT;
|
||||||
|
|
||||||
case PAS:
|
case PAS:
|
||||||
return "compiler";
|
return Texts.LANGUAGE_COMPILER_TEXT;
|
||||||
|
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Unknown language '" + language + "'.");
|
throw new IllegalArgumentException("Unknown language '" + language + "'.");
|
||||||
@ -68,10 +68,10 @@ public final class LanguageUtility {
|
|||||||
public static String getCompilerPreferencesText(Language language) {
|
public static String getCompilerPreferencesText(Language language) {
|
||||||
switch (language) {
|
switch (language) {
|
||||||
case ASM:
|
case ASM:
|
||||||
return "Languages/Assemblers";
|
return Texts.LANGUAGES_TITLE_CASE+"/"+Texts.LANGUAGE_ASSEMBLER_TEXT_TITLE_CASE;
|
||||||
|
|
||||||
case PAS:
|
case PAS:
|
||||||
return "Languages/Compilers";
|
return Texts.LANGUAGES_TITLE_CASE+"/"+Texts.LANGUAGE_COMPILER_TEXT_TITLE_CASE;
|
||||||
|
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Unknown language '" + language + "'.");
|
throw new IllegalArgumentException("Unknown language '" + language + "'.");
|
||||||
|
@ -28,21 +28,14 @@ import org.eclipse.osgi.util.NLS;
|
|||||||
*/
|
*/
|
||||||
public final class Texts extends NLS {
|
public final class Texts extends NLS {
|
||||||
|
|
||||||
public static String TOC_COMPILER_SYNTAX_YES;
|
/**
|
||||||
public static String TOC_COMPILER_SYNTAX_NO;
|
* Languages,
|
||||||
public static String TOC_COMPILER_SYNTAX_BLOCK_DEFINITION_CHARACTERS;
|
*/
|
||||||
public static String TOC_COMPILER_SYNTAX_COMPLETION_PROPOSAL_AUTO_ACTIVATION_CHARACTERS;
|
public static String LANGUAGES_TITLE_CASE;
|
||||||
public static String TOC_COMPILER_SYNTAX_IDENTIFIER_PART_CHARACTERS;
|
public static String LANGUAGE_ASSEMBLER_TEXT_TITLE_CASE;
|
||||||
public static String TOC_COMPILER_SYNTAX_IDENTIFIER_SEPARATOR_CHARACTER;
|
public static String LANGUAGE_ASSEMBLER_TEXT;
|
||||||
public static String TOC_COMPILER_SYNTAX_IDENTIFIER_START_CHARACTERS;
|
public static String LANGUAGE_COMPILER_TEXT_TITLE_CASE;
|
||||||
public static String TOC_COMPILER_SYNTAX_IDENTIFIERS_CASE_SENSITIVE;
|
public static String LANGUAGE_COMPILER_TEXT;
|
||||||
public static String TOC_COMPILER_SYNTAX_INSTRUCTIONS_CASE_SENSITIVE;
|
|
||||||
public static String TOC_COMPILER_SYNTAX_LABEL_DEFINITION_SUFFIX_CHARACTER;
|
|
||||||
public static String TOC_COMPILER_SYNTAX_MACRO_USAGE_PREFIX_CHARACTER;
|
|
||||||
public static String TOC_COMPILER_SYNTAX_MULTIPLE_LINES_COMMENT_DELIMITERS;
|
|
||||||
public static String TOC_COMPILER_SYNTAX_SINGLE_LINE_COMMENT_DELIMITERS;
|
|
||||||
public static String TOC_COMPILER_SYNTAX_SOURCE_INCLUDE_DEFAULT_EXTENSION;
|
|
||||||
public static String TOC_COMPILER_SYNTAX_STRING_DELIMITERS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiler console.
|
* Compiler console.
|
||||||
@ -223,6 +216,22 @@ public final class Texts extends NLS {
|
|||||||
public static String TOC_COMPILER_INSTRUCTION_DESCRIPTION_LABEL;
|
public static String TOC_COMPILER_INSTRUCTION_DESCRIPTION_LABEL;
|
||||||
public static String TOC_COMPILER_MANUAL_TOPIC_LABEL;
|
public static String TOC_COMPILER_MANUAL_TOPIC_LABEL;
|
||||||
|
|
||||||
|
public static String TOC_COMPILER_SYNTAX_YES;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_NO;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_BLOCK_DEFINITION_CHARACTERS;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_COMPLETION_PROPOSAL_AUTO_ACTIVATION_CHARACTERS;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_IDENTIFIER_PART_CHARACTERS;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_IDENTIFIER_SEPARATOR_CHARACTER;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_IDENTIFIER_START_CHARACTERS;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_IDENTIFIERS_CASE_SENSITIVE;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_INSTRUCTIONS_CASE_SENSITIVE;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_LABEL_DEFINITION_SUFFIX_CHARACTER;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_MACRO_USAGE_PREFIX_CHARACTER;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_MULTIPLE_LINES_COMMENT_DELIMITERS;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_SINGLE_LINE_COMMENT_DELIMITERS;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_SOURCE_INCLUDE_DEFAULT_EXTENSION;
|
||||||
|
public static String TOC_COMPILER_SYNTAX_STRING_DELIMITERS;
|
||||||
|
|
||||||
public static String TOC_HARDWARES_TOPIC_LABEL;
|
public static String TOC_HARDWARES_TOPIC_LABEL;
|
||||||
public static String TOC_HARDWARE_NAME_LABEL;
|
public static String TOC_HARDWARE_NAME_LABEL;
|
||||||
public static String TOC_HARDWARE_ID_LABEL;
|
public static String TOC_HARDWARE_ID_LABEL;
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
LANGUAGES_TITLE_CASE=Languages
|
||||||
|
LANGUAGE_ASSEMBLER_TEXT_TITLE_CASE=Assembler
|
||||||
|
LANGUAGE_ASSEMBLER_TEXT=assembler
|
||||||
|
LANGUAGE_COMPILER_TEXT_TITLE_CASE=Compiler
|
||||||
|
LANGUAGE_COMPILER_TEXT=compiler
|
||||||
|
|
||||||
COMPILER_CONSOLE_TITLE=Compiler Console
|
COMPILER_CONSOLE_TITLE=Compiler Console
|
||||||
|
|
||||||
COMPILER_SOURCE_PARSER_TREE_OBJECT_TYPE_DEFAULT=Default
|
COMPILER_SOURCE_PARSER_TREE_OBJECT_TYPE_DEFAULT=Default
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
LANGUAGES_TITLE_CASE=Sprachen
|
||||||
|
LANGUAGE_ASSEMBLER_TEXT_TITLE_CASE=Assembler
|
||||||
|
LANGUAGE_ASSEMBLER_TEXT=Assembler
|
||||||
|
LANGUAGE_COMPILER_TEXT_TITLE_CASE=Kompiler
|
||||||
|
LANGUAGE_COMPILER_TEXT=Kompiler
|
||||||
|
|
||||||
COMPILER_CONSOLE_TITLE=Kompiler Konsole
|
COMPILER_CONSOLE_TITLE=Kompiler Konsole
|
||||||
|
|
||||||
COMPILER_SOURCE_PARSER_TREE_OBJECT_TYPE_DEFAULT=Default
|
COMPILER_SOURCE_PARSER_TREE_OBJECT_TYPE_DEFAULT=Default
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
LANGUAGES_TITLE_CASE=j\u0119zyki
|
||||||
|
LANGUAGE_ASSEMBLER_TEXT_TITLE_CASE=Assembler
|
||||||
|
LANGUAGE_ASSEMBLER_TEXT=assembler
|
||||||
|
LANGUAGE_COMPILER_TEXT_TITLE_CASE=Kompilator
|
||||||
|
LANGUAGE_COMPILER_TEXT=kompilator
|
||||||
|
|
||||||
COMPILER_CONSOLE_TITLE=Konsola kompilatora
|
COMPILER_CONSOLE_TITLE=Konsola kompilatora
|
||||||
|
|
||||||
COMPILER_SOURCE_PARSER_TREE_OBJECT_TYPE_DEFAULT=Domy\u015Blny
|
COMPILER_SOURCE_PARSER_TREE_OBJECT_TYPE_DEFAULT=Domy\u015Blny
|
||||||
|
@ -155,10 +155,10 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||||||
/**
|
/**
|
||||||
* Gets the text for type of compilers for a language.
|
* Gets the text for type of compilers for a language.
|
||||||
*
|
*
|
||||||
* @return he text, not empty and not <code>null</code>.
|
* @return The text in sentence case, not empty and not <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public final String getTextLower() {
|
public final String getText() {
|
||||||
return LanguageUtility.getCompilerTextLower(getLanguage());
|
return LanguageUtility.getCompilerText(getLanguage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -314,14 +314,14 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||||||
if (!hasHelpDocuments()) {
|
if (!hasHelpDocuments()) {
|
||||||
// INFO: The {0} '{1}' does not specify help documents.
|
// INFO: The {0} '{1}' does not specify help documents.
|
||||||
throw new CoreException(new Status(IStatus.INFO, LanguagePlugin.ID,
|
throw new CoreException(new Status(IStatus.INFO, LanguagePlugin.ID,
|
||||||
TextUtility.format(Texts.MESSAGE_E102, getTextLower(), getName())));
|
TextUtility.format(Texts.MESSAGE_E102, getText(), getName())));
|
||||||
}
|
}
|
||||||
String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(language);
|
String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(language);
|
||||||
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
||||||
// ERROR: Help for the '{0}' {1} cannot be displayed because the path to the
|
// ERROR: Help for the '{0}' {1} cannot be displayed because the path to the
|
||||||
// compiler executable is not set in the {2} preferences.
|
// compiler executable is not set in the {2} preferences.
|
||||||
throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID,
|
throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID,
|
||||||
TextUtility.format(Texts.MESSAGE_E130, getTextLower(), getName(), compilerPreferencesText)));
|
TextUtility.format(Texts.MESSAGE_E130, getText(), getName(), compilerPreferencesText)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return CompilerHelp.getInstalledHelpDocuments(getHelpDocuments(), compilerExecutablePath);
|
return CompilerHelp.getInstalledHelpDocuments(getHelpDocuments(), compilerExecutablePath);
|
||||||
@ -383,7 +383,7 @@ public final class CompilerDefinition implements Comparable<CompilerDefinition>
|
|||||||
// ERROR: Help for the {0} '{1}' cannot be displayed because no help file was
|
// ERROR: Help for the {0} '{1}' cannot be displayed because no help file was
|
||||||
// found in the paths relative to the executable path '{2}'.
|
// found in the paths relative to the executable path '{2}'.
|
||||||
throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID,
|
throw new CoreException(new Status(IStatus.ERROR, LanguagePlugin.ID,
|
||||||
TextUtility.format(Texts.MESSAGE_E131, getTextLower(), getName(), compilerExecutablePath)));
|
TextUtility.format(Texts.MESSAGE_E131, getText(), getName(), compilerExecutablePath)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ final class LanguageEditorCompileCommand {
|
|||||||
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
if (StringUtility.isEmpty(compilerExecutablePath)) {
|
||||||
// ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences.
|
// ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences.
|
||||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100,
|
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E100,
|
||||||
compilerDefinition.getTextLower(), compilerDefinition.getName(), compilerPreferencesText);
|
compilerDefinition.getText(), compilerDefinition.getName(), compilerPreferencesText);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
File compilerExecutableFile = new File(compilerExecutablePath);
|
File compilerExecutableFile = new File(compilerExecutablePath);
|
||||||
@ -261,7 +261,7 @@ final class LanguageEditorCompileCommand {
|
|||||||
// ERROR: Path to {0} '{1}' executable in the '{2}' preferences points to
|
// ERROR: Path to {0} '{1}' executable in the '{2}' preferences points to
|
||||||
// non-existing file '{3}'.
|
// non-existing file '{3}'.
|
||||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103,
|
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E103,
|
||||||
compilerDefinition.getTextLower(), compilerDefinition.getName(), compilerPreferencesText,
|
compilerDefinition.getText(), compilerDefinition.getName(), compilerPreferencesText,
|
||||||
compilerExecutablePath);
|
compilerExecutablePath);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ final class LanguageEditorCompileCommand {
|
|||||||
if (compilerParameterArray.length == 0) {
|
if (compilerParameterArray.length == 0) {
|
||||||
// ERROR: The {0} '{1}' does not specify default parameters.
|
// ERROR: The {0} '{1}' does not specify default parameters.
|
||||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101,
|
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E101,
|
||||||
compilerDefinition.getTextLower(), compilerDefinition.getName());
|
compilerDefinition.getText(), compilerDefinition.getName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ final class LanguageEditorCompileCommand {
|
|||||||
// ERROR: Cannot execute {0} process '{1}' in working directory '{2}'. System
|
// ERROR: Cannot execute {0} process '{1}' in working directory '{2}'. System
|
||||||
// error: {3}
|
// error: {3}
|
||||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E105,
|
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E105,
|
||||||
compilerDefinition.getTextLower(), compilerProcess.getCommandArrayString(),
|
compilerDefinition.getText(), compilerProcess.getCommandArrayString(),
|
||||||
compilerProcess.getWorkingDirectory().getPath(), ex.getMessage());
|
compilerProcess.getWorkingDirectory().getPath(), ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ final class LanguageEditorCompileCommand {
|
|||||||
// ERROR: {0} process ended with return code {1}. Check the error messages and
|
// ERROR: {0} process ended with return code {1}. Check the error messages and
|
||||||
// the console log.
|
// the console log.
|
||||||
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E127,
|
createMainSourceFileMessage(files, IMarker.SEVERITY_ERROR, Texts.MESSAGE_E127,
|
||||||
compilerDefinition.getTextLower(),
|
compilerDefinition.getText(),
|
||||||
NumberUtility.getLongValueDecimalString(compilerProcess.getExitValue()));
|
NumberUtility.getLongValueDecimalString(compilerProcess.getExitValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ public final class LanguageEditorFilesLogic {
|
|||||||
// ERROR: Output file extension must be set in the preferences of {0} '{1}' or
|
// ERROR: Output file extension must be set in the preferences of {0} '{1}' or
|
||||||
// via the annotation '{2}'.
|
// via the annotation '{2}'.
|
||||||
createMainSourceFileMessage(files, files.outputFileExtensionProperty, IMarker.SEVERITY_ERROR,
|
createMainSourceFileMessage(files, files.outputFileExtensionProperty, IMarker.SEVERITY_ERROR,
|
||||||
Texts.MESSAGE_E104, compilerDefinition.getTextLower(), compilerDefinition.getName(),
|
Texts.MESSAGE_E104, compilerDefinition.getText(), compilerDefinition.getName(),
|
||||||
LanguageProperties.OUTPUT_FILE_EXTENSION);
|
LanguageProperties.OUTPUT_FILE_EXTENSION);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -441,7 +441,7 @@ public abstract class LanguagePreferencesCompilersPage extends FieldEditorPrefer
|
|||||||
|
|
||||||
// ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences.
|
// ERROR: Path to {0} '{1}' executable is not set in the '{2}' preferences.
|
||||||
String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(compilerDefinition.getLanguage());
|
String compilerPreferencesText = LanguageUtility.getCompilerPreferencesText(compilerDefinition.getLanguage());
|
||||||
label.setText(TextUtility.format(Texts.MESSAGE_E100, compilerDefinition.getTextLower(), compilerDefinition.getName(),
|
label.setText(TextUtility.format(Texts.MESSAGE_E100, compilerDefinition.getText(), compilerDefinition.getName(),
|
||||||
compilerPreferencesText));
|
compilerPreferencesText));
|
||||||
Tab tab = new Tab(compilerDefinition, tabs.size(), tabItem, tabContent, disabledControl, controlDecorations);
|
Tab tab = new Tab(compilerDefinition, tabs.size(), tabItem, tabContent, disabledControl, controlDecorations);
|
||||||
tabs.put(compilerId, tab);
|
tabs.put(compilerId, tab);
|
||||||
|
Loading…
Reference in New Issue
Block a user