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

Side by Side Diff: installer/src/installer-lib/custom-i18n.h

Issue 5675960980471808: Updated installer with custom action (Closed)
Patch Set: Created March 8, 2014, 5:06 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /**
2 * \file custom-i18n.h
3 */
4
5 #ifndef CUSTOM_I18N_H
6 #define CUSTOM_I18N_H
7
8 #include <database.h>
9
10 //-------------------------------------------------------
11 // Message box text
12 //-------------------------------------------------------
13 /**
14 * Accessor to localizable content for custom actions.
15 *
16 * This class requires that the MSI contain a custom table named "AbpUIText" in the MSI database.
17 * The WiX definition of that table is in the file "custom_i18n.wxi".
18 * Each custom action has the responsibility for defining its own rows within th is table.
19 */
20 class custom_message_text
21 {
22 Database & db ;
23 const std::wstring component ;
24
25 public:
26 custom_message_text( Database & db, const std::wstring component )
27 : db( db ), component( component )
28 {}
29
30 std::wstring text( const std::wstring id )
31 {
32 try {
33 View v( db, L"SELECT `content` FROM `AbpUIText` WHERE `component`=? and `i d`=?" ) ;
34 Record arg( 2 ) ;
35 arg.assign_string( 1, component ) ;
36 arg.assign_string( 2, id.c_str() ) ;
37 Record r( v.first( arg ) ) ;
38 return r.value_string( 1 ) ;
39 }
40 catch( ... )
41 {
42 return L" " ;
43 }
44 }
45 } ;
46
47 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld