Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localization support #61

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3881607
Add localization support
rffontenelle Apr 18, 2021
b3ad91e
Update Makefile
analaura09 Aug 24, 2021
e7092a0
Update conf.py
analaura09 Aug 25, 2021
e4ddc38
Update Makefile
analaura09 Aug 25, 2021
04201dd
Update Makefile
analaura09 Aug 25, 2021
024d0c2
Update Makefile
analaura09 Aug 25, 2021
0a5d488
Arquivos .po gerados
analaura09 Aug 25, 2021
cd58a7d
gerando arquivos .pot
analaura09 Aug 25, 2021
d95b25a
Update Makefile
analaura09 Aug 31, 2021
1e5a255
Update development.rst
analaura09 Sep 6, 2021
0a7c9e7
topic addition: translation
analaura09 Sep 22, 2021
c8ac0a1
adding the .mo and .pot files to git ignore
analaura09 Oct 7, 2021
c0df899
Update Makefile
analaura09 Oct 7, 2021
eb3108c
Revert "adding the .mo and .pot files to git ignore"
analaura09 Oct 7, 2021
aa15232
Revert "Revert "adding the .mo and .pot files to git ignore""
analaura09 Oct 7, 2021
f24e31b
removing all .pot files from the repository
analaura09 Oct 7, 2021
f309add
Update development.rst
analaura09 Oct 7, 2021
4d5a83f
Update Makefile
analaura09 Oct 8, 2021
696cfb1
Merge pull request #1 from analaura09/l10n
rffontenelle Oct 8, 2021
e180635
Update last exercise
grantjenks May 18, 2021
0d54383
#55 - added initial mad libs game and initial test. (#65)
drocpdp Jun 1, 2021
c7dff81
Update madlibs game
grantjenks Jun 1, 2021
02cc874
Add GitHub workflow action for integration
grantjenks Jun 15, 2021
b796a49
Update readme
grantjenks Jun 15, 2021
ef6213c
Delete travis/appveyor, update requirements and tox
grantjenks Jun 15, 2021
9c537a1
First pass with blue
grantjenks Jun 15, 2021
7d35593
More blue fixes
grantjenks Jun 15, 2021
c80186a
Fixes for docs
grantjenks Jun 15, 2021
69f19df
isort fixes
grantjenks Jun 15, 2021
31b054a
Add tests for minesweeper
grantjenks Jun 15, 2021
a3fdfd3
Simplify ant game
grantjenks Jun 15, 2021
8709ef1
Simplify crypto branching
grantjenks Jun 15, 2021
fdae0ec
Collections abc deprecation warning
grantjenks Jun 15, 2021
ea8f41b
Test colors
grantjenks Jun 15, 2021
2babbe0
Test back-and-forth
grantjenks Jun 15, 2021
f634341
Add test for going in a circle
grantjenks Jun 15, 2021
b0966cb
Go back-and-forth
grantjenks Jun 15, 2021
2970be9
Remove flake8 and simplify switches
grantjenks Jun 15, 2021
92f7c53
Remove flake8 and test on Windows and MacOS
grantjenks Jun 15, 2021
0f140c3
Update project urls and classifiers
grantjenks Jun 15, 2021
ad40d5c
Windows %$#@!
grantjenks Jun 15, 2021
bdad810
Update copyright to 2021
grantjenks Jun 15, 2021
7f95477
Add replit file for support
grantjenks Jun 15, 2021
7b32230
Remove replit, don't want to grant GitHub access
grantjenks Jun 15, 2021
a8b0dd1
Align isort and blue line lengths
grantjenks Jun 15, 2021
d0bf840
Add new po files after git-rebase
rffontenelle Oct 12, 2021
15ebbcf
Update to support Python 3.10 (#75)
grantjenks Nov 30, 2021
1ec8010
Bump version to 2.4.0
grantjenks Nov 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: integration

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:

checks:
runs-on: ubuntu-latest
strategy:
max-parallel: 6
matrix:
check: [bluecheck, doc8, docs, flake8, isortcheck, rstcheck]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Setup tox
run: |
pip install --upgrade pip
pip install tox
- name: Run checks with tox
run: |
tox -e ${{ matrix.check }}

tests:
needs: checks
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup tox
run: |
pip install --upgrade pip
pip install tox
- name: Test with tox
run: tox -e py
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


15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2017-2019 Grant Jenks
Copyright 2017-2022 Grant Jenks

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
Expand Down
17 changes: 7 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,13 @@ Features
- Used in hundreds of hours of classroom instruction
- Fully Documented
- 100% Test Coverage
- Developed on Python 3.7
- Tested on CPython 2.7, 3.4, 3.5, 3.6, and 3.7
- Tested on Windows, Mac OS X, Raspbian (Raspberry Pi), and Linux
- Tested using Travis CI and AppVeyor CI
- Developed on Python 3.10
- Tested on CPython 3.6, 3.7, 3.8, 3.9, 3.10
- Tested on Linux, Mac OS X, and Windows
- Tested using GitHub Actions

.. image:: https://api.travis-ci.org/grantjenks/free-python-games.svg?branch=master
:target: http://www.grantjenks.com/docs/freegames/

.. image:: https://ci.appveyor.com/api/projects/status/github/grantjenks/free-python-games?branch=master&svg=true
:target: http://www.grantjenks.com/docs/freegames/
.. image:: https://github.com/grantjenks/free-python-games/workflows/integration/badge.svg
:target: http://www.grantjenks.com/docs/freegames/


Quickstart
Expand Down Expand Up @@ -337,7 +334,7 @@ References
Free Python Games License
-------------------------

Copyright 2017-2020 Grant Jenks
Copyright 2017-2022 Grant Jenks

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

30 changes: 27 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,42 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXBUILD = python3 -msphinx
SPHINXINTL = python3 -msphinx_intl
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)

.PHONY: help Makefile
.PHONY: help Makefile update-po

update-po: gettext
$(SPHINXINTL) update -p "$(BUILDDIR)/gettext" $(0)

translated:
@for locale in $(LOCALES); do \
SPHINXOPTS="-D language=$$locale"; \
BUILDDIR="$(BUILDDIR)/$$locale"; \
TARGETDIR="$(BUILDDIR)/$(TARGET)/$$locale"; \
$(SPHINXBUILD) -M "$(TARGET)" "$(SOURCEDIR)" "$$BUILDDIR" $$SPHINXOPTS; \
$(MV) "$$BUILDDIR/$(TARGET)" "$$TARGETDIR"; \
$(RM) "$$BUILDDIR"; \
echo "$$locale docs was moved to $$TARGETDIR directory"; \
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)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

@if [ $@ != clean -a $@ != gettext ]; then \
TARGET=$@ make translated; \
fi
6 changes: 3 additions & 3 deletions docs/_templates/gumroad.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3>Donate</h3>
<p>If you or your organization uses Free Games, consider donating:</p>
<h3>{{ _('Donate') }}</h3>
<p>{{ _('If you or your organization uses Free Games, consider donating:') }}</p>
<p>
<a href="http://gum.co/freegames" target="_blank">Donate to Free Python Games</a>
<a href="http://gum.co/freegames" target="_blank">{{ _('Donate to Free Python Games') }}</a>
</p>
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,7 @@

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Gettext / i18n
locale_dirs = ['locale/']
gettext_compact = False
10 changes: 10 additions & 0 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,13 @@ simply run::

The test argument to setup.py will download a minimal testing infrastructure
and run the tests.

Translate
----------

Translation files are available in the locale/ directory, if you want to contribute a translation make changes to its content.

if you want to translate to another language, you need to create the lang folder. To update the lang folder you need to use the command:

$ make update-po

1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
memory
pacman
fidget
madlibs
28 changes: 28 additions & 0 deletions docs/locale/pt_BR/LC_MESSAGES/ant.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2017-2020, Grant Jenks
# This file is distributed under the same license as the Free Python Games
# package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Free Python Games 2.3.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-08-24 21:25-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: ../../ant.rst:2
msgid "Ant"
msgstr ""

#: ../../ant.rst:4
msgid "Ant, simple animation demo."
msgstr ""

121 changes: 121 additions & 0 deletions docs/locale/pt_BR/LC_MESSAGES/api.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2017-2020, Grant Jenks
# This file is distributed under the same license as the Free Python Games
# package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Free Python Games 2.3.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-08-24 21:25-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#: ../../api.rst:2
msgid "Free Python Games API Reference"
msgstr ""

#: ../../api.rst:4
msgid ""
":doc:`Free Python Games <index>` includes a few helpful utilities. The "
"best way to expose beginners to these functions is with Python's built-in"
" help function. Learners should be able to understand and write the "
"drawing functions themselves."
msgstr ""

#: ../../api.rst:13
msgid "Drawing Functions"
msgstr ""

#: freegames.utils.line:1 of
msgid "Draw line from `(a, b)` to `(x, y)`."
msgstr ""

#: freegames.utils.square:1 of
msgid "Draw square at `(x, y)` with side length `size` and fill color `name`."
msgstr ""

#: freegames.utils.square:3 of
msgid "The square is oriented so the bottom left corner is at (x, y)."
msgstr ""

#: ../../api.rst:20
msgid "Helper Functions"
msgstr ""

#: freegames.utils.floor:1 of
msgid "Floor of `value` given `size` and `offset`."
msgstr ""

#: freegames.utils.floor:3 of
msgid "The floor function is best understood with a diagram of the number line::"
msgstr ""

#: freegames.utils.floor:8 of
msgid ""
"The number line shown has offset 200 denoted by the left-hand tick mark "
"at -200 and size 100 denoted by the tick marks at -100, 0, 100, and 200. "
"The floor of a value is the left-hand tick mark of the range where it "
"lies. So for the points show above: ``floor(x)`` is -200, ``floor(y)`` is"
" 0, and ``floor(z)`` is 100."
msgstr ""

#: freegames.utils.path:1 of
msgid "Return full path to `filename` in freegames module."
msgstr ""

#: ../../api.rst:27
msgid "Vectors"
msgstr ""

#: freegames.utils.vector:1 of
msgid "Two-dimensional vector."
msgstr ""

#: freegames.utils.vector:3 of
msgid "Vectors can be modified in-place."
msgstr ""

#: freegames.utils.vector.__init__:1 of
msgid "Initialize vector with coordinates: x, y."
msgstr ""

#: freegames.utils.vector.__add__:1 of
msgid "v.__add__(w) -> v + w"
msgstr ""

#: freegames.utils.vector.__mul__:1 of
msgid "v.__mul__(w) -> v * w"
msgstr ""

#: freegames.utils.vector.copy:1 of
msgid "Return copy of vector."
msgstr ""

#: freegames.utils.vector.move:1 of
msgid "Move vector by other (in-place)."
msgstr ""

#: freegames.utils.vector.rotate:1 of
msgid "Rotate vector counter-clockwise by angle (in-place)."
msgstr ""

#: freegames.utils.vector.scale:1 of
msgid "Scale vector by other (in-place)."
msgstr ""

#: freegames.vector.x:1 of
msgid "X-axis component of vector."
msgstr ""

#: freegames.vector.y:1 of
msgid "Y-axis component of vector."
msgstr ""

Loading