<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16945" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Happy new year to everyone.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> I´m having some troubles when using
other compiler messages files to compile Lazarus or <BR>when using fpc compiled
with other message file language than english.<BR> The fact is that
Lazarus IDE has some pieces of code with embedded strings constants.
<BR> I thought the most common way to solve problems like this was
to declare an identifier to it and<BR>moving it to resourcestring header (or
file, i.e. LazarusIDEstrconsts)</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>*** The question is : What should be moved or not moved there ????
***</DIV>
<DIV> </DIV>
<DIV><BR>Other situation occurs with constant string in logic, like this example
from msgview.pp</DIV>
<DIV> </DIV>
<DIV><BR>procedure TMessagesView.MessageViewDrawItem(Sender:
TCustomTreeView;<BR> Node: TTreeNode; State: TCustomDrawState; Stage:
TCustomDrawStage;<BR> var PaintImages, DefaultDraw:
Boolean);<BR>var<BR> TheText: string;<BR> ARect: TRect;</DIV>
<DIV> </DIV>
<DIV>const<BR>-> cHint
= 'Hint: User defined:';<BR>->
cNote = 'Note: User
defined:';<BR>-> cWarning = 'Warning:
User defined:';<BR> clMsgHint = clBlue;<BR>
clMsgNote = clGreen;<BR> clMsgWarning =
clRed;<BR> cLeftSpacer = 0;<BR> <BR> procedure
ChangeFontColor(c: TColor);<BR>[-] ...<BR> end;<BR>
<BR>begin<BR> if Stage<>cdPostPaint then exit;<BR> // a paint
means, something has changed (scrolling, expand, collapse, resize,
...)<BR> Changed;</DIV>
<DIV> </DIV>
<DIV> //DebugLn(['TMessagesView.MessageViewDrawItem Index=',Node.Index,'
Count=',MessageTreeView.Items.Count,' TheText="',TheText,'"']);</DIV>
<DIV> </DIV>
<DIV> { Only use custom colors if not selected, otherwise it is difficult
to read }<BR> if not (cdsSelected in State)<BR> then
begin<BR>-> TheText :=
Node.Text;<BR>-> if Pos(cNote, TheText) > 0
then<BR>->
ChangeFontColor(clMsgNote)<BR>-> else if Pos(cHint,
TheText) > 0 then<BR>->
ChangeFontColor(clMsgHint)<BR>-> else if Pos(cWarning,
TheText) > 0 then<BR>->
ChangeFontColor(clMsgWarning);<BR> end;<BR>end;</DIV>
<DIV> </DIV>
<DIV><BR> If i use other language the code above will not work,
since messages are translated.</DIV>
<DIV> </DIV>
<DIV> I´m trying to figure how to solve this one, but before start
sending patches maybe should be wise to<BR>hear what others have to
say.<BR> Maybe we get some guidelines on how to proceed in such
situations.</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV> </DIV>
<DIV>Marcelo.</FONT></DIV></BODY></HTML>