Changing the entire GUI language all at once

In this recipe, we will change the entire GUI display names all at once by refactoring all the previously hard-coded English strings into a separate Python module and then internationalizing those strings.

This recipe shows that it is a good design principle to avoid hard-coding any strings that our GUI displays but to separate the GUI code from the text that the GUI displays.

Note

Designing our GUI in a modular way makes internationalizing it much easier.

Getting ready

We will continue to use the GUI from the previous recipe. In that recipe, we had already internationalized the title of the GUI.

How to do it...

In order to internationalize the text being displayed in all of our GUI widgets, we have to move ...

Get Python GUI Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.