tobias47n9e
tobias47n9e

Reputation: 2231

Create option to switch language for Glade 3 GTK 3.1x PyGObject program

I am looking for an example application that has an options menu, in which the language of the program can be switched manually. QGIS for example has such an option:

enter image description here

Is there a program using Glade 3, GTK 3.1x and PyGObject out there which shows a good way of doing this?

Upvotes: 1

Views: 584

Answers (1)

ptomato
ptomato

Reputation: 57870

This isn't usually an option in applications, because, honestly, it's not a feature that many people will use. Most programs will use the system language setting to determine what language to display their UI in, and that's what Glade/GTK/Python makes it easy to do.

Most people won't have a need to run their program in a different language from the main system UI, and most people certainly won't need to change the program's language while using it.

It's certainly possible, as QGIS does: you have to either destroy and recreate the GUI when you switch languages, or keep track of which GUI widgets have localizable text in them, and change the text. But it's a very complex feature that brings little benefit, some would argue, and you should think about whether your user base actually needs it.

Upvotes: 1

Related Questions