| OLD | NEW |
| 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 { |
| 34 Record arg( 2 ) ; | 34 View v(db, L"SELECT `content` FROM `AbpUIText` WHERE `component`=? and `id
`=?"); |
| 35 arg.AssignString( 1, component ) ; | 35 Record arg(2); |
| 36 arg.AssignString( 2, id.c_str() ) ; | 36 arg.AssignString(1, component); |
| 37 Record r( v.First( arg ) ) ; | 37 arg.AssignString(2, id.c_str()); |
| 38 return r.ValueString( 1 ) ; | 38 Record r(v.First(arg)); |
| 39 return r.ValueString(1); |
| 39 } | 40 } |
| 40 catch( ... ) | 41 catch (...) |
| 41 { | 42 { |
| 42 return L" " ; | 43 return L" "; |
| 43 } | 44 } |
| 44 } | 45 } |
| 45 } ; | 46 }; |
| 46 | 47 |
| 47 #endif | 48 #endif |
| OLD | NEW |