[Pmwiki-users] pmwiki localization ?

Carlo Strozzi carlos
Wed Jul 30 02:29:44 CDT 2003


On Tue, Jul 29, 2003 at 04:31:37PM -0600, Patrick R. Michaud wrote:
> Sure, it's very easy to do--just create localization files that
> change the PmWiki defaults into whatever language is required.  I think
> there are very few truly hard-coded items in PmWiki (and I can certainly
> work to eliminate them wherever they exist).
> 
> If anyone wants to provide me with the correct phrases PmWiki should
> use for a given language, I'll be very happy to create the corresponding 
> localization file and make it part of the distribution.  :-)

Patrick,
that's very good news. Coming up with ideas, like I did, is often easy,
but the other side of the coin is that then a volunteer is needed to
implement them :-) If you are willing to do it yourself that would be
great. I think that once the mechanism is in place then the non-english
contributions will come automatically from the community. I'll certainly
offer to provide the italian ones.

Basically, we could have two localized files: one for "language tokens"
("Edit Page", "Search Wiki", ...) and one for messages. The token
file can be something like "local/tokens-$Lang.php", and the message table
"local/msg-$Lang.php", or similar file names to that effect, with $Lang
being a local.php config variable like all others, set by default to
"en_US".

Both files will presumably contain the php equivalent of a {key,value}
pair per line, and messages may need replaceable parts, so that you can
re-use the same message in different situations. That is, messages should
be referred to by numbers (1, 2, 3, ...), and the "value" of
a message entry should contain the equivalent of C's "%s", like:

   error "%s" from function "%s"

and similar things.

Wiki section names (i.e. "Main/") will also have to be localized, which
may be slightly more tricky, I dunno.

Just my 2 cents.

cheers,
Carlo
-- 
For best reading please set the Courier font.
Freedom for Business: http://swpat.ffii.org



More information about the pmwiki-users mailing list