// // Fluid Project Internationalization header for the Fast Light Tool Kit (FLTK). // // Copyright 2025 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // // https://www.fltk.org/COPYING.php // // Please see the following page on how to report bugs and issues: // // https://www.fltk.org/bugs.php // #ifndef FLUID_PROJ_I18N_H #define FLUID_PROJ_I18N_H #include #include #include class Project; /** Enumeration of available internationalization types. */ typedef int I18n_Type; enum { FLD_I18N_TYPE_NONE = 0, ///< No i18n, all strings are litearals FLD_I18N_TYPE_GNU, ///< GNU gettext internationalization FLD_I18N_TYPE_POSIX ///< Posix catgets internationalization }; class Project_Reader; class Project_Writer; /** Data and settings for a FLUID project file. */ class I18n { public: Project &project_; /// One of the available internationalization types. I18n_Type type; /// Include file for GNU i18n, writes an #include statement into the source /// file. This is usually `` or `"gettext.h"` for GNU gettext. char *gnu_include; // Optional name of a macro for conditional i18n compilation. char *gnu_conditional; /// For the gettext/intl.h options, this is the function that translates text /// at runtime. This is usually "gettext" or "_". char *gnu_function; /// For the gettext/intl.h options, this is the function that marks the translation /// of text at initialisation time. This is usually "gettext_noop" or "N_". char *gnu_static_function; /// Include file for Posix i18n, write a #include statement into the source /// file. This is usually `` for Posix catgets. char *posix_include; // Optional name of a macro for conditional i18n compilation. char *posix_conditional; /// Name of the nl_catd database char *posix_file; /// Message set ID for the catalog. char *posix_set; public: // Methods I18n(Project &p); ~I18n(); void reset(); void read(Project_Reader &f, const char *key); void write(Project_Writer &f) const; void set_gnu_include(const char *s); void set_gnu_conditional(const char *s); void set_gnu_function(const char *s); void set_gnu_static_function(const char *s); void set_posix_include(const char *s); void set_posix_conditional(const char *s); void set_posix_file(const char *s); void set_posix_set(const char *s); }; #endif // FLUID_PROJ_I18N_H