Skip to content

Commit

Permalink
adding the .mo and .pot files to git ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
analaura09 committed Oct 7, 2021
1 parent 0a7c9e7 commit c8ac0a1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@
/freegames.egg-info/

.DS_Store


.vscode/

#unnecessary files
*.mo
*.pot


26 changes: 20 additions & 6 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ SPHINXPROJ = FreeGames
SOURCEDIR = .
BUILDDIR = _build

LOCALES = $(patsubst locale/%,%,$(wildcard locale/*))

MV = mv
RM = rm -r

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Expand All @@ -18,19 +23,28 @@ help:
update-po: pot
$(SPHINXINTL) update -p "$(BUILDDIR)/gettext" $(0)

pot: gettext
@cp $(BUILDDIR)/gettext/*.pot locale/

%-translated: LOCALES = $(patsubst locale/%,%,$(wildcard locale/*))
%-translated:
@for locale in $(LOCALES); do \
SPHINXOPTS="-D language=$$locale"; \
BUILDDIR="$(BUILDDIR)/$$locale"; \
TARGET="$(patsubst %-translated,%,$@)"; \
$(SPHINXBUILD) -M "$$TARGET" "$(SOURCEDIR)" "$$BUILDDIR" $$SPHINXOPTS; \
$(SPHINXBUILD) -M "$(TARGET)" "$(SOURCEDIR)" "$$BUILDDIR" $$SPHINXOPTS; \
done

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

TARGET=$@ make translated

@for locale in $(LOCALES); do \
LOCALEDIR="$(BUILDDIR)/$$locale"; \
TARGETDIR="$(BUILDDIR)/$@/$$locale"; \
$(MV) "$$LOCALEDIR/$@" "$$TARGETDIR"; \
$(RM) "$$LOCALEDIR"; \
echo "HTML pages was moved to $$TARGETDIR directory"; \
done


clean:
$(RM) $(BUILDDIR)

0 comments on commit c8ac0a1

Please sign in to comment.