161 : m_app_name {app_name}
162{
163 #ifdef ENABLE_BINRELOC
164 {
165 GError *binreloc_error = NULL;
166 if (!gnc_gbr_init(&binreloc_error))
167 {
168 std::cerr << "main: Error on gnc_gbr_init: " << binreloc_error->message << "\n";
169 g_error_free(binreloc_error);
170 }
171 }
172 #endif
173
174
175
176
177
179 #if defined MAC_INTEGRATION || defined __MINGW32__
180 sys_locale = set_platform_locale();
181 #endif
182 #if ! defined MAC_INTEGRATION && ! defined __MINGW32__
183 sys_locale = g_strdup (setlocale (LC_ALL, ""));
184 if (!sys_locale)
185 {
186 std::cerr << "The locale defined in the environment isn't supported. "
187 << "Falling back to the 'C' (US English) locale\n";
188 g_setenv ("LC_ALL", "C", TRUE);
189 setlocale (LC_ALL, "C");
190 }
191 #endif
192
193 auto localedir = gnc_path_get_localedir ();
194 bindtextdomain(PROJECT_NAME, localedir);
195 bindtextdomain("iso_4217", localedir);
196 bind_textdomain_codeset("iso_4217", "UTF-8");
197 textdomain(PROJECT_NAME);
198 bind_textdomain_codeset(PROJECT_NAME, "UTF-8");
199
200 gnc_init_boost_locale (localedir);
201 std::cerr.imbue (gnc_get_boost_locale());
202 std::cout.imbue (gnc_get_boost_locale());
203 g_free(localedir);
204
205
206 m_tagline =
_(
"- GnuCash, accounting for personal and small business finance");
207 m_opt_desc_display = std::make_unique<bpo::options_description>
208 ((bl::format (std::string{
_(
"{1} [options] [datafile]")}) % m_app_name).str() + std::string(
" ") + m_tagline);
209 add_common_program_options();
210}
void gnc_environment_setup(void)
Parse <prefix>/etc/gnucash/environment and set environment variables based on the contents of that fi...