Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: installer/src/installer-lib/custom-i18n.h

Issue 6202981292703744: Whole installer (Closed)
Patch Set: Created June 24, 2014, 7:27 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: installer/src/installer-lib/custom-i18n.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/installer/src/installer-lib/custom-i18n.h
@@ -0,0 +1,47 @@
+/**
+ * \file custom-i18n.h
+ */
+
+#ifndef CUSTOM_I18N_H
+#define CUSTOM_I18N_H
+
+#include <database.h>
+
+//-------------------------------------------------------
+// Message box text
+//-------------------------------------------------------
+/**
+ * Accessor to localizable content for custom actions.
+ *
+ * This class requires that the MSI contain a custom table named "AbpUIText" in the MSI database.
+ * The WiX definition of that table is in the file "custom_i18n.wxi".
+ * Each custom action has the responsibility for defining its own rows within this table.
+ */
+class custom_message_text
+{
+ Database & db ;
+ const std::wstring component ;
+
+public:
+ custom_message_text( Database & db, const std::wstring component )
+ : db( db ), component( component )
+ {}
+
+ std::wstring text( const std::wstring id )
+ {
+ try {
+ View v( db, L"SELECT `content` FROM `AbpUIText` WHERE `component`=? and `id`=?" ) ;
+ Record arg( 2 ) ;
+ arg.assign_string( 1, component ) ;
+ arg.assign_string( 2, id.c_str() ) ;
+ Record r( v.first( arg ) ) ;
+ return r.value_string( 1 ) ;
+ }
+ catch( ... )
+ {
+ return L" " ;
+ }
+ }
+} ;
+
+#endif

Powered by Google App Engine
This is Rietveld