Forecasts: make translation works again

NLS was probably broken since the switch to meson,

this commit fix 2 issues:
 * config.h was not readed at all, renamed to forecasts_config.g and included
 * meson install po files in system dir, not in E modules dir like it was before
master
Davide Andreoli 2 years ago
parent d7cc4d05aa
commit 1a2f682b28
  1. 6
      meson.build
  2. 5
      src/e_mod_main.c
  3. 2
      src/e_mod_main.h
  4. 1
      src/meson.build

@ -21,9 +21,13 @@ edje_cmd = find_program('edje_cc')
install_mod_dir = join_paths(dir_module_e, meson.project_name())
install_dir = join_paths(install_mod_dir, module_arch)
locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
config_data = configuration_data()
config_data.set_quoted('PACKAGE', meson.project_name())
config_data.set_quoted('MODULE_DIR', install_dir)
config_data.set_quoted('LOCALE_DIR', locale_dir)
config_dir = include_directories('.')
use_translations = false
intl_lib = cc.find_library('intl', required: false)
@ -47,7 +51,7 @@ endif
subdir('src')
configure_file(output: 'config.h', install: false, configuration: config_data)
configure_file(output: 'forecast_config.h', install: false, configuration: config_data)
install_data('module.desktop', install_dir : install_mod_dir)

@ -392,10 +392,7 @@ EAPI E_Module_Api e_modapi = {
EAPI void *
e_modapi_init(E_Module *m)
{
char buf[4095];
snprintf(buf, sizeof(buf), "%s/locale", e_module_dir_get(m));
bindtextdomain(PACKAGE, buf);
bindtextdomain(PACKAGE, LOCALE_DIR);
bind_textdomain_codeset(PACKAGE, "UTF-8");
conf_item_edd = E_CONFIG_DD_NEW("Forecasts_Config_Item", Config_Item);

@ -1,6 +1,8 @@
#ifndef E_MOD_MAIN_H
#define E_MOD_MAIN_H
#include "forecast_config.h"
#ifdef ENABLE_NLS
# include <libintl.h>
# define D_(string) dgettext(PACKAGE, string)

@ -5,6 +5,7 @@ module = shared_module('module',
'e_mod_main.c', 'e_mod_config.c',
dependencies : [e, json],
install_dir: install_dir,
include_directories: config_dir,
install: true,
name_prefix: '',
link_args: '-Wl,--unresolved-symbols=ignore-in-object-files')

Loading…
Cancel
Save