Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
005b3a05
Commit
005b3a05
authored
Jan 11, 2023
by
Luca Bacci
Committed by
Jehan
Jan 24, 2023
Browse files
Make use of the gimp_bind_text_domain () util function
parent
cbcb9181
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/main.c
View file @
005b3a05
...
...
@@ -1073,12 +1073,12 @@ gimp_init_i18n (void)
setlocale
(
LC_ALL
,
""
);
bindtextdomain
(
GETTEXT_PACKAGE
"-libgimp"
,
gimp_locale_directory
());
gimp_
bind
_
text
_
domain
(
GETTEXT_PACKAGE
"-libgimp"
,
gimp_locale_directory
());
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset
(
GETTEXT_PACKAGE
"-libgimp"
,
"UTF-8"
);
#endif
bindtextdomain
(
GETTEXT_PACKAGE
,
gimp_locale_directory
());
gimp_
bind
_
text
_
domain
(
GETTEXT_PACKAGE
,
gimp_locale_directory
());
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset
(
GETTEXT_PACKAGE
,
"UTF-8"
);
#endif
...
...
app/widgets/gimplanguagestore-parser.c
View file @
005b3a05
...
...
@@ -374,9 +374,9 @@ iso_codes_parser_init (void)
#ifdef G_OS_WIN32
/* on Win32, assume iso-codes is installed in the same location as GIMP */
bindtextdomain
(
"iso_639"
,
gimp_locale_directory
());
gimp_
bind
_
text
_
domain
(
"iso_639"
,
gimp_locale_directory
());
#else
bindtextdomain
(
"iso_639"
,
ISO_CODES_LOCALEDIR
);
gimp_
bind
_
text
_
domain
(
"iso_639"
,
ISO_CODES_LOCALEDIR
);
#endif
bind_textdomain_codeset
(
"iso_639"
,
"UTF-8"
);
...
...
libgimp/gimp.c
View file @
005b3a05
...
...
@@ -487,7 +487,7 @@ gimp_main (GType plug_in_type,
/* initialize i18n support */
setlocale
(
LC_ALL
,
""
);
bindtextdomain
(
GETTEXT_PACKAGE
"-libgimp"
,
gimp_locale_directory
());
gimp_
bind
_
text
_
domain
(
GETTEXT_PACKAGE
"-libgimp"
,
gimp_locale_directory
());
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset
(
GETTEXT_PACKAGE
"-libgimp"
,
"UTF-8"
);
#endif
...
...
libgimp/gimpplugin.c
View file @
005b3a05
...
...
@@ -1016,7 +1016,7 @@ _gimp_plug_in_create_procedure (GimpPlugIn *plug_in,
if
(
_gimp_plug_in_set_i18n
(
plug_in
,
procedure_name
,
&
gettext_domain
,
&
catalog_dir
))
{
bindtextdomain
(
gettext_domain
,
catalog_dir
);
gimp_
bind
_
text
_
domain
(
gettext_domain
,
catalog_dir
);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset
(
gettext_domain
,
"UTF-8"
);
#endif
...
...
@@ -1346,7 +1346,7 @@ gimp_plug_in_proc_run_internal (GimpPlugIn *plug_in,
if
(
_gimp_plug_in_set_i18n
(
plug_in
,
gimp_procedure_get_name
(
procedure
),
&
gettext_domain
,
&
catalog_dir
))
{
bindtextdomain
(
gettext_domain
,
catalog_dir
);
gimp_
bind
_
text
_
domain
(
gettext_domain
,
catalog_dir
);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset
(
gettext_domain
,
"UTF-8"
);
#endif
...
...
libgimpbase/gimpenv.c
View file @
005b3a05
...
...
@@ -514,12 +514,13 @@ gimp_data_directory (void)
* from the executable's full filename is used.
*
* The returned string is owned by GIMP and must not be modified or
* freed. The returned string is in the encoding used for filenames by
* the C library, which isn't necessarily UTF-8. (On Windows, unlike
* the other similar functions here, the return value from this
* function is in the system codepage, never in UTF-8. It can thus be
* passed directly to the bindtextdomain() function from libintl which
* does not handle UTF-8.)
* freed. The returned string encoding depends on the system where GIMP
* is running: on UNIX it's in the encoding used for filenames by
* the C library (which isn't necessarily UTF-8); on Windows it's UTF-8.
*
* On UNIX the returned string can be passed directly to the bindtextdomain()
* function from libintl; on Windows the returned string can be converted to
* UTF-16 and passed to the wbindtextdomain() function from libintl.
*
* Returns: The top directory for GIMP locale files.
*/
...
...
@@ -536,18 +537,6 @@ gimp_locale_directory (void)
gimp_locale_dir
=
gimp_env_get_dir
(
"GIMP3_LOCALEDIR"
,
LOCALEDIR
,
tmp
);
g_free
(
tmp
);
#ifdef G_OS_WIN32
/* FIXME: g_win32_locale_filename_from_utf8() can actually return
* NULL (we had actual cases of this). Not sure exactly what
* gimp_locale_directory() should do when this happens. Anyway
* that's really broken, and something should be done some day
* about this!
*/
tmp
=
g_win32_locale_filename_from_utf8
(
gimp_locale_dir
);
g_free
(
gimp_locale_dir
);
gimp_locale_dir
=
tmp
;
#endif
}
return
gimp_locale_dir
;
...
...
Jehan
@Jehan
mentioned in commit
f5d2c536
·
Jan 24, 2023
mentioned in commit
f5d2c536
mentioned in commit f5d2c5369c51a757b633c6d076302714d7403c3b
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment