summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2012-10-12 21:38:07 -0400
committerPaul W. Frields <stickster@gmail.com>2012-10-12 22:39:07 -0400
commit8c78322e606d724359f73a52ff4a2483f4ea80f8 (patch)
treeb507ba235b885080c90a921bbeb76d8c8f56b694
parent2d54d3bcea15836ff5af500d0670aa5fd958ef09 (diff)
downloadpulsecaster-8c78322e606d724359f73a52ff4a2483f4ea80f8.tar.gz
pulsecaster-8c78322e606d724359f73a52ff4a2483f4ea80f8.tar.xz
pulsecaster-8c78322e606d724359f73a52ff4a2483f4ea80f8.zip
Create some Makefile fluff for easier releases
-rw-r--r--Makefile37
-rw-r--r--setup.cfg13
-rw-r--r--setup.py5
3 files changed, 54 insertions, 1 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2a80e62
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+ifndef LANGUAGES
+LANGUAGES := $(shell ls po/*.po | sed 's/po\/\(.*\).po/\1/')
+endif
+
+DOMAIN = pulsecaster
+
+PO_FILES = $(wildcard po/*.po)
+MO_FILES = $(PO_FILES:.po=.mo)
+
+PYTHON = $(shell which python)
+TX = $(shell which tx)
+PWD = $(shell pwd)
+
+.PHONY: all mo po clean
+
+all: mo
+ @echo -n
+
+mo: $(foreach L,$(LANGUAGES),po/$(L).mo)
+
+define MO_template =
+po/$(1).mo: po/$(1).po
+ mkdir -p locale/$(1)/LC_MESSAGES && $(PYTHON) setup.py compile_catalog -l $(1) -i po/$(1).po -o po/$(1).mo -D $(DOMAIN) >/dev/null
+endef
+$(foreach L,$(LANGUAGES),$(eval $(call MO_template,$(L))))
+
+po: $(foreach L,$(LANGUAGES),po/$(L).po)
+
+define PO_template =
+po/$(1).po: po/$(DOMAIN).pot
+ $(PYTHON) setup.py update_catalog -l $(1) -i po/$(DOMAIN).pot -o po/$(1).po -D $(DOMAIN) >/dev/null
+endef
+$(foreach L,$(LANGUAGES),$(eval $(call PO_template,$(L))))
+
+
+clean:
+ rm -rf po/*.mo
diff --git a/setup.cfg b/setup.cfg
index 3bdc0f1..7b19b20 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,16 @@
[extract_messages]
output_file = po/pulsecaster.pot
copyright_holder = Paul W. Frields
+msgid_bugs_address = stickster@gmail.com
+keywords = _ N_
+
+[init_catalog]
+input_file = po/pulsecaster.pot
+domain = pulsecaster
+
+[compile_catalog]
+domain = pulsecaster
+
+[update_catalog]
+input_file = po/pulsecaster.pot
+domain = pulsecaster
diff --git a/setup.py b/setup.py
index 184292f..b5aac42 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2009, 2010 Paul W. Frields and others.
+# Copyright (C) 2009, 2010, 2012 Paul W. Frields and others.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -48,5 +48,8 @@ setup(
'pulsecaster': [('**.py', 'python', None),
],
},
+ package_data={
+ 'pulsecaster': ['po/*.mo'],
+ },
packages = find_packages(),
)