view locale/GNUmakefile @ 6593:e70e2789bc2c

issue2551189 - increase text search maxlength This removes I think all the magic references to 25 and 30 (varchar size) and replaces them with references to maxlength or maxlength+5. I am not sure why the db column is 5 characters larger than the size of what should be the max size of a word, but I'll keep the buffer of 5 as making it 1/5 the size of maxlength makes less sense. Also added tests for fts search in templating which were missing. Added postgres, mysql and sqlite native indexing backends in which to test fts. Added fts test to native-fts as well to make sure it's working. I want to commit this now for CI. Todo: add test cases for the use of FTS in the csv output in actions.py. There is no test coverage of the match case there. change maxlength to a higher value (50) as requested in the ticket. Modify existing extremewords test cases to allow words > 25 and < 51 write code to migrate column sizes for mysql and postgresql to match maxlength I will roll this into the version 7 schema update that supports use of database fts support.
author John Rouillard <rouilj@ieee.org>
date Tue, 25 Jan 2022 13:22:00 -0500
parents 9730eff21de3
children b6452b669720
line wrap: on
line source

# Extract translatable strings from Roundup sources,
# update and compile all existing translations

# tool locations
XPOT ?= xpot
MSGFMT ?= msgfmt
MSGMERGE ?= msgmerge
XGETTEXT ?= xgettext
PYTHON ?= python

TEMPLATE=roundup.pot

PACKAGES=$(shell find ../roundup ../share/roundup/templates -name '*.py' \
	 | sed -e 's,/[^/]*$$,,' | sort | uniq)
SOURCES=$(PACKAGES:=/*.py)
PO_FILES=$(wildcard *.po)
MO_FILES=$(PO_FILES:.po=.mo)
PYTHON_BUILD=../build/lib
RUN_PYTHON=PYTHONPATH=$(PYTHON_BUILD) $(PYTHON) -O

all: dist

help:
	@echo "$(MAKE)           - build MO files.  Run this before sdist"
	@echo "$(MAKE) template  - update message template from sources"
	@echo "$(MAKE) locale.po - update message file from template"
	@echo "$(MAKE) locale.mo - compile individual message file"
	@echo "$(MAKE) help      - this text"\

# This will rebuild all MO files without updating their corresponding PO
# files first.  Run before creating Roundup distribution (hence the name).
# PO files should be updated by their translators only, automatic update
# adds unwanted fuzzy labels.
dist:
	for file in $(PO_FILES); do \
	  ${MSGFMT} -o `basename $$file .po`.mo $$file; \
	done

template:
	test -d $(PYTHON_BUILD) || (echo "Missing build directory. ln -s lib to build library"; exit 1)
	${XPOT} -n -o $(TEMPLATE) $(SOURCES)

	${RUN_PYTHON} ../roundup/cgi/TAL/talgettext.py -u $(TEMPLATE) \
	  ../share/roundup/templates/classic/html/*.html \
	  ../share/roundup/templates/devel/html/*.html \
	  ../share/roundup/templates/minimal/html/*.html \
	  ../share/roundup/templates/responsive/html/*.html
	${XGETTEXT} -j -w 80 -F \
	  --msgid-bugs-address=roundup-devel@lists.sourceforge.net \
	  --copyright-holder="See Roundup README.txt" \
	  -o $(TEMPLATE) $(SOURCES)

local_install: dist
	for file in $(MO_FILES); do \
	   lang=`basename $$file .mo`; \
	   mkdir -p locale/$$lang/LC_MESSAGES; \
	   cp $$file locale/$$lang/LC_MESSAGES/roundup.mo; \
	done

# helps to check template file before check in
diff:
	svn diff roundup.pot|grep -v '^[-+]#'|vim -Rv -

%.po: $(TEMPLATE)
	${MSGMERGE} -U --suffix=.bak $@ $<

%.mo: %.po
	${MSGFMT} --statistics -o $@ $<

Roundup Issue Tracker: http://roundup-tracker.org/