diff options
| author | Greg Ercolano <erco@seriss.com> | 2020-07-11 14:46:34 -0700 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-14 12:52:56 +0200 |
| commit | 7426e762a45eb722f605ed6640a21f569ee585af (patch) | |
| tree | 7e3465bfd8daff332f96717a422a20da5314c07c /test | |
| parent | 4471166f59499e011477a68c65141adf802d8cf4 (diff) | |
setlocale() added to Fl_File_Chooser demos
This change ensures errors in local language.
See issue #99 for discussion on why this is needed.
Diffstat (limited to 'test')
| -rw-r--r-- | test/file_chooser.cxx | 2 | ||||
| -rw-r--r-- | test/pixmap_browser.cxx | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx index 83b75bab9..2d72c7f6b 100644 --- a/test/file_chooser.cxx +++ b/test/file_chooser.cxx @@ -39,6 +39,7 @@ #include <FL/Fl_Double_Window.H> #include <FL/Fl_Simple_Terminal.H> #include <string.h> +#include <locale.h> // setlocale().. #define TERMINAL_HEIGHT 120 #define TERMINAL_GREEN "\033[32m" @@ -92,6 +93,7 @@ main(int argc, // I - Number of command-line arguments // Make the file chooser... + setlocale(LC_ALL, ""); // enable multilanguage errors in file chooser Fl::scheme(NULL); Fl_File_Icon::load_system_icons(); diff --git a/test/pixmap_browser.cxx b/test/pixmap_browser.cxx index 4a80f3579..f625e585f 100644 --- a/test/pixmap_browser.cxx +++ b/test/pixmap_browser.cxx @@ -23,10 +23,12 @@ #include <FL/Fl_Printer.H> #include <string.h> #include <errno.h> +#include <locale.h> // setlocale().. #include <FL/Fl_File_Chooser.H> #include <FL/fl_message.H> #include <FL/Fl_SVG_File_Surface.H> #include <FL/Fl_Native_File_Chooser.H> + Fl_Box *b; Fl_Double_Window *w; Fl_Shared_Image *img; @@ -124,6 +126,7 @@ int arg(int, char **argv, int &i) { int main(int argc, char **argv) { int i = 1; + setlocale(LC_ALL, ""); // enable multilanguage errors in file chooser fl_register_images(); Fl::args(argc,argv,i,arg); |
