#1619 etc dir in buildJarDist

sarnold Sun 21 Aug 2011

Hello,

Just a simple question: how do you tell the Jar building tool to include props file in the etc/ directory in the Jar file produced?

I have some i18n tasks to include in a Jar bundle, and I can see some props file are included by default in the jar file.

Thanks for your answer

Regards

brian Wed 24 Aug 2011

Hi @sarnold,

You can see how it works now in JarDist in the etcFiles method.

I think we could probably enhance that to let you specify additional etc files, although that starts to get into the root of the issue which is should a pod have a hard requirement on etc files? If so then it sort of becomes a larger distribution issue.

Is this specific to locale.props? Maybe you could discuss the use case a bit more?

sarnold Thu 25 Aug 2011

Hi brian,

Well, I have only locale.props files to add to the Jar file.

The feature I would like to see is that the etc subdirectories would be copied recursively into the Jar file, based on which pods are used. (not only etc/sys, but also etc/fwt and so on)

For instance, I have localised some dialog buttons to French. So I have a fr.props file in etc/fwt/locale/. I would like my application to include these files since it uses the fwt pod.

I think this is logical and not too complex, but please tell me if it is really a good idea.

Thanks for your answer,

Regards

brian Thu 25 Aug 2011

I think for the locale files that you have predefined, that the best solution is to actually just package those up in your pod as a resource file. Then it should all work correctly (that is how testSys works). Unless there is a reason for someone to change them in the field, I think its better to just ship them as part of the pod.

sarnold Sun 28 Aug 2011

Thanks, it does work so.

But I think there is a way to localize dialog commands I do not see - is it possible to load a pod's props file from another pod?

Regards,

brian Mon 29 Aug 2011

The dialog commands Ok, Cancel, etc are localized by the keys ok.name, cancel.name, etc in the fwt pod.

It is really easy to access localized props from your own pod or others. The simplest way is to use locale literals or you can use Pod.locale:

fansh> "$<fwt::ok.name>"
OK
fansh> Pod.find("fwt").locale("ok.name")
OK

sarnold Mon 29 Aug 2011

Ok, but that is not what I meant.

I meant, can I tell fwt to load its locale properties from another pod's resource so I can localize fwt.pod dialogs without modifying the pod?

Thanks for your answer,

Regards

brian Mon 29 Aug 2011

Oh I see - no you can't do that unless you create a custom Env. But if you are packaging this up as a jar, you just need need to add the locale files into the proper location using Java's jar tool or some other zip tool.

Login or Signup to reply.