Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 79204a473e | |||
| 0802e81d41 | |||
| 2545d7ed9a | |||
| 4c104baf4f | |||
| 619a1b2660 | |||
| 8b2bf776e2 | |||
| 7f2018c83b | |||
| 94f989c282 | |||
| 37c7ed6218 |
@@ -66,7 +66,7 @@ jobs:
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"$TAG\",
|
||||
\"name\": \"$REPO_NAME $TAG\",
|
||||
\"name\": \"$TAG\",
|
||||
\"body\": \"Language pack release version $TAG for the foreignthon transpiler framework.\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
|
||||
21
.gitea/workflows/trigger-docs.yml
Normal file
21
.gitea/workflows/trigger-docs.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Trigger Docs Rebuild
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- "README.md"
|
||||
|
||||
jobs:
|
||||
trigger:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger docs rebuild
|
||||
env:
|
||||
DOCS_TOKEN: ${{ secrets.DOCS_TRIGGER_TOKEN }}
|
||||
run: |
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $DOCS_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"ref": "main"}' \
|
||||
"https://git.keshavanand.net/api/v1/repos/foreign-thon/foreignthon-docs/actions/workflows/deploy.yml/dispatches"
|
||||
107
README.md
107
README.md
@@ -1 +1,108 @@
|
||||
# foreignthon-es
|
||||
|
||||
Spanish language pack for [ForeignThon](https://foreignthon.keshavanand.net/) — write Python in Español.
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
pip install foreignthon foreignthon-es
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Example
|
||||
|
||||
**`fizzbuzz.es.py`**
|
||||
|
||||
```python
|
||||
def fizzbuzz(n):
|
||||
para i en dist(1, n + 1):
|
||||
si i % 15 == 0:
|
||||
imprimir("FizzBuzz")
|
||||
osi i % 3 == 0:
|
||||
imprimir("Fizz")
|
||||
osi i % 5 == 0:
|
||||
imprimir("Buzz")
|
||||
sino:
|
||||
imprimir(i)
|
||||
|
||||
fizzbuzz(20)
|
||||
```
|
||||
|
||||
Compiles to standard Python:
|
||||
|
||||
```python
|
||||
def fizzbuzz(n):
|
||||
for i in range(1, n + 1):
|
||||
if i % 15 == 0:
|
||||
print("FizzBuzz")
|
||||
elif i % 3 == 0:
|
||||
print("Fizz")
|
||||
elif i % 5 == 0:
|
||||
print("Buzz")
|
||||
else:
|
||||
print(i)
|
||||
|
||||
fizzbuzz(20)
|
||||
```
|
||||
|
||||
Run it directly:
|
||||
|
||||
```bash
|
||||
fpy run fizzbuzz.es.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Keyword reference
|
||||
|
||||
| Python | Español |
|
||||
|---|---|
|
||||
| `if` | `si` |
|
||||
| `else` | `sino` |
|
||||
| `elif` | `osi` |
|
||||
| `for` | `para` |
|
||||
| `while` | `mientras` |
|
||||
| `def` | `def` |
|
||||
| `class` | `clase` |
|
||||
| `return` | `retornar` |
|
||||
| `import` | `importar` |
|
||||
| `True` | `Verda` |
|
||||
| `False` | `Falso` |
|
||||
| `None` | `Nada` |
|
||||
| `print` | `imprimir` |
|
||||
| `input` | `entrada` |
|
||||
| `len` | `lon` |
|
||||
| `range` | `dist` |
|
||||
|
||||
Full mapping: [`src/foreignthon_es/es.json`](https://git.keshavanand.net/foreign-thon/foreignthon-es/raw/branch/main/src/foreignthon_es/es.json)
|
||||
|
||||
---
|
||||
|
||||
## Start a project
|
||||
|
||||
```bash
|
||||
fpy new myproject --lang es
|
||||
cd myproject
|
||||
fpy run src/main.es.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Documentation
|
||||
|
||||
→ [foreignthon.keshavanand.net](https://foreignthon.keshavanand.net/)
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
|
||||
Found a missing translation or a better keyword choice? Open an issue or PR — no access to the core repo needed.
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
GPL v3
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "foreignthon-es"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
description = "Spanish language pack for ForeignThon."
|
||||
license = { text = "GPL v3" }
|
||||
requires-python = ">=3.9"
|
||||
@@ -16,6 +16,16 @@ keywords = ["foreignthon", "spanish", "español"]
|
||||
|
||||
dependencies = ["foreignthon>=0.5.3"]
|
||||
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||
"Operating System :: OS Independent",
|
||||
"Topic :: Software Development :: Compilers",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://git.keshavanand.net/foreign-thon/foreignthon-ta"
|
||||
|
||||
[project.entry-points."foreignthon.langs"]
|
||||
es = "foreignthon_es"
|
||||
|
||||
|
||||
@@ -100,15 +100,15 @@ def test_builtins_and_exceptions_integrity(pack_data):
|
||||
|
||||
def test_postfix_keywords_integrity(pack_data):
|
||||
path, data = pack_data
|
||||
assert (
|
||||
"postfix_keywords" in data
|
||||
), f"Missing 'postfix_keywords' section in {path.name}"
|
||||
assert isinstance(
|
||||
data["postfix_keywords"], list
|
||||
), "'postfix_keywords' must be an array/list"
|
||||
|
||||
# Ensure any declared postfix keyword is actually registered in the main keywords dictionary
|
||||
assert "postfix_keywords" in data, f"Missing 'postfix_keywords' section in {path.name}"
|
||||
assert isinstance(data["postfix_keywords"], list), "'postfix_keywords' must be an array/list"
|
||||
|
||||
# Extract all the English Python keywords that have been mapped in this pack
|
||||
mapped_python_targets = set(data["keywords"].values())
|
||||
|
||||
# Ensure any declared English postfix keyword actually has a mapped translation
|
||||
for post_kw in data["postfix_keywords"]:
|
||||
assert (
|
||||
post_kw in data["keywords"]
|
||||
), f"Postfix keyword '{post_kw}' is missing from the main 'keywords' mapping in {path.name}."
|
||||
assert post_kw in mapped_python_targets, (
|
||||
f"English postfix keyword '{post_kw}' is missing from the mapped values "
|
||||
f"in the main 'keywords' dictionary in {path.name}."
|
||||
)
|
||||
Reference in New Issue
Block a user