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

Delta Between Two Patch Sets: installer/src/installer-lib/custom-i18n.h

Issue 5219280069066752: Issue #1186 - Change names that appear in the custom action (Closed)
Left Patch Set: Created Oct. 15, 2014, 3:29 p.m.
Right Patch Set: Created Jan. 4, 2015, 7 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « installer/src/installer-lib/DLL.cpp ('k') | installer/src/installer-lib/database.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /** 1 /**
2 * \file custom-i18n.h 2 * \file custom-i18n.h
3 */ 3 */
4 4
5 #ifndef CUSTOM_I18N_H 5 #ifndef CUSTOM_I18N_H
6 #define CUSTOM_I18N_H 6 #define CUSTOM_I18N_H
7 7
8 #include <database.h> 8 #include <database.h>
9 9
10 //------------------------------------------------------- 10 //-------------------------------------------------------
11 // Message box text 11 // Message box text
12 //------------------------------------------------------- 12 //-------------------------------------------------------
13 /** 13 /**
14 * Accessor to localizable content for custom actions. 14 * Accessor to localizable content for custom actions.
15 * 15 *
16 * This class requires that the MSI contain a custom table named "AbpUIText" in the MSI database. 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". 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. 18 * Each custom action has the responsibility for defining its own rows within th is table.
19 */ 19 */
20 class CustomMessageText 20 class CustomMessageText
21 { 21 {
22 Database & db ; 22 Database & db ;
23 const std::wstring component ; 23 const std::wstring component ;
24 24
25 public: 25 public:
26 CustomMessageText( Database & db, const std::wstring component ) 26 CustomMessageText( Database & db, const std::wstring component )
27 : db( db ), component( component ) 27 : db( db ), component( component )
28 {} 28 {}
29 29
30 std::wstring text( const std::wstring id ) 30 std::wstring Text( const std::wstring id )
31 { 31 {
32 try { 32 try {
33 View v( db, L"SELECT `content` FROM `AbpUIText` WHERE `component`=? and `i d`=?" ) ; 33 View v( db, L"SELECT `content` FROM `AbpUIText` WHERE `component`=? and `i d`=?" ) ;
34 Record arg( 2 ) ; 34 Record arg( 2 ) ;
35 arg.assign_string( 1, component ) ; 35 arg.assign_string( 1, component ) ;
36 arg.assign_string( 2, id.c_str() ) ; 36 arg.assign_string( 2, id.c_str() ) ;
37 Record r( v.first( arg ) ) ; 37 Record r( v.first( arg ) ) ;
38 return r.value_string( 1 ) ; 38 return r.value_string( 1 ) ;
39 } 39 }
40 catch( ... ) 40 catch( ... )
41 { 41 {
42 return L" " ; 42 return L" " ;
43 } 43 }
44 } 44 }
45 } ; 45 } ;
46 46
47 #endif 47 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld