[josm-dev] JOSM MOTD code / note to translators
Frederik Ramm
frederik at remote.org
Fri Jun 13 00:35:00 BST 2008
Hi,
I was a bit unhappy with the MotD mechanism and have made two
changes.
1. I have disabled the feature that would only show those messages
that had not been read yet. JOSM now shows all applicable messages,
always. I think we can work with this; as soon as the number of
messages becomes too large we can always drop the oldest ones (and
replace them by a message targetting older versions saying "please
upgrade ASAP").
2. Messages are now translatable. The MotD mechanism, as implemented
before, works as follows:
* fetch http://josm.openstreetmap.de/wiki/MessageOfTheDay
* look for all links on that page that jave a structure of
MessageOfTheDay{<|>|<=|>=}{number}, evaluate whether they
apply to the JOSM version being run, and if applicable,
download and show the appropriate Wiki page.
For example, the last link on the MessageOfTheDay page is
MessageOfTheDay>=1
so any client with build number >= 1 would always present the
message contained in
http://josm.openstreetmap.de/wiki/MessageOfTheDay%3E%3D1
to the user.
I have made one minor change to this, namely that before the system
tries to download
http://josm.openstreetmap.de/wiki/MessageOfTheDay%3E%3D1
it will try to download a page with a language code prepended. The
language code is contained in JOSM within a tr() macro (it is "En:"
in the default build) and thus a JOSM translator can simply change
it. If it is changed to, say, "De:", then JOSM will first check
http://josm.openstreetmap.de/wiki/De:MessageOfTheDay%3E%3D1
and only if that page doesn't exist will it revert to the one
without language code.
This makes sure that i18n users will always see at least the English
version of a message.
Bye
Frederik
--
Frederik Ramm ## eMail frederik at remote.org ## N49°00'09" E008°23'33"
More information about the josm-dev
mailing list