Thanks to all.
As often with computer stuff, I consider that there is not one and
unique good solution. There are several possibilities and the best
depends on what was already done, the size of files, a.s.o.
Often, it comes to me to think that I would have done things
differently if I had knew something.
"Experience is the sum of all errors that a man makes during his
life." (I can unfortunately not remember the famous person wo told
this.)
Thank you Mr Van der Donk for the details about Unicode. I knew that
Greek characters required more than 1 byte in UTF-8 and assumed they
required 2 (not 4) as they are quite commonly used but could not give
the details.
If I remember, Unicode is a set of character maps (tables) and UTF-8
works like it was using shortcuts to Unicode character maps. The the
first 127 chars are the same as in ANSI and are then coded on one
byte. For other characters like Greek ones, at least one other byte is
required to tell which Unicode character map to use. Then, UTF-8 and
Unicode are not exactly the same. UTF-8 is more compact as it uses 1
byte every time it can.
Thank you Mr Kofler for mentioning Notepad++.
Concerning the encodings, I prefer having all my 4 translations in one
file with switch{} instructions to serve the right language.
I know that this makes the file more than 4 times bigger than a
monolingual one.
But this lets me more easy change the wizard, without having to open 4
files with the risk to forget to change something in one of the files.
I just open the wizard script, copy some switch and change the
sentences simultaneously in the 4 languages.
This makes the translation process much more easy as I can see the
translations just above and below each others.
I also avoid mistakes linking the files, as always the same file is
linked whichever the language.
I won't change the wizard to Unicode, as it is already saved in
ANSI. Greek texts display improperly and would still display bad if
copy-pasted in a UTF-8 editor. To edit the file, I use Notepad as
external editor to write the sentences in Greek and then copy-paste
them in the ANSI-editor.
All works already fine. I just have to change the encoding for
Firefox.
Unless a better solution is found, I'll make 4 copies of the small
HTML document that calls the multilingual JavaScript wizard ...
docDisplayArea.fr.htm
docDisplayArea.en.htm
docDisplayArea.de.htm
docDisplayArea.el.htm
(or just 2 : one for Greek and one for other languages)
....set different <meta> tags for these documents...
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
....and call the same multilingual script.
I "played" quite a lot with my code. I tried to put an id to the meta
and to set its content or just the charset later, but it was
impossible.
I also observed that it is possible to specify the charset a <script>
element. So I tried this :
<script><!--
function GiveMeTheCharset() {
if (window.parent.lang=='el')
return 'iso-8859-7';
else
return 'iso-8859-1';
}
--></script>
<script type="text/javascript" charset="JavaScript:GiveMeTheCharset()"
src="wizard.js" />
.... but this did not work. Setting the charset statically works:
<script type="text/javascript" charset="iso-8859-7" src="wizard.js" />
Use vim(1); or Eclipse 3.3+, WST, and JSEclipse; both can do UTF-8 and SHL.
I heard that Eclipse is a quite large software. I prefer smaller
editors. I know VIM but prefer Crimson.
What do you mean by "edit in column mode"?
A software that works as if text was stored in a matrix. It is
possible to highlight a rectangle of text, for example from rows 31 to
35 and colums 5 to 8 and replace text in this block only when typing.
The edition is simultaneous on all rows. Crimson Editor (free) does
this. UltraEdit also can.
UltraEdit is also a very good text editor, but I really dislike the
fact that it wants to be the default editor for many file types. For
instance, after installation, it opens instead of Notepad when doing
"View source" in MSIE.
One last thing for Mr. Kofler who wrote
"An I thought we're well past the "browser-specific-websites".
Perhaps
not in Greece... "
My answer is:
1) I am not in Greece, not Greek and my site is not a Greek website
but a multilingual one.
2) I wouldn't have asked my question if I wanted to keep my site
browser-specific. It already works fine with MSIE. As you could see,
my question concerned how to make it Firefox-compatible.
3) By extension, we could say: "we're past the English-specific-
websites" or "we're past the German-specific-websites", ...
4) What's better: a web site that works with a browser and later with
others OR no web site?
Please, don't take it bad.
Julien