#define __FGLOCALE_HXX
#include <string>
+#include <cstdarg> // for va_start/_end
#include <simgear/props/props.hxx>
*/
const char* getDefaultFont (const char* fallbackFont);
+ /**
+ * Obtain a message string, from a localized resource ID, and use it as
+ * a printf format string.
+ */
+ std::string localizedPrintf(const char* id, const char* resource, ... );
+
+ std::string vlocalizedPrintf(const char* id, const char* resource, va_list args);
+
/**
* Simple UTF8 to Latin1 encoder.
*/
static void utf8toLatin1 (std::string& s);
- /**
- * Obtain user's default language setting.
- */
- const char* getUserLanguage();
+
protected:
/**
*/
simgear::PropertyList getLocalizedStrings(SGPropertyNode *localeNode, const char* id, const char* context);
+ /**
+ * Obtain user's default language setting.
+ */
+ string_list getUserLanguage();
+
SGPropertyNode_ptr _intl;
SGPropertyNode_ptr _currentLocale;
SGPropertyNode_ptr _defaultLocale;
};
+// global translation wrappers
+
+const char* fgTrMsg(const char* key);
+std::string fgTrPrintfMsg(const char* key, ...);
+
+
#endif // __FGLOCALE_HXX