Greco Giuseppe wrote:
I figured that one out :). We could probably call it
NAnt.Core.ResourceUtils or somthing like that.
That's up to you... but such a name is a little bit too long and
uncomfortable to be used often...
you think ? Show me some classes in the core framework that have 2
letter names. The name 'RM' isn't particularly descriptive - as
evidenced by the fact that you felt the need to explain what it stands for.
Furthermore a class name should be singular and represent just
an entity (Array, Window, Button, etc.).
I disagree. We're talking about a class that contains only 1 static
method and will never be instantiated. So its hardly modelling a fixed
object. For similar examples in the NAnt codebase:
NAnt.Core.Util.FileUtils
NAnt.Core.Util.ReflectionUtils
NAnt.Core.Util.StringUtils
so for consistency it should probably be called:
NAnt.Core.Util.ResourceUtils
which is even more verbose :)
Ian
Let me know if it is Okay,
Looks good. I'll start going thru the errors in NAnt.Core and
factoring
them into a resource file. I might look at defining error codes and
documenting them at the same time.
The first step would be to create the resource files
(NAnt.Core.en-US.resx,
NAnt.DotNet.Task.en-US.resx, etc.), then replace hardcoded strings with
RM.GetString("Message_Id") - or whatever name you want, and finally add
the following target into the different NAnt build files:
<target
name="build-resources"
depends="init"
description="Builds resource binaries">
<foreach
item="String"
in="de-DE,en-US,es-ES,fr-FR,it-IT"
delim=","
property="culture">
<mkdir
dir="${build.dir}/${package.name}/lib/${culture}"
failonerror="false" />
<resgen
input="${assembly}.${culture}.resx"
output="${build.dir}/${package.name}/lib/${culture}/${assembly}.${cultur
e}.resources" />
</foreach>
</target>
You should also modify the <build> target in order to let the C#
compiler
embed the default resource (en-US) in the NAnt assemblies (for other
languages
we generate satelite assemblies):
<target
name="build"
depends="init build-resources"
description="Builds the binaries for the current configuration">
...
<property
name="default.resources"
value="en-US/${assembly}.en-US.resources,${assembly}.resources" />
<foreach
item="String"
in="de-DE,es-ES,fr-FR,it-IT"
delim=","
property="culture">
<al
target="library"
output="${build.dir}/${package.name}/lib/${culture}/${assembly}.resource
s.dll"
culture="${culture}">
<sources basedir="${build.dir}/${package.name}/lib/${culture}">
<include name="*.resources" />
</sources>
</al>
</foreach>
<csc ...>
...
<arg
value="-res:${build.dir}/${package.name}/lib/${default.resources}" />
</csc>
</target>
If you want I can help you... just let's coordinate. Have you already
run sed to extract all the hardcoded string from the code?
j3d.
Ian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from
real users. Discover which products truly live up to the
hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396> &op=click
_______________________________________________
nant-developers mailing list nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers
---------------------------------- DISCLAIMER ----------------------------------
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender
by return e-mail and delete this message from your system.Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
Banca del Gottardo (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in this
communication nor for any delay in its receipt or damage to your system.
Under no circumstances this message can be considered as a written acceptance
or confirmation of an instruction/order given to Banca del Gottardo.
Instructions and orders cannot be accepted or confirmed via e-mail.
Banca del Gottardo (or its group companies) does not guarantee that the integrity
of this communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
---------------------------------------------------------------------------------
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers