Closed GoogleCodeExporter closed 9 years ago
As far as I am aware, we have no support for parsing Hungarian san moves. I also
think it would be fairly difficult to implement, as some languages has multi
letter
codes for some pieces.
But we might of course bring up a more sophisticated error dialog..
Or more sexy: Use a spelling checking framework, to put a red line under Hf3
with Nf3
as a suggestion.
Original comment by lobais
on 23 Sep 2007 at 5:20
Yes, i missed this.
Anyhow, most languages use 1 letter code for pieces
(http://www.very-best.de/pgn-spec.htm#17.), so enhancing the PGN parser to
support
the 1 letter case, can make happy the big part of the chess community :)
Original comment by gbtami
on 23 Sep 2007 at 7:00
That is right of course.
However in that case we need a way to specify the language of the file, as the
same
letter can mean different pieces in different languages. Often we might be able
to
guess it, but it is harder to implement, and risky.
I personally open a tons of english notated pgn's, so I wouldn't like PyChess to
expect them to be danish.
We could have a combo in enter notation and filechooser with language?.. Would
create
some visual clutter though.
Or maybe only in enter notation. I really don't hope that anybody would put
language
encoded data in a file meant to be computer readable. None the less I feer it.
Original comment by lobais
on 23 Sep 2007 at 9:16
Original comment by lobais
on 23 Sep 2007 at 9:17
I imagine, the "Enter game notation" best reason is not for pasting games from
pgn
files (there is open menu for that), but for handwriting our own games
notations for
analyze and store.
The pgn itself is a storage format and stores english piece letters by
definition(or
de facto), so no need to support other language piece letters in pgn IMO. On the
other side, in enter game nonation box (_olnly_ there, and not in filechooser),
we
can support locale letters for parsers. I can imagine a global setting in
options menu:
"Use local piece letters in enter game notation", and if it was chosen, the
parser
will use localReprSign instead of reprSign. Or maybe a flag icon, as used on
most
keyboard swithcing applets on taskbar. (Eng/Loc flags in our case.)
Original comment by gbtami
on 24 Sep 2007 at 7:17
I don't think we need a preferences option. A combobox remembering the last
value
chosen should be fine.
I'm not sure what you mean by a flag icon.
Original comment by lobais
on 24 Sep 2007 at 1:52
Combobox is a bit overcomplicating IMO, Most user wants to use only his native
notation and english.
The flag icon is a 2 state image area (button widget?). It starts as your native
country flag. Click. English flag. Click. Native flag.
We have flag images for all countries in svn already.
Original comment by gbtami
on 24 Sep 2007 at 2:36
You are right that a combobox of all languages would be hard to navigate due to
the
many choices. On the other hand I don't think it is very intuitive what will
happen
if you click a flag icon.
I'm not really sure how to implement it without further cluttering the gui. I
can see
perhaps four ways:
# A flag in the upper right corner
# A right click menu option*
# Two radiobuttons next to each other below the textview
3 A combobox in the lower left corner* (can't see it fit anywhere else)
* The submenu and the combobox would have three items: Local, English and Other.
They'd all have an icon, and 'Other' would open a submenu or a dialog with the
entire
supply of languages.
At the end of the day the flag icon (with a tooltip) might be the more simple
way,
and if people want other languages they can translate the san by them selves.
Original comment by lobais
on 24 Sep 2007 at 6:20
That's agreed :)
Original comment by gbtami
on 25 Sep 2007 at 9:15
Committed a simple conversion code into enterGameNotation() in ionest.py (svn
646).
Needs an UI element (flag icon) to make it live. Sorry, but i'm not familiar
with
pygtk/glade yet :(
Original comment by gbtami
on 29 Sep 2007 at 4:36
The flag icon now works in svn 656. The only remaining issue is to handle
notations
using untranslated locale (no pychess.po), or the flag icon locale not matching
with
entered piece letters case. I mean to handle tracebaks like i'v pasted in
Comment 1.
Original comment by gbtami
on 2 Oct 2007 at 9:14
Yes, we 1: Change the ValueError to a (selfdefined) ParsingError. 2: Catch the
error.
3: Bring up an error dialog, and suggesting that the language could be wrong.
Btw. If you have english locale, will the flag button just switch between
english/english?
Original comment by lobais
on 2 Oct 2007 at 9:18
In 657 image button has 2 flags only for langs having .mo file.
For langs having no .mo i leave the us flag there, indicating the user have to
enter
english piece letters. Is it acceptable this way?
Original comment by gbtami
on 2 Oct 2007 at 10:28
Sounds fine.
Shouldn't annoy anybody (except the fundamental anti patriots :))
Are you also on for the error catching?
Besides changing the error class, I guess it should just be a try catch around
the
loadAndStart call in simpleLoadGame.
That will also catch bad pgn-opens though, so the error should probably be a
little
more general.
IIRC the legal pgn before the error, is stilled parsed and opened, so the error
should just be informal.
Original comment by lobais
on 2 Oct 2007 at 10:55
Sorry, but i'm not to good enough on exception handling yet :(
Original comment by gbtami
on 2 Oct 2007 at 6:33
Error dialog is up in revision 663
Original comment by lobais
on 3 Oct 2007 at 6:41
Original comment by lobais
on 5 Oct 2007 at 6:49
Original issue reported on code.google.com by
gbtami
on 23 Sep 2007 at 11:43