-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Really fix gettext on Android (#1306)
* Fix the gettext Android patch Writing stupid patches in a hurry at 3AM is generally not a great idea ;p. * Really fix it. * Duh, we need a shell for the shell redirection to work.
- Loading branch information
Showing
2 changed files
with
22 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
diff -NuarpZ gettext-0.21-ori/libtextstyle/lib/glib/gstrfuncs.c gettext-0.21/libtextstyle/lib/glib/gstrfuncs.c | ||
--- gettext-0.21-ori/libtextstyle/lib/glib/gstrfuncs.c 2020-04-11 12:01:49.000000000 +0200 | ||
+++ gettext-0.21/libtextstyle/lib/glib/gstrfuncs.c 2021-02-15 01:46:57.774772752 +0100 | ||
@@ -588,7 +588,11 @@ g_ascii_formatd (gchar *buffer, | ||
+++ gettext-0.21/libtextstyle/lib/glib/gstrfuncs.c 2021-02-15 16:10:30.130191728 +0100 | ||
@@ -555,9 +555,6 @@ g_ascii_formatd (gchar *buffer, | ||
const gchar *format, | ||
gdouble d) | ||
{ | ||
- struct lconv *locale_data; | ||
- const char *decimal_point; | ||
- int decimal_point_len; | ||
gchar *p; | ||
int rest_len; | ||
gchar format_char; | ||
@@ -587,9 +584,16 @@ g_ascii_formatd (gchar *buffer, | ||
|
||
_g_snprintf (buffer, buf_len, format, d); | ||
|
||
locale_data = localeconv (); | ||
+#if defined(__ANDROID__) && __ANDROID_API__ < 21 | ||
+ decimal_point = '.'; | ||
+ const char decimal_point[] = "."; | ||
+ int decimal_point_len = 1; | ||
+#else | ||
+ struct lconv *locale_data; | ||
+ const char *decimal_point; | ||
locale_data = localeconv (); | ||
decimal_point = locale_data->decimal_point; | ||
- decimal_point_len = strlen (decimal_point); | ||
+ int decimal_point_len = strlen (decimal_point); | ||
+#endif | ||
decimal_point_len = strlen (decimal_point); | ||
|
||
g_assert (decimal_point_len != 0); | ||
|