On Windows and macOS, file chooser dialogs are built into the operating system, and there is a way for an application to tell the dialog to localize the text on buttons and titles to the system language (usually by not explicitly setting the button and title text).
On Linux, while there is no system file chooser dialog, the vast majority of applications use GTK. However, GTK's file chooser dialogs require users to provide strings for the button and title text:
dialog = gtk_file_chooser_dialog_new ("Open File",
parent_window,
action,
"_Cancel",
GTK_RESPONSE_CANCEL,
"_Open",
GTK_RESPONSE_ACCEPT,
NULL);
Leaving those strings empty or null leads to the buttons and title having no text at all, instead of having some default text.
Does GTK have its own set of localized default button and title text that application developers can tap into?
Note that many Linux applications use the gettext internationalization library, but that depends on the application to provide a translation database for every language they wish to support, which is not what I'm looking for. I'm looking for a way for my application to show proper dialog text in every language that GTK knows about, even if my application doesn't have translated strings for them.
Note also that that GTK message dialogs created with gtk_message_dialog_new can have correctly translated button text, assuming that the user has installed the correct language packs, as no text is explicitly specified (you just pass GTK_BUTTONS_OK_CANCEL to it to get correctly translated "OK" and "Cancel" buttons), but there seems to be no equivalent for file chooser dialogs.