I guess I'm not the first one to ask a question about localization in
xul, but even after googling and hard reading of the xul's tutorials,
I can't make my application's localization working ...
Even when I try with a very simple app, it doesn't work.I always get
this message "XML Parsing Error: undefined entity", so I guess that
the application cannot locate my DTD file. Could anyone help me and
tell me what I am doing wrong ?
Here is the file structure :
findfile\
|---chrome
| |--- content
| | |--- main.xul
| |--- locale
| | |--- main.dtd
| |--- findfile.manifest
|--- defaults
| |--- preferences
| |--- prefs.js
|--- extensions
|--- updates
| |--- 0
|--- application.ini
And now the content of the files :
application.ini :
[App]
Vendor=Test
Name=findfile
Version=1.0
BuildID=20091106
Copyright=Copyright (c) 2009
ID=appID
[Gecko]
MinVersion=1.8
MaxVersion=2.0
findfile.manifest :
content findfile file:content/
locale findfile en-US locale/
prefs.js :
pref("toolkit.defaultChromeURI", "chrome://findfile/content/
main.xul");
main.xul :
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://findfile/locale/findfile.dtd">
<window
id="main"
title="findfile"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/
there.is.only.xul"
xmlns:x2="http://www.w3.org/TR/xhtml2"
xmlns:html="http://www.w3.org/1999/xhtml"
onload=""
onunload=""
>
<button label="&findLabel;"/>
</window>
And finally, the main.dtd :
<!ENTITY findLabel "Find">
I am using xulrunner-1.9.1
Any help is welcome, I'm becoming really desperate with that !
PS : I also tried to just put the main.dtd file in the content folder
with the main.xul, as stated in the tutorial, but it doesn't help.
"For non-installed chrome files, you can just put the DTD file in the
same directory as the XUL file. "
PS 2 : Tested on both Windows XP and Ubuntu, but I guess this issue is
OS independent.
<!DOCTYPE window SYSTEM "chrome://findfile/locale/main.dtd">
instead of
<!DOCTYPE window SYSTEM "chrome://findfile/locale/findfile.dtd">
it works with the xulrunner in command line, but I still get the error
if I open the app with firefox ....