I need the JRE to use translated versions of a JRE resource that is available only in English.
As per the ResourceBundle.java doc, it's easy: add localized resources with the right locale suffix. For example, the standard
XMLSchemaMessages.properties
would become a translated version:
XMLSchemaMessages_FR.properties
And so on.
EDIT: this particular file lives in :
com\sun\org\apache\xerces\internal\impl\msg\XMLSchemaMessages.properties
My question is: how do I make those extra resources visible to the JRE ?
Thanks in advance, for any help.
-- cheers
Assuming that Xerces uses ResourceBundle to get the messages, you should put a new file in
com\sun\org\apache\xerces\internal\impl\msg\XMLSchemaMessages<locale>.properties
where locale is a correct identifier for the locale you need.
Then pinpoint the exact location where the XMLSchemaMessages resource bundle is loaded, and set a breakpoint so you single step through the ResourceBundle loading procedure in the JRE (a JDK is recommended here, so you have source for the runtime) and you can see what is being searched for.
Note: You are dealing with a vendor specific XML Parser here meaning this will be Oracle specific and may even only work on some Java versions. Considered bringing in your own validating XML Parser and localize it instead?
The above answers took me a little while to work out.
Just to make it easier for others, here's my summary of how to get Locale specific error messages to appear if you try parsing an XML document using XML schema with Java's internal Xerces parser:
Find an appropriate properties file in the format
XMLSchemaMessages_<lower_case_language_code>.properties
For Italian I found XMLSchemaMessages_it.properties on the following site (which might be an old version, but it worked for me)
http://grepcode.com/file/repo1.maven.org/maven2/com.sun.xml.parsers/jaxp-ri/1.4.5/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
I then created a directory structure in my temp directory to hold the new file
com\sun\org\apache\xerces\internal\impl\msg
Since jar files and zip files share the same format (and I'm lazy and today I was using Windows), I then zipped the above com directory, creating a file called com.zip. I then changed the name of the file
rename com.zip to XMLSchemaMessages_Locale.jar
and then moved the new jar file to
C:\Program Files\Java\jdk1.7.0_04\jre\lib\ext
Of course the above path depends on your platform and specific version of Java (I was using Windows 7).
Instead of zipping, if you have JDK you could easily build the jar file using the command-line jar command, from Unix, Linux or Windows.
Related
I'm not 100% sure that e.g. version 1.7.7 of Avro can read files produced by 1.9.2 or 1.8.2. So I'd rather keep somewhere in meta information the version of avro that was used when creating a file.
But I don't see how it is possible, without tweaking build files and creating some kind of resource (it's pretty simple in gradle).
As you can see in Get jar version in runtime, version can be retrieved, at least when it's provided.
So, in this specific case, the following line:
(new org.apache.avro.Schema.Parser).getClass.getPackage.getImplementationVersion
Returns a version string; in my specific case it is "1.7.7".
I'm realizing a custom setup for my outlook addin. I want the installer in Dutch language, but VS 2010 doesn't support this language.
Is there a solution to my issue?
The default procedure to make a dutch language msi setup is to use orca.exe on the msi file and translate the TEXT column of some tables. (you can also do this by extracting the msi database and by importing it back in the msi when the translation has been done).
But there is the other way: Creating the language support directly in the Setup project creator.
I'm using VS.NET 2003 (yeps still the old version) and when you create a setup project you have no dutch language support in the project localisation. I figured out how that thing works but I'm stuck in the language change of the msiloadr.bin and the webloadr.bin files (both dll files included in the distribution) (step 3 in the comment below). The unusual procedure to include directly the language support in the VS.Net Setup project :
1) get the local identifier and the code page for your language (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp)
2) Go to the VS.NET/Common7/Tools/Deployment/VsdDialogs directory and copy 1033 (english) directory to 1043 directory (dutch). Translate all the files in that directory with orca.exe and update the 1033 language code to 1043
3) Go to the VS.NET/Common7/Tools/Deployment/MsiRedist directory and copy 1033 (english) directory to 1043 directory (dutch). Here we need to update the bin files (DLL) to set it up as a dutch language.
4) Update the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Deployment\DialogTemplates:)
Append ", Dutch" to the Languages key
Append ", 1043" to the Identifiers key
Append ", 1252" to the CodePages key
Once you have done that you'll be able to compile any Setup project in the dutch language and this can be done for all the missing languages. (If you solve the 3rd step)
Maybe you have some solution to solve for the unofficial sulution by tweaking VS.NET :-)
Copied from: http://social.technet.microsoft.com/Forums/windows/en-US/2d062f34-5615-47c8-aa7b-a69fbd68e983/how-to-make-a-installer-in-dutch-language
Please read this :-
Set up creation using selected language
I have a Windows Installer XML (WiX 3.5) project and five localization files for my installer. Therefore WiX creates five .msi files, for every language one. How can i put all in one .msi and let the user select the language when executing the installer?
I heard something about a bootstrapper, but then i would have a Setup.exe and i need a msi file. Is it not possible to adabt the localization strings after compiling with WiX?
This can be done using transforms. Please take a look at this article:
http://www.installsite.org/pages/en/msi/articles/embeddedlang/
There are 2 parts to making this happen,
localisation of the Installer UI, and/or
choice of installed files.
The method I chose will automatically select the local (or near local) language, and can also be forced to a specific transform using command line options. This doesn't prompt the user to choose which language to install in - so maybe it doesn't actually meet your needs.
The second 'installed files' doesn't seem to be documented as well and I was recently asking about it in Why would MST not include files with different content.
As a response provided there is now an ANT build script using Windows7 SDK & antdotnet
does anybody know how to figure out the assembly versions (not file versions) of loaded assemblies if I have a full memory dump?
Suppose I have a full dump of the .net process and I found two assemblies with the same name loaded in one AppDomain. I need to know what versions those assemblies have.
The SOS commands !dumpmodule, !dumpassembly and !dumpdomain do not provide that kind of information or I just missed something.
Thank you in advance.
You could try the !SaveModule SOS command. This takes the start address of an assembly and creates a new file (the name of which is given by you) to save the contents of the assembly. You could then use something like .NET Refletor to open the file, and it might give you the .NET version somewhere in there. This SO question has some details on that:
How to find out which version of the .NET Framework an executable needs to run?
As for the !SaveModule command, here's a blog article that describes how to use it:
http://blogs.msdn.com/b/tess/archive/2006/05/18/601002.aspx?PageIndex=2
We need to get data out of an older accounting system. We have received a dll that gives us access to the data we need. It includes a type library that we have imported.
If we run our test application from the same directory as the accounting system, everything works fine. If we try to run our application from a different directory, we get the following error:
Dynamically Bound RTS
Runtime DLL 'OOPS', version 3.1, entry point oops
not recorded in registry, not found or incompatible with requirements
of dynamically bound COBOL program. Dynamic binding of RTS requires:
Runtime DLL 'OOLSM', at least Version 3.1
Can anybody provide some helpful information on this?
Are we supposed to have some kind of cobol runtime in our directory? Or in the path? Or registered in the registry?
Thanks,
-Vegar
Updates:
Setting the system %path% to include the path to the accounting system seems to do the trick. Including it as a user variable did not have the same effect for some reason.
What Cobol are you using?
I had done this for year with Microfocus NetExpress 3.1, and all works just fine.
I write COBOL DLL to access COBOL data files, and also write Delphi DLL to add new features to old COBOL systens.
And yes, I use to set the runtime path, that is environment variable called COBDIR, there are others,but usually %PATH% and %COBDIR%is enough.
If you give more detais about what COBOL compiler are you using, and how is the dll interface that you are calling, will me ore easy to help you.
And maybe "Dependence Walker" can help you to identify what run time files are missing, if it is.
http://www.dependencywalker.com/
If it works from the accounting app's directory, but not a different one, the first thing I'd try is adding that directory to your path.
Unless it is already loaded into memory, Windows looks for DLL's that a program is requesting in every location listed in its PATH environment variable, and also in the directory the application is located within.