Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98641448
Makefile
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jan 15, 04:36
Size
3 KB
Mime Type
text/x-makefile
Expires
Fri, Jan 17, 04:36 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
23612152
Attached To
rEDXLOCALE edx-locale
Makefile
View Options
SHELL := /bin/bash
OS := $(shell uname)
_LC_PLATFORM := conf/locale-platform
_LC_PATCH := conf/locale-patch
_LC_THEME := conf/locale-theme
_LC_MICROSITE := conf/locale-microsite
_LC_LANGUAGE_FR := fr/LC_MESSAGES
_LC_LANGUAGE_DE := de_DE/LC_MESSAGES
define make_dirs
mkdir -p $(_LC_PLATFORM)/$(1) $(_LC_PATCH)/$(1) $(_LC_THEME)/$(1) $(_LC_MICROSITE)/$(1)
endef
define tx_pull
source venv/bin/activate && \
tx pull -l $(1) && \
mv .tx/open-edx-releases.release-hawthorn/$(1)_translation $(_LC_PLATFORM)/$(2)/django.po
endef
define po_local_exec
source venv/bin/activate && \
pybabel extract --omit-header -F babel-themes.cfg -o $(_LC_THEME)/$(1)/.django.po ../edx-themes && \
pybabel extract --omit-header -F babel-edx-microsite.cfg -o $(_LC_MICROSITE)/$(1)/.django.po ../edx-microsite && \
pybabel extract --omit-header -F babel-patches.cfg -o $(_LC_PATCH)/$(1)/.django.po ../edx-platform-patches/hawthorn && \
msgcat $(_LC_THEME)/$(1)/django.po $(_LC_THEME)/$(1)/.django.po -o $(_LC_THEME)/$(1)/tmp.po --use-first && \
msgcat $(_LC_MICROSITE)/$(1)/django.po $(_LC_MICROSITE)/$(1)/.django.po -o $(_LC_MICROSITE)/$(1)/tmp.po --use-first && \
msgcat $(_LC_PATCH)/$(1)/django.po $(_LC_PATCH)/$(1)/.django.po -o $(_LC_PATCH)/$(1)/tmp.po --use-first && \
mv $(_LC_THEME)/$(1)/tmp.po $(_LC_THEME)/$(1)/django.po && \
mv $(_LC_MICROSITE)/$(1)/tmp.po $(_LC_MICROSITE)/$(1)/django.po && \
mv $(_LC_PATCH)/$(1)/tmp.po $(_LC_PATCH)/$(1)/django.po && \
rm $(_LC_THEME)/$(1)/.django.po $(_LC_MICROSITE)/$(1)/.django.po $(_LC_PATCH)/$(1)/.django.po
endef
define mo_exec
source venv/bin/activate && \
msgfmt $(_LC_PLATFORM)/$(1)/django.po --output-file $(_LC_PLATFORM)/$(1)/django.mo && \
msgfmt $(_LC_PATCH)/$(1)/django.po --output-file $(_LC_PATCH)/$(1)/django.mo && \
msgfmt $(_LC_THEME)/$(1)/django.po --output-file $(_LC_THEME)/$(1)/django.mo && \
msgfmt $(_LC_MICROSITE)/$(1)/django.po --output-file $(_LC_MICROSITE)/$(1)/django.mo
endef
all: po mo
@echo " ===> Done"
init:
@echo " ===> Initialize."
$(call make_dirs, $(_LC_LANGUAGE_FR))
$(call make_dirs, $(_LC_LANGUAGE_DE))
@if test -d venv; then \
echo "init has been done early. You can remove directory venv to recreate environment."; \
else \
mkdir -p venv && \
virtualenv venv --system-site-packages && \
source venv/bin/activate && \
pip install -r requirements.txt && \
rm -Rf .tx && \
tx init --user=api --token='1/d4eb01906f12e288e33733b098b3a1b45220e572' --host=www.transifex.com && \
echo '[open-edx-releases.release-hawthorn]' >> .tx/config && \
echo 'source_file = <lang>_translation' >> .tx/config && \
echo 'source_lang = en_US' >> .tx/config && \
echo 'type = PO' >> .tx/config; \
fi;
po: po_remote po_local
@echo " ===> Make .po from remote and local."
po_remote:
@echo " ===> Download .po file from hawthorn."
$(call tx_pull,fr,$(_LC_LANGUAGE_FR))
$(call tx_pull,de,$(_LC_LANGUAGE_DE))
po_local:
@echo " ===> Generate .po files from local repos."
$(call po_local_exec,$(_LC_LANGUAGE_FR))
$(call po_local_exec,$(_LC_LANGUAGE_DE))
mo:
@echo " ===> Generate mo files."
$(call mo_exec,$(_LC_LANGUAGE_FR))
$(call mo_exec,$(_LC_LANGUAGE_DE))
clean:
@echo " ===> Clean working directories."
@rm -Rf .tx venv
Event Timeline
Log In to Comment