-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: i18n of gtk msgbox buttons (#20007)
* fix: i18n of gtk msgbox buttons Manually backport #19904. See that PR for details. * fix: make linter happy * fix: make linter happy
- Loading branch information
Showing
5 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2019 GitHub, Inc. | ||
// Use of this source code is governed by the MIT license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "atom/browser/ui/util_gtk.h" | ||
|
||
#include <gtk/gtk.h> | ||
|
||
namespace util_gtk { | ||
|
||
// Copied from L40-L55 in | ||
// https://cs.chromium.org/chromium/src/chrome/browser/ui/libgtkui/select_file_dialog_impl_gtk.cc | ||
#if GTK_CHECK_VERSION(3, 90, 0) | ||
// GTK stock items have been deprecated. The docs say to switch to using the | ||
// strings "_Open", etc. However this breaks i18n. We could supply our own | ||
// internationalized strings, but the "_" in these strings is significant: it's | ||
// the keyboard shortcut to select these actions. TODO: Provide | ||
// internationalized strings when GTK provides support for it. | ||
const char* const kCancelLabel = "_Cancel"; | ||
const char* const kNoLabel = "_No"; | ||
const char* const kOkLabel = "_OK"; | ||
const char* const kOpenLabel = "_Open"; | ||
const char* const kSaveLabel = "_Save"; | ||
const char* const kYesLabel = "_Yes"; | ||
#else | ||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||
const char* const kCancelLabel = GTK_STOCK_CANCEL; | ||
const char* const kNoLabel = GTK_STOCK_NO; | ||
const char* const kOkLabel = GTK_STOCK_OK; | ||
const char* const kOpenLabel = GTK_STOCK_OPEN; | ||
const char* const kSaveLabel = GTK_STOCK_SAVE; | ||
const char* const kYesLabel = GTK_STOCK_YES; | ||
G_GNUC_END_IGNORE_DEPRECATIONS | ||
#endif | ||
|
||
} // namespace util_gtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2019 GitHub, Inc. | ||
// Use of this source code is governed by the MIT license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ATOM_BROWSER_UI_UTIL_GTK_H_ | ||
#define ATOM_BROWSER_UI_UTIL_GTK_H_ | ||
|
||
namespace util_gtk { | ||
|
||
/* These are `const char*` rather than the project-preferred `const char[]` | ||
because they must fit the type of an external dependency */ | ||
extern const char* const kCancelLabel; | ||
extern const char* const kNoLabel; | ||
extern const char* const kOkLabel; | ||
extern const char* const kOpenLabel; | ||
extern const char* const kSaveLabel; | ||
extern const char* const kYesLabel; | ||
|
||
} // namespace util_gtk | ||
|
||
#endif // ATOM_BROWSER_UI_UTIL_GTK_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters