i18n: Configurable locale dir
This commit is contained in:
parent
b733d29814
commit
875f8496f3
|
@ -45,7 +45,6 @@
|
||||||
#include "toolbar.h"
|
#include "toolbar.h"
|
||||||
|
|
||||||
#define GETTEXT_PACKAGE "gladish"
|
#define GETTEXT_PACKAGE "gladish"
|
||||||
#define PACKAGE_LOCALE_DIR "/usr/share/locale"
|
|
||||||
|
|
||||||
#define ENABLE_NLS 1
|
#define ENABLE_NLS 1
|
||||||
|
|
||||||
|
@ -84,8 +83,8 @@ void arrange(void)
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_NLS
|
#if ENABLE_NLS
|
||||||
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
|
bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
textdomain (GETTEXT_PACKAGE);
|
textdomain (GETTEXT_PACKAGE);
|
||||||
#endif
|
#endif
|
||||||
|
|
4
wscript
4
wscript
|
@ -220,9 +220,11 @@ def configure(conf):
|
||||||
add_linkflag(conf, '-g')
|
add_linkflag(conf, '-g')
|
||||||
|
|
||||||
conf.env['DATA_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', APPNAME))
|
conf.env['DATA_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', APPNAME))
|
||||||
|
conf.env['LOCALE_DIR'] = os.path.normpath(os.path.join(conf.env['PREFIX'], 'share', 'locale'))
|
||||||
|
|
||||||
# write some parts of the configure environment to the config.h file
|
# write some parts of the configure environment to the config.h file
|
||||||
conf.define('DATA_DIR', conf.env['DATA_DIR'])
|
conf.define('DATA_DIR', conf.env['DATA_DIR'])
|
||||||
|
conf.define('LOCALE_DIR', conf.env['LOCALE_DIR'])
|
||||||
conf.define('PACKAGE_VERSION', VERSION)
|
conf.define('PACKAGE_VERSION', VERSION)
|
||||||
conf.define('DBUS_NAME_BASE', DBUS_NAME_BASE)
|
conf.define('DBUS_NAME_BASE', DBUS_NAME_BASE)
|
||||||
conf.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE.replace('.', '/'))
|
conf.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE.replace('.', '/'))
|
||||||
|
@ -597,7 +599,7 @@ def build(bld):
|
||||||
if item[1] == "po":
|
if item[1] == "po":
|
||||||
pprint('CYAN', "Preparing translation '"+item[0]+"'")
|
pprint('CYAN', "Preparing translation '"+item[0]+"'")
|
||||||
os.system("msgfmt ./po/"+po_list_item+" -o ./po/"+item[0]+".mo")
|
os.system("msgfmt ./po/"+po_list_item+" -o ./po/"+item[0]+".mo")
|
||||||
bld.install_as(('${PREFIX}/share/locale/'+item[0]+'/LC_MESSAGES/gladish.mo'), ('./po/'+item[0]+".mo"))
|
bld.install_as(('${LOCALE_DIR}/'+item[0]+'/LC_MESSAGES/gladish.mo'), ('./po/'+item[0]+".mo"))
|
||||||
|
|
||||||
def get_tags_dirs():
|
def get_tags_dirs():
|
||||||
source_root = os.path.dirname(Utils.g_module.root_path)
|
source_root = os.path.dirname(Utils.g_module.root_path)
|
||||||
|
|
Loading…
Reference in New Issue