Open GoogleCodeExporter opened 8 years ago
Original comment by arshan.d...@gmail.com
on 8 Mar 2010 at 5:21
Original comment by arshan.d...@gmail.com
on 8 Mar 2010 at 5:21
I tried to implement the solution with a custom ValidationMessage object like
suggested before. But there was a few places (especially when
CssHandler/CssScanner is involved) where it will include a bit more then just
adjust a few errorMessages.add() calls ...
So for now i decided to only implement fairly simple solution to allow scans
with a user provided locale. I introduced a new constructor in the
AntiSamy.class with a Locale parameter. This locale will be used by the Scanner
classes (if no locale provided by the user Locale.getDefault() will be used).
The patch also merge the content from country specific
(AntiSamy_<lang>_<country>) to only language specific files (AntiSamy_<lang>)
because i see no difference in the content for the different countries. This
will be easier to maintain and more important allow fallbacks to the language
specific file if a country specific file for a given locale not exists.
Example:
locale (en) is used and there only exists a country specific file (en_US, en_GB
...)
the default locale (Locale.getDefault()) will be used as fallback.
See ResourceBundle.getBundle() javadoc for a detailed description for the used
search strategy.
Original comment by lucag...@gmx.de
on 18 Aug 2011 at 9:36
Attachments:
The patch here while a few years old still looks pretty good to me. We are
using antisamy in an LMS (Sakai) and different languages are expected on a per
user and site basis. It would be great if we had this so that the users were
able to override the system default language.
Original comment by matt...@longsight.com
on 27 Feb 2014 at 11:34
Original issue reported on code.google.com by
chris.lercher
on 20 Feb 2010 at 2:42