If you want to have Brass display messages in your native language, you will be able to drop in a satellite assembly containing translated resource strings.
Unfortunately, to do this you'll need the .NET or Windows SDK (download) but I'll post a resource file (.txt) and if you send it back to me with the replaced strings I'll compile it for you. It might be possible to write an resource compiler plugin for Brass itself, but I'm having difficulties emitting assemblies with a culture set (the only way I can do this is via the AL class, which requires the SDK anyway).
Basically, you need to compile a resource file into an assembly. Let's assume you were going to create a French translation of Brass. France has the general culture identifier "fr".
Create a text file with the name "Brass3.Strings.culture.txt" (in this case, "Brass3.Strings.fr.txt"). In this file should be Key=Value pair lines translating the application's resources. Here's the current default resource file (en-GB):
Code: Select all
CommandLineCalculatorMode=Running in interactive calculator mode. Type exit to quit.
CommandLineError=Error in {1} line {2} column {3}: {0}
CommandLineFatalError=Fatal Error.
CommandLineSyntax=Usage: Brass ProjectFile
CommandLineWarning=Warning in {1} line {2} column {3}: {0}
ErrorArgumentCountMismatch=Expected {0} argument(s).
ErrorArgumentCountMismatchEndlessRange=Expected {0} or more arguments.
ErrorArgumentCountMismatchRange=Expected {0} to {1} argument(s).
ErrorArgumentExpectedPositive=Argument {0} must be positive.
ErrorArgumentExpectedSingleToken=Expected a single token value for argument {0}.
ErrorArgumentExpectedSingleTokenAndIndex=Couldn't extract a single token and index.
ErrorArgumentOptionalNotLast=Argument types cannot have mandatory arguments following optional arguments
ErrorArgumentRepeatForeverNotLast=RepeatForever can only apply to the last argument.
ErrorArgumentUnsupportedType=Argument type {0} not supported.
ErrorAssemblerNotSet=No assembler set.
ErrorAssemblerNotSetAssumeDefault=Assembler not explicitly set, so assuming {0}.
ErrorAutomaticStringEncoderIsMultibyte=Automatically wrapped encodings must be single-byte only.
ErrorBaseMustByTwoEightSixteen=Must be base 2, 8 or 16.
ErrorBracketExpected=This token isn't an open or close bracket.
ErrorBracketMismatch=Brackets don't match.
ErrorBracketNotClosed=Matching closing bracket not found.
ErrorBracketStartIndexOutOfBounds=Invalid starting bracket index.
ErrorCancellingBuild={0} error(s) found: Cancelling build.
ErrorDirectiveNotDeclared=Directive '{0}' not declared.
ErrorEnvironmentNotSetTemplates=Environment variable Brass.Templates not set.
ErrorEvaluationAccessorLabelNotFound=No label found for label access operator.
ErrorEvaluationAssignmentsNotPermitted=You cannot perform assignments in this expression.
ErrorEvaluationExpectedFieldAccess=Expected field access.
ErrorEvaluationExpectedOperandAfterOperator=Expected operand after operator.
ErrorEvaluationExpectedOperandBeforeOperator=Expected operand before operator.
ErrorEvaluationFunctionNotDeclared=Function '{0}' not declared.
ErrorEvaluationMissingConditionalOperator=Missing matching conditional operator '?'.
ErrorEvaluationNoSingleResult=Syntax error.
ErrorEvaluationNothingToEvaluate=Nothing to evaluate.
ErrorEvaluationOperandsUnsupported={0} operands unsupported.
ErrorEvaluationTypeInformationMissing=Couldn't get type information.
ErrorExpectedAssignment=An assignment must be made.
ErrorFieldNotDeclared=Field '{0}' not defined.
ErrorFlowControlDisabled=Flow control has been temporarily disabled.
ErrorLabelAlreadyDefined=Duplicate label '{0}'.
ErrorLabelCannotParse=Could not parse '{0}'.
ErrorLabelCannotRemoveOutputCounter=You cannot remove the predefined output counter label.
ErrorLabelCannotRemoveProgramCounter=You cannot remove the predefined program counter label.
ErrorLabelInvalidNameNumber=Invalid name '{0}' (looks like a number).
ErrorLabelIsConstant=Label '{0}' is constant and cannot be assigned to.
ErrorLabelNotFound=Label '{0}' not found.
ErrorLabelPageNotFound=Page value for label '{0}' not found.
ErrorLabelReusableAlreadyExistsAtPosition=A reusable label already exists at this position.
ErrorLabelReusableInvalidClass='{0}' is not a valid reusable label class.
ErrorLabelReusableInvalidName=Invalid reusable label name.
ErrorLabelReusableNotFound=Couldn't get value for reusable label '{0}'.
ErrorMacroAlreadyDefined=Macro {0} already defined.
ErrorModuleAlreadyAtTopLevel=Already at the top module level.
ErrorOnlyLoadDuringInitialPass=You can only load and compile a file during the initial pass.
ErrorOutputFilenameNotSet=Output filename not specified.
ErrorPluginAlreadyAliased=Plugin '{0}' already loaded.
ErrorPluginNotFound=Plugin '{0}' not found.
ErrorProjectInvalidBuildConfigurationComponent=Invalid build configuration component '{0}'.
ErrorProjectTemplateNotFound=Could not load template {0}.
ErrorTokenTypeToInstruction=Type can only be set to TokenType.Instruction by assembler plugins.
ErrorUnspecifiedName=No name specified.
WarningPluginLoadedTwice=Plugin '{0}' loaded twice.
There are two stages to turning this file into a satellite assembly. First you need to turn it into a valid .resources file, done with the tool resgen:
Code: Select all
resgen Brass3.Strings.culture.txt
Code: Select all
al /t:lib /embed:Brass3.Strings.culture.resources /culture:culture /out:Brass.resources.dll
Code: Select all
C:\>resgen Brass3.Strings.fr.txt
Read in 62 resources from "Brass3.Strings.fr.txt"
Writing resource file... Done.
C:\>al /t:lib /embed:Brass3.Strings.fr.resources /culture:fr /out:Brass.resources.dll
Microsoft (R) Assembly Linker version 8.00.50727.312
for Microsoft (R) Windows (R) .NET Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2003. All rights reserved.
C:\>
The last stage is to copy the satellite assembly to the correct location, which is BrassDir\culture\Brass.resources.dll. To continue the example above:
Code: Select all
C:\Program Files\Brass\Brass.exe ; Main Brass executable.
C:\Program Files\Brass\de\Brass.resources.dll ; German translation.
C:\Program Files\Brass\nl\Brass.resources.dll ; Dutch translation.
C:\Program Files\Brass\nl-BE\Brass.resources.dll ; Dutch (Belgian) translation.