i18n: Configurable locale dir

This commit is contained in:
Nikita Zlobin 2010-12-19 16:24:55 +05:00
parent b733d29814
commit 875f8496f3
2 changed files with 5 additions and 4 deletions

View File

@ -45,7 +45,6 @@
#include "toolbar.h"
#define GETTEXT_PACKAGE "gladish"
#define PACKAGE_LOCALE_DIR "/usr/share/locale"
#define ENABLE_NLS 1
@ -84,8 +83,8 @@ void arrange(void)
int main(int argc, char** argv)
{
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
#if ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif

View File

@ -220,9 +220,11 @@ def configure(conf):
add_linkflag(conf, '-g')
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
conf.define('DATA_DIR', conf.env['DATA_DIR'])
conf.define('LOCALE_DIR', conf.env['LOCALE_DIR'])
conf.define('PACKAGE_VERSION', VERSION)
conf.define('DBUS_NAME_BASE', DBUS_NAME_BASE)
conf.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE.replace('.', '/'))
@ -597,7 +599,7 @@ def build(bld):
if item[1] == "po":
pprint('CYAN', "Preparing translation '"+item[0]+"'")
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():
source_root = os.path.dirname(Utils.g_module.root_path)