new po location: po/LANG.po

This commit is contained in:
Yann Leboulanger 2006-05-10 19:20:16 +00:00
parent 51836690a8
commit 7a8cdad04c
21 changed files with 4848 additions and 28 deletions

View File

@ -46,10 +46,9 @@ distclean: clean
clean: clean:
find . -name '*.pyc' -exec rm {} \; find . -name '*.pyc' -exec rm {} \;
find . -name '*.pyo' -exec rm {} \; find . -name '*.pyo' -exec rm {} \;
find . -name '*.mo' -exec rm {} \; ${MAKE} -C po clean
rm -f gajim.desktop \; rm -f gajim.desktop
$(foreach sdir, $(MODULES), ${MAKE} -C $(sdir) clean;) $(foreach sdir, $(MODULES), ${MAKE} -C $(sdir) clean;)
dist: dist:
rm -rf gajim-$(VERSION) rm -rf gajim-$(VERSION)
mkdir gajim-$(VERSION) mkdir gajim-$(VERSION)
@ -88,10 +87,7 @@ install:
mkdir -p "$(DESTDIR)$(PREFIX)/share/locale/$$d"; \ mkdir -p "$(DESTDIR)$(PREFIX)/share/locale/$$d"; \
fi; \ fi; \
done done
for f in $(FILES_PO) ; do \ ${MAKE} -C po install PREFIX=$(PREFIX)
DST=`dirname "$$f"`; \
cp "./po/$$f" "$(DESTDIR)$(PREFIX)/share/locale/$$DST/"; \
done
cp COPYING "$(DESTDIR)$(PREFIX)/share/gajim/"; cp COPYING "$(DESTDIR)$(PREFIX)/share/gajim/";
cp THANKS "$(DESTDIR)$(PREFIX)/share/gajim/"; cp THANKS "$(DESTDIR)$(PREFIX)/share/gajim/";
mkdir -p "$(DESTDIR)$(PREFIX)/share/pixmaps"; mkdir -p "$(DESTDIR)$(PREFIX)/share/pixmaps";

View File

@ -1,9 +1,10 @@
top_srcdir = ../src/
NAME = gajim NAME = gajim
LANGS := fr pt el pl es ru bg de nb cs nl pt_BR sv it eu sk no zh_CN 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 %.mo: %.po
msgfmt $< -o $@ msgfmt $< -o $@
@ -52,5 +53,14 @@ gajim.pot: ../src/*py ../src/common/*py \
../data/glade/xml_console_window.glade.h ../data/glade/xml_console_window.glade.h
intltool-update --pot --gettext-package=$(NAME) 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: clean:
find . -name '*.mo' -exec rm {} \; rm *.mo

4819
po/fr.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -10,25 +10,19 @@ import sys
stats = False stats = False
update = False update = False
check = False check = False
path_to_dir = '../../po'
def visit(arg, dirname, names): def visit(files):
if dirname.find('.svn') != -1: for file in files:
return if file.endswith('.po'):
if dirname.endswith('LC_MESSAGES'): path_to_po = os.path.join(path_to_dir, file)
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]
if update: # update an existing po 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: if stats:
print name, 'has now:' print file[:-3], 'has now:'
os.system('msgfmt --statistics ' + path_to_po) os.system('msgfmt --statistics ' + path_to_po)
if check: if check:
os.system('msgfmt -c ' + path_to_po) os.system('msgfmt -c ' + path_to_po)
else:
print 'PROBLEM: cannot find gajim.po in', dirname
def show_help(): def show_help():
print sys.argv[0], '[help] [stats] [update] [check]' print sys.argv[0], '[help] [stats] [update] [check]'
@ -52,6 +46,7 @@ if __name__ == '__main__':
path_to_dir = '../../po' path_to_dir = '../../po'
files = os.listdir(path_to_dir)
if len(sys.argv) == 2: if len(sys.argv) == 2:
if sys.argv[1].startswith('h'): if sys.argv[1].startswith('h'):
show_help() show_help()
@ -59,21 +54,21 @@ if __name__ == '__main__':
param = sys.argv[1] param = sys.argv[1]
if param == 'stats': # stats only if param == 'stats': # stats only
stats = True stats = True
os.path.walk(path_to_dir, visit, None) visit(files)
elif param == 'update': # update only elif param == 'update': # update only
update_pot() update_pot()
update = True update = True
os.path.walk(path_to_dir, visit, None) # update each po & no stats visit(files)
print 'Done' print 'Done'
elif param == 'check': elif param == 'check':
check = True check = True
os.path.walk(path_to_dir, visit, None) visit(files)
elif len(sys.argv) == 1: # update & stats & no check elif len(sys.argv) == 1: # update & stats & no check
update_pot() update_pot()
update = True update = True
stats = True stats = True
os.path.walk(path_to_dir, visit, None) visit(files)
print 'Done' print 'Done'
else: else: