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 #ifdef __MINGW32__
183 set_platform_ctype_to_acp();
184 #endif
185 #if ! defined MAC_INTEGRATION && ! defined __MINGW32__
186 sys_locale = g_strdup (setlocale (LC_ALL, ""));
187 if (!sys_locale)
188 {
189 std::cerr << "The locale defined in the environment isn't supported. "
190 << "Falling back to the 'C' (US English) locale\n";
191 g_setenv ("LC_ALL", "C", TRUE);
192 setlocale (LC_ALL, "C");
193 }
194 #endif
195
196 auto localedir = gnc_path_get_localedir ();
197 bindtextdomain(PROJECT_NAME, localedir);
198 bindtextdomain("iso_4217", localedir);
199 bind_textdomain_codeset("iso_4217", "UTF-8");
200 textdomain(PROJECT_NAME);
201 bind_textdomain_codeset(PROJECT_NAME, "UTF-8");
202
203 gnc_init_boost_locale (localedir);
204 std::cerr.imbue (gnc_get_boost_locale());
205 std::cout.imbue (gnc_get_boost_locale());
206 g_free(localedir);
207
208
209 m_tagline =
_(
"- GnuCash, accounting for personal and small business finance");
210 m_opt_desc_display = std::make_unique<bpo::options_description>
211 ((bl::format (std::string{
_(
"{1} [options] [datafile]")}) % m_app_name).str() + std::string(
" ") + m_tagline);
212 add_common_program_options();
213}
void gnc_environment_setup(void)
Parse <prefix>/etc/gnucash/environment and set environment variables based on the contents of that fi...