[issue31613] Localize tkinter.simpledialog.Default buttons as with file dialogs.

2022-03-04 Thread Sampo Hippeläinen

Sampo Hippeläinen  added the comment:

>Tk does not provide localized [Ok] and [Cancel] buttons.

This is not true. You can call ::msgcat::mc to localize core strings such as 
"OK" and "Cancel".

The full tk.call becomes

tk.call("namespace", "eval", "::tk", "::msgcat::mc", s)

to translate a string s, such as "OK".

I have made a custom modified version of simpledialog.py that makes use of this 
and indeed localizes the OK/Cancel buttons as they would be localized for tk 
messageboxes (which use Tcl/Tk Core localization). I submitted this now as a 
GitHub PR.

--
nosy: +sampo.hippelainen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31613] Localize tkinter.simpledialog.Default buttons as with file dialogs.

2022-03-04 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +29801
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31682

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31613] Localize tkinter.simpledialog.Default buttons as with file dialogs.

2017-09-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I would make such new paremeters keyword-only.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31613] Localize tkinter.simpledialog.Default buttons as with file dialogs.

2017-09-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Tkinter wraps the tcl/tk gui framework.  The file dialogs and messageboxes are 
provided by tk.  When possible, the file dialogs utilize the native OS file 
dialogs.  The localization is done the by the OS. If the messageboxes are 
localized, then I presume the same is true of them also.

tkinter.simpledialog is a tkinter add-on module written in Python, using tk 
widgets.  SimpleDialog does not have default buttons; they must be supplied in 
the initialization call.  Dialog does provide default *example* buttons.  The 
docstring says "override if you do not want the standard buttons".  

Tk does not provide localized [Ok] and [Cancel] buttons.  AFAIK, Python does 
not provide access to the OS local translations. You will have to provide 
localization yourself.

A reasonable enhancement request might be to add "ok='OK', cancel='Cancel'" to 
the signature of Dialog.__init__ so that a user could pass in local 
translations. These would then be passed on to buttonbox, to be used instead of 
the current hard-coded strings.

--
nosy: +terry.reedy
title: tkinter.simpledialog default buttons (not buttonbox) are not localized, 
unlike all messagebox -> Localize tkinter.simpledialog.Default buttons as with 
file dialogs.
type: behavior -> enhancement
versions: +Python 3.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com