diff options
author | fiaxh <git@mx.ax.lt> | 2017-04-07 11:09:47 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-04-10 15:47:21 +0200 |
commit | 9bc83539d124f9645dc92e9e39001cb0192dae61 (patch) | |
tree | a4b22a8ea3e10b6d0050c2e5669729919a1cb477 /main/src/main.vala | |
parent | d8881c4b16a1cd376dd69304c44444aee581da32 (diff) | |
download | dino-9bc83539d124f9645dc92e9e39001cb0192dae61.tar.gz dino-9bc83539d124f9645dc92e9e39001cb0192dae61.zip |
Gettext support
Diffstat (limited to 'main/src/main.vala')
-rw-r--r-- | main/src/main.vala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/main/src/main.vala b/main/src/main.vala index 14029e47..e0d54d18 100644 --- a/main/src/main.vala +++ b/main/src/main.vala @@ -1,20 +1,28 @@ using Dino.Entities; using Dino.Ui; +extern const string GETTEXT_PACKAGE; +extern const string LOCALE_INSTALL_DIR; + namespace Dino { void main(string[] args) { + try{ string? exec_path = args.length > 0 ? args[0] : null; + SearchPathGenerator search_path_generator = new SearchPathGenerator(exec_path); if (exec_path != null && exec_path.contains(Path.DIR_SEPARATOR_S)) { string bindir = Path.get_dirname(exec_path); if (FileUtils.test(Path.build_filename(bindir, "gschemas.compiled"), FileTest.IS_REGULAR)) { Environment.set_variable("GSETTINGS_SCHEMA_DIR", Path.get_dirname(exec_path), false); } } + Intl.textdomain(GETTEXT_PACKAGE); + internationalize(GETTEXT_PACKAGE, search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR)); + Plugins.Loader loader = new Plugins.Loader(exec_path); Gtk.init(ref args); - Dino.Ui.Application app = new Dino.Ui.Application(); + Dino.Ui.Application app = new Dino.Ui.Application() { search_path_generator=search_path_generator }; app.add_main_option("plugin-paths", 0, 0, OptionArg.NONE, "Display plugin search paths and exit", null); app.handle_local_options.connect((options) => { |