new po location: po/LANG.po
This commit is contained in:
parent
51836690a8
commit
7a8cdad04c
10
Makefile
10
Makefile
|
@ -46,10 +46,9 @@ distclean: clean
|
|||
clean:
|
||||
find . -name '*.pyc' -exec rm {} \;
|
||||
find . -name '*.pyo' -exec rm {} \;
|
||||
find . -name '*.mo' -exec rm {} \;
|
||||
rm -f gajim.desktop \;
|
||||
${MAKE} -C po clean
|
||||
rm -f gajim.desktop
|
||||
$(foreach sdir, $(MODULES), ${MAKE} -C $(sdir) clean;)
|
||||
|
||||
dist:
|
||||
rm -rf gajim-$(VERSION)
|
||||
mkdir gajim-$(VERSION)
|
||||
|
@ -88,10 +87,7 @@ install:
|
|||
mkdir -p "$(DESTDIR)$(PREFIX)/share/locale/$$d"; \
|
||||
fi; \
|
||||
done
|
||||
for f in $(FILES_PO) ; do \
|
||||
DST=`dirname "$$f"`; \
|
||||
cp "./po/$$f" "$(DESTDIR)$(PREFIX)/share/locale/$$DST/"; \
|
||||
done
|
||||
${MAKE} -C po install PREFIX=$(PREFIX)
|
||||
cp COPYING "$(DESTDIR)$(PREFIX)/share/gajim/";
|
||||
cp THANKS "$(DESTDIR)$(PREFIX)/share/gajim/";
|
||||
mkdir -p "$(DESTDIR)$(PREFIX)/share/pixmaps";
|
||||
|
|
18
po/Makefile
18
po/Makefile
|
@ -1,9 +1,10 @@
|
|||
top_srcdir = ../src/
|
||||
NAME = gajim
|
||||
LANGS := fr pt el pl es ru bg de nb cs nl pt_BR sv it eu sk no zh_CN
|
||||
LANGDIR := $(foreach LANG, $(LANGS),$(LANG)/LC_MESSAGES/gajim.mo)
|
||||
LANGS_PO:=$(foreach LANG, ${LANGS}, ${LANG}.po)
|
||||
LANGS_MO:=$(foreach LANG, ${LANGS}, ${LANG}.mo)
|
||||
DATADIR:=$(subst //,/,${DESTDIR}/${PREFIX}/share)
|
||||
|
||||
all: $(LANGDIR)
|
||||
all: $(LANGS_MO)
|
||||
|
||||
%.mo: %.po
|
||||
msgfmt $< -o $@
|
||||
|
@ -52,5 +53,14 @@ gajim.pot: ../src/*py ../src/common/*py \
|
|||
../data/glade/xml_console_window.glade.h
|
||||
intltool-update --pot --gettext-package=$(NAME)
|
||||
|
||||
install:
|
||||
for l in ${LANGS}; do\
|
||||
dir=${DATADIR}/locale/$${l}/LC_MESSAGES;\
|
||||
if test ! -d $${dir}; then\
|
||||
install -m 755 -d $${dir};\
|
||||
fi;\
|
||||
install -m 644 $${l}.mo $${dir}/${NAME}.mo;\
|
||||
done
|
||||
|
||||
clean:
|
||||
find . -name '*.mo' -exec rm {} \;
|
||||
rm *.mo
|
||||
|
|
|
@ -10,25 +10,19 @@ import sys
|
|||
stats = False
|
||||
update = False
|
||||
check = False
|
||||
path_to_dir = '../../po'
|
||||
|
||||
def visit(arg, dirname, names):
|
||||
if dirname.find('.svn') != -1:
|
||||
return
|
||||
if dirname.endswith('LC_MESSAGES'):
|
||||
if 'gajim.po' in names:
|
||||
path_to_po = os.path.join(dirname, 'gajim.po')
|
||||
pos = path_to_po.find('po/') + 3 #3 = len('po/')
|
||||
endpos = path_to_po.find('/', pos)
|
||||
name = path_to_po[pos:endpos]
|
||||
def visit(files):
|
||||
for file in files:
|
||||
if file.endswith('.po'):
|
||||
path_to_po = os.path.join(path_to_dir, file)
|
||||
if update: # update an existing po file)
|
||||
os.system('msgmerge -q -U ../../po/'+name+'/LC_MESSAGES/gajim.po ../../po/gajim.pot')
|
||||
os.system('msgmerge -q -U %s %s' % (path_to_po, os.path.join(path_to_dir, 'gajim.pot')))
|
||||
if stats:
|
||||
print name, 'has now:'
|
||||
print file[:-3], 'has now:'
|
||||
os.system('msgfmt --statistics ' + path_to_po)
|
||||
if check:
|
||||
os.system('msgfmt -c ' + path_to_po)
|
||||
else:
|
||||
print 'PROBLEM: cannot find gajim.po in', dirname
|
||||
|
||||
def show_help():
|
||||
print sys.argv[0], '[help] [stats] [update] [check]'
|
||||
|
@ -52,6 +46,7 @@ if __name__ == '__main__':
|
|||
|
||||
path_to_dir = '../../po'
|
||||
|
||||
files = os.listdir(path_to_dir)
|
||||
if len(sys.argv) == 2:
|
||||
if sys.argv[1].startswith('h'):
|
||||
show_help()
|
||||
|
@ -59,21 +54,21 @@ if __name__ == '__main__':
|
|||
param = sys.argv[1]
|
||||
if param == 'stats': # stats only
|
||||
stats = True
|
||||
os.path.walk(path_to_dir, visit, None)
|
||||
visit(files)
|
||||
elif param == 'update': # update only
|
||||
update_pot()
|
||||
update = True
|
||||
os.path.walk(path_to_dir, visit, None) # update each po & no stats
|
||||
visit(files)
|
||||
print 'Done'
|
||||
elif param == 'check':
|
||||
check = True
|
||||
os.path.walk(path_to_dir, visit, None)
|
||||
visit(files)
|
||||
|
||||
elif len(sys.argv) == 1: # update & stats & no check
|
||||
update_pot()
|
||||
update = True
|
||||
stats = True
|
||||
os.path.walk(path_to_dir, visit, None)
|
||||
visit(files)
|
||||
print 'Done'
|
||||
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue