spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit abe298e9d0e0f8fad282cb0051c9a847f073db4f
parent 0563dd250bcd5d2adb36b8a517f6287fae0c48b6
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Sat,  5 Mar 2011 18:14:34 +0800

Use the language set in the config file

Diffstat:
Msrc/spek-preferences.vala | 13+++++++++++++
Msrc/spek.vala | 5+++++
2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/spek-preferences.vala b/src/spek-preferences.vala @@ -62,5 +62,18 @@ namespace Spek { key_file.set_integer ("update", "last_update", value); } } + + public string language { + owned get { + try { + return key_file.get_string ("general", "language"); + } catch (KeyFileError e) { + } + return ""; + } + set { + key_file.set_string ("general", "language", value); + } + } } } \ No newline at end of file diff --git a/src/spek.vala b/src/spek.vala @@ -30,6 +30,11 @@ namespace Spek { int main (string[] args) { Platform.fix_args (args); + var prefs = new Preferences (); + if (prefs.language.length > 0) { + Environment.set_variable ("LC_ALL", prefs.language, true); + } +// Intl.setlocale (LocaleCategory.ALL, prefs.language); Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALEDIR); Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8"); Intl.textdomain (Config.GETTEXT_PACKAGE);