Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
intl: more webui/javascript changes
  • Loading branch information
perexg committed Jun 18, 2015
1 parent 36f0721 commit 2b2cc88
Show file tree
Hide file tree
Showing 12 changed files with 9,702 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -22,7 +22,7 @@

include $(dir $(lastword $(MAKEFILE_LIST))).config.mk
PROG := $(BUILDDIR)/tvheadend
LANGUAGES ?= de cs pl
LANGUAGES ?= de fr cs pl

#
# Common compiler flags
Expand Down Expand Up @@ -572,6 +572,9 @@ intl/tvheadend.pot: $(I18N-C)
intl/tvheadend.de.po: intl/tvheadend.pot
$(call merge-po,$@,$<)

intl/tvheadend.fr.po: intl/tvheadend.pot
$(call merge-po,$@,$<)

intl/tvheadend.cs.po: intl/tvheadend.pot
$(call merge-po,$@,$<)

Expand All @@ -595,7 +598,7 @@ $(BUILDDIR)/bundle.c: check_dvb_scan make_webui

.PHONY: make_webui
make_webui:
$(MAKE) -f Makefile.webui all
$(MAKE) -f Makefile.webui LANGUAGES="$(LANGUAGES)" all

# Static FFMPEG

Expand Down
36 changes: 35 additions & 1 deletion Makefile.webui
Expand Up @@ -22,6 +22,7 @@

IAM=$(lastword $(MAKEFILE_LIST))
WEBDIR ?= src/webui
LANGUAGES ?= de fr cs pl
ROOTPATH = static

ifneq ($(WEBUI),)
Expand All @@ -33,6 +34,8 @@ CSS_PY = PYTHONIOENCODING=utf-8 $(PYTHON) support/css.py
RUN_JS = PYTHONIOENCODING=utf-8 $(PYTHON) vendor/rjsmin-1.0.10/rjsmin.py
RUN_CSS = PYTHONIOENCODING=utf-8 $(PYTHON) vendor/rcssmin-1.0.5/rcssmin.py
GZIPCMD += -n
XGETTEXT ?= xgettext --language=JavaScript --from-code=utf-8 -k_ -kN_ -s
MSGMERGE ?= msgmerge

ifeq ($(WEBUI),std)
DEBUG =
Expand Down Expand Up @@ -143,6 +146,11 @@ CSS_SRC = $(foreach f,$(CSS),$(WEBDIR)/$(f))
JAVASCRIPT_TV_SRC = $(foreach f,$(JAVASCRIPT_TV),$(WEBDIR)/$(f))
CSS_TV_SRC = $(foreach f,$(CSS_TV),$(WEBDIR)/$(f))

#
# Internationalization
#
PO-FILES = $(foreach f,$(LANGUAGES),intl/js/tvheadend.js.$(f).po)

endif # WEBUI defined

ifndef V
Expand Down Expand Up @@ -171,6 +179,15 @@ define GO_CSS
@stat --printf="%-35n %7s\n" $@
endef

define merge-po
@if ! test -r "$(1)"; then \
sed -e 's/Content-Type: text\/plain; charset=CHARSET/Content-Type: text\/plain; charset=utf-8/' < "$(2)" > "$(1).new"; \
else \
$(MSGMERGE) -o $(1).new $(1) $(2); \
fi
@mv $(1).new $(1)
endef

all:
$(MAKE) -f $(IAM) WEBUI=std compile-std
$(MAKE) -f $(IAM) WEBUI=debug compile-debug
Expand Down Expand Up @@ -206,13 +223,30 @@ $(WEBDIR)/$(ROOTPATH)/tvh-tv.css.gz: $(CSS_TV_SRC)
.PHONY: compile-std
compile-std: $(WEBDIR)/$(ROOTPATH)/tvh.js.gz $(WEBDIR)/$(ROOTPATH)/tvh.css.gz \
$(WEBDIR)/$(ROOTPATH)/tvh-tv.js.gz $(WEBDIR)/$(ROOTPATH)/tvh-tv.css.gz \
$(WEBDIR)/extjs-std.c $(WEBDIR)/extjs-tv-std.c
$(WEBDIR)/extjs-std.c $(WEBDIR)/extjs-tv-std.c $(PO-FILES)
@echo "WEBUI std finished"

.PHONY: compile-debug
compile-debug: $(WEBDIR)/extjs-debug.c $(WEBDIR)/extjs-tv-debug.c
@echo "WEBUI debug finished"

# Internationalization
intl/js/tvheadend.js.pot: $(JAVASCRIPT_SRC)
@$(XGETTEXT) -o $@.new $(JAVASCRIPT_SRC)
@mv $@.new $@

intl/js/tvheadend.js.de.po: intl/js/tvheadend.js.pot
$(call merge-po,$@,$<)

intl/js/tvheadend.js.fr.po: intl/js/tvheadend.js.pot
$(call merge-po,$@,$<)

intl/js/tvheadend.js.cs.po: intl/js/tvheadend.js.pot
$(call merge-po,$@,$<)

intl/js/tvheadend.js.pl.po: intl/js/tvheadend.js.pot
$(call merge-po,$@,$<)

.PHONY:
clean:
rm -f $(foreach f,tvh.js tvh.css tvh-tv.js tvh-tv.css,\
Expand Down

0 comments on commit 2b2cc88

Please sign in to comment.