Johan Euphrosine (proppy) wrote at 14:39 (EST):
> I believe this patch will correct the current problem with encoding of
> translated string sent over the HTTP interface.
proppy and I have been looking at this problem today in IRC. Today's
IRC logs might be of interest if people want to learn the full story.
Ultimately, the problem comes down to the fact that the translation
files for poker-engine defaulted to UTF-8, and the JSON code
(particularly toutf8() function) in pokersite expect encodings in
iso-8859-1.
Long term, it's a bad idea for us to only support iso-8859-1 for
server-processed localization. Ideally, the clients should tell us how
they want things encoded.
However, since the JSON interface in pokersite currently sends
everything in Unicode anyway, and assumes strings coming *to* it from
other places in the poker-network code are iso-8859-1, doing a patch
such as the one Johan suggests is probably an expedient way to make the
existing client-controlled, server-side message localization do
something sane in the locales we currently support.
(Indeed, I note that we don't support any non-latin-1 locales right now,
so we don't have to worry too much yet. The moment we get, say, a
Japanese or Chinese translation, we'll be completely screwed by this
solution.)
Tonight, I'll work up a quick patch with tests, etc. based on Johan's
suggestion below.
> - myGetTextFunc = gettext.translation('poker-engine',
> languages=[lang]).gettext
> + myGetTextFunc = gettext.translation('poker-engine',
> languages=[lang], codeset="iso-8859-1").gettext
I suspect to post something around 20:00 US/Eastern.
--
-- bkuhn
_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users