GnuCashew ~ GnuCash Enabled Web
GCW
Gui
LanguagePicker.cpp
Go to the documentation of this file.
1
2
#include <Wt/WApplication.h>
3
4
#include "
LanguagePicker.h
"
5
6
namespace
{
7
8
/*
9
** These are language-picker items used in the combo-box
10
** language selector in the top of the site menu bar.
11
** Each 'lauguage' requires a corresponding gcw_lang.xml
12
** file that contains all of the translated strings.
13
**
14
*/
15
std::vector< std::vector< std::string > > langItems =
16
{
17
{
"en"
,
"English"
},
18
{
"en_cb"
,
"Cowboy"
},
19
{
"nl"
,
"Netherlands"
},
20
};
21
22
}
// endnamespace {
23
24
GCW::Gui::LanguagePicker::
25
LanguagePicker
()
26
{
27
/*
28
** Load the language choices in the combo box
29
**
30
*/
31
for
(
auto
& item : langItems )
32
addItem( item.at(1) );
33
34
/*
35
** when activated, change the language
36
**
37
*/
38
activated().connect( [&](
int
_selection )
39
{
40
wApp-> setLocale( langItems.at( _selection ).at(0) );
41
});
42
43
}
// endLanguagePicker()
44
45
46
LanguagePicker.h
GCW::Gui::LanguagePicker::LanguagePicker
LanguagePicker()
Definition:
LanguagePicker.cpp:25
Generated on Fri Mar 7 2025 11:49:33 for GnuCashew ~ GnuCash Enabled Web by
1.9.1