On Tuesday 22 February 2005 20:39, Andreas Schuldei wrote:
> On Tue, Feb 22, 2005 at 05:43:23PM +0100, cobaco (aka Bart Cornelis)
wrote:
> > On Tuesday 22 February 2005 14:34, Andreas Schuldei wrote:
> webmin handles the module config page itself and uses latin1
> there, while i use utf-8 on wlus pages.
> > - if they do use utf-8, does that go for the entire module or only for
> > the lang/XX files (with the config.info.XX files, and module.info using
> > the webmin default?)
>
> lang/XX files are utf-8, config.info would need latin1. what is
> module.info?
module.info is a mandatory file (according to [1]), among other things it
contains 1 string that is to be translated:
desc=<something>
translations of that string are then included in module.info as:
desc_XX=<translation>
with as far as I can tell that line being in the default encoding for XX
(the native webmin i18n infrastructure is a royal PITA to work with)
-
> > - wether it is possible to autodetect the encoding used by a
> > module/different parts of a module? If so how?
>
> one can detect utf-8 by doing a iconf -f utf-8 -t utf-8. if that
> succeeds it is either pure ascii or utf-8.
>
> if it fails it *could* be a mix. that is an evil corner case which is
> not easy to handle in an automatic way.
good,
does 'iconv -f <some-encoding> -t <some-encoding>' always work for detecting
if something is in <some-encoding> or does this only work for utf-8?
I'm thinking of doing the following
- have po2webmin use the above 'iconv' check to see if the current lang/XX
file is in the default webmin encoding (which is not necessarely latin-1
for each language)
-> if so use the webmin default encoding for lang/XX
-> if not use utf-8 for lang/XX
- have po2webmin check if config.info.XX is in the webmin default encoding
for that language, if not try to iconv it
This would require manually iconv-ing any new translations' lang/XX file
once
[1] http://www.webmin.com/modules.html#files
--
cobaco (aka Bart Cornelis):
Coördinator Belgisch Skolelinux team
Coördinator Nederlandse Skolelinux vertaling
Attachment:
pgpJn58HBRN4c.pgp
Description: PGP signature