Skip to content

GTK: Add the locale as a config setting #10276

@pluiedev

Description

@pluiedev

This has been requested a few times now at least as far as I know (including in person, fun fact), but a recent discussion can be found at #10249.

We should allow the locale to be specified as a config setting, for users who e.g. might want to make their whole system default to one language (say English) and only enable localization for apps that support it. I never really thought about this use case before, mostly because I just stick to either English or Chinese the entire time, but this does make sense.

Something like this would do (I debated over whether to call this locale or language, but I think for non-native speakers of English "language" is a far more approachable term than "locale", even if it is the technical term):

language = zh_CN

Implementation-wise the only tricky spot is in implementing the hot reload mechanism, which on gettext/libintl is very cursed. Still, it's a well-documented hack that we should absolutely make use of.

EDIT: Looks like GTK does not like it when locales are changed on the fly. We could make this non-hot-reloadable then.

GTK only for now. We can edit or recreate this issue when macOS receives localization support as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    gtkIssues exclusive to GTK which are not OS-specificguiGUI or app issue regardless of platform (i.e. Swift, GTK)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions