Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98017475
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 8, 17:17
Size
2 KB
Mime Type
text/x-makefile
Expires
Fri, Jan 10, 17:17 (2 d)
Engine
blob
Format
Raw Data
Handle
23446032
Attached To
rEDXLOCALE edx-locale
Makefile
View Options
SHELL := /bin/bash
OS := $(shell uname)
_LC_PLATORM := conf/locale-platform
_LC_PATCH := conf/locale-patch
_LC_THEME := conf/locale-theme
_LC_MICROSITE := conf/locale-microsite
_LC_LANGUAGE := fr/LC_MESSAGES
all: po mo
@echo " ===> Done"
init:
@echo " ===> Initialize."
@mkdir -p $(_LC_PLATORM)/$(_LC_LANGUAGE) $(_LC_PATCH)/$(_LC_LANGUAGE) $(_LC_THEME)/$(_LC_LANGUAGE) $(_LC_MICROSITE)/$(_LC_LANGUAGE)
@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-ginkgo]' >> .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"
po_remote:
@echo " ===> Download .po file from ginkgo."
@source venv/bin/activate && \
tx pull -l fr && \
mv .tx/open-edx-releases.release-ginkgo/fr_translation $(_LC_PLATORM)/$(_LC_LANGUAGE)/django.po
po_local:
@echo " ===> Generate .po files from local repos."
@source venv/bin/activate && \
pybabel extract --omit-header -F babel-themes.cfg -o $(_LC_THEME)/$(_LC_LANGUAGE)/.django.po ../edx-themes && \
pybabel extract --omit-header -F babel-edx-microsite.cfg -o $(_LC_MICROSITE)/$(_LC_LANGUAGE)/.django.po ../edx-microsite && \
msgcat $(_LC_THEME)/$(_LC_LANGUAGE)/django.po $(_LC_THEME)/$(_LC_LANGUAGE)/.django.po -o $(_LC_THEME)/$(_LC_LANGUAGE)/tmp.po --use-first && \
msgcat $(_LC_MICROSITE)/$(_LC_LANGUAGE)/django.po $(_LC_MICROSITE)/$(_LC_LANGUAGE)/.django.po -o $(_LC_MICROSITE)/$(_LC_LANGUAGE)/tmp.po --use-first && \
mv $(_LC_THEME)/$(_LC_LANGUAGE)/tmp.po $(_LC_THEME)/$(_LC_LANGUAGE)/django.po && \
mv $(_LC_MICROSITE)/$(_LC_LANGUAGE)/tmp.po $(_LC_MICROSITE)/$(_LC_LANGUAGE)/django.po && \
rm $(_LC_THEME)/$(_LC_LANGUAGE)/.django.po $(_LC_MICROSITE)/$(_LC_LANGUAGE)/.django.po
mo:
@echo " ===> Generate mo files."
@source venv/bin/activate && \
msgfmt $(_LC_PLATORM)/$(_LC_LANGUAGE)/django.po --output-file $(_LC_PLATORM)/$(_LC_LANGUAGE)/django.mo && \
msgfmt $(_LC_PATCH)/$(_LC_LANGUAGE)/django.po --output-file $(_LC_PATCH)/$(_LC_LANGUAGE)/django.mo && \
msgfmt $(_LC_THEME)/$(_LC_LANGUAGE)/django.po --output-file $(_LC_THEME)/$(_LC_LANGUAGE)/django.mo && \
msgfmt $(_LC_MICROSITE)/$(_LC_LANGUAGE)/django.po --output-file $(_LC_MICROSITE)/$(_LC_LANGUAGE)/django.mo
clean:
@echo " ===> Clean working directories."
@rm -Rf .tx venv
Event Timeline
Log In to Comment