Compare commits
5 Commits
main
...
8106f4d2df
| Author | SHA1 | Date | |
|---|---|---|---|
| 8106f4d2df | |||
| 86113d9573 | |||
| 224939feaf | |||
| 0fbbb30e5b | |||
| 409129eff1 |
@@ -1,21 +0,0 @@
|
|||||||
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"
|
|
||||||
118
README.md
118
README.md
@@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
# foreignthon-ta
|
# foreignthon-ta
|
||||||
|
|
||||||
Tamil language pack for [ForeignThon](https://foreignthon.keshavanand.net/) — write Python in தமிழ்.
|
Tamil language pack for ForeignThon.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
@@ -10,117 +9,30 @@ Tamil language pack for [ForeignThon](https://foreignthon.keshavanand.net/) —
|
|||||||
pip install foreignthon foreignthon-ta
|
pip install foreignthon foreignthon-ta
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
## Usage
|
||||||
|
|
||||||
## Example
|
```py
|
||||||
|
fpy run main.ta.py
|
||||||
**`fizzbuzz.ta.py`**
|
|
||||||
|
|
||||||
```python
|
|
||||||
நிரல்பாகம் fizzbuzz(n):
|
|
||||||
ஆக i உள்ளே வரம்பு(1, n + 1):
|
|
||||||
i % 15 == 0 @@ஆனால்:
|
|
||||||
பதிப்பி("FizzBuzz")
|
|
||||||
i % 3 == 0 @@இல்லைஆனால்:
|
|
||||||
பதிப்பி("Fizz")
|
|
||||||
i % 5 == 0 @@இல்லைஆனால்:
|
|
||||||
பதிப்பி("Buzz")
|
|
||||||
மற்றபடி:
|
|
||||||
பதிப்பி(i)
|
|
||||||
|
|
||||||
fizzbuzz(20)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This uses Tamil's natural SOV word order — the condition comes first, then the keyword with `@@`. See [Postfix Syntax](https://foreignthon.keshavanand.net/postfix-syntax/) for details.
|
## What's translated
|
||||||
|
|
||||||
Compiles to standard Python:
|
- **Keywords** — {keywords}
|
||||||
|
- **Builtins** — {builtins}
|
||||||
|
- **Exceptions** — {exceptions}
|
||||||
|
- **Stdlib** — {stdlib}
|
||||||
|
|
||||||
```python
|
{postfix_section}
|
||||||
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)
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Keyword reference
|
|
||||||
|
|
||||||
| Python | தமிழ் |
|
|
||||||
|---|---|
|
|
||||||
| `if` | `ஆனால்` |
|
|
||||||
| `else` | `மற்றபடி` |
|
|
||||||
| `elif` | `இல்லைஆனால்` |
|
|
||||||
| `for` | `ஆக` |
|
|
||||||
| `while` | `வரை` |
|
|
||||||
| `def` | `நிரல்பாகம்` |
|
|
||||||
| `class` | `கோப்பு` |
|
|
||||||
| `return` | `பின்கோடு` |
|
|
||||||
| `import` | `இறக்கு` |
|
|
||||||
| `True` | `உண்மை` |
|
|
||||||
| `False` | `பொய்` |
|
|
||||||
| `None` | `ஒன்றுமில்லை` |
|
|
||||||
| `print` | `பதிப்பி` |
|
|
||||||
| `input` | `உள்ளீடு` |
|
|
||||||
| `len` | `நீளம்` |
|
|
||||||
| `range` | `வரம்பு` |
|
|
||||||
|
|
||||||
Full mapping: [`ta.json`](https://git.keshavanand.net/foreign-thon/foreignthon-ta/raw/branch/main/src/foreignthon_ta/ta.json)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Postfix syntax
|
|
||||||
|
|
||||||
Tamil is SOV — the condition naturally comes before the keyword. The `@@` operator lets you write it that way:
|
|
||||||
|
|
||||||
```python
|
|
||||||
# prefix style (also valid)
|
|
||||||
ஆனால் x > 0:
|
|
||||||
பதிப்பி(x)
|
|
||||||
|
|
||||||
# postfix style — natural Tamil order
|
|
||||||
x > 0 @@ஆனால்:
|
|
||||||
பதிப்பி(x)
|
|
||||||
```
|
|
||||||
|
|
||||||
Both compile identically. Decompile standard Python with postfix output:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
fpy decompile script.py --lang ta --postfix
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Start a project
|
|
||||||
|
|
||||||
```bash
|
|
||||||
fpy new myproject --lang ta
|
|
||||||
cd myproject
|
|
||||||
fpy run src/main.ta.py
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
→ [foreignthon.keshavanand.net](https://foreignthon.keshavanand.net/)
|
→ https://foreignthon.keshavanand.net/
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Found a missing translation or a better keyword choice? Open an issue or PR — no access to the core repo needed.
|
Found a missing translation or a better keyword choice? Open an issue or PR — no core access needed.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
GPL v3
|
GPL
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,13 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "foreignthon-ta"
|
name = "foreignthon-ta"
|
||||||
version = "0.2.5"
|
version = "0.2.3"
|
||||||
description = "Tamil language pack for ForeignThon."
|
description = "Tamil language pack for ForeignThon."
|
||||||
license = { text = "GPL v3" }
|
license = { text = "GPL v3" }
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
authors = [
|
authors = [{ name = "Keshav Anand", email = "keshavanand.dev@gmail.com" }]
|
||||||
{ name = "Keshav Anand", email = "keshavanand.dev@gmail.com" }
|
|
||||||
]
|
|
||||||
keywords = ["foreignthon", "tamil", "தமிழ்"]
|
keywords = ["foreignthon", "tamil", "தமிழ்"]
|
||||||
dependencies = ["foreignthon>=0.5.4"]
|
dependencies = ["foreignthon>=0.5.3"]
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
"while",
|
"while",
|
||||||
"class",
|
"class",
|
||||||
"with",
|
"with",
|
||||||
|
"try",
|
||||||
"except",
|
"except",
|
||||||
"finally",
|
"finally",
|
||||||
"from"
|
"from"
|
||||||
|
|||||||
Reference in New Issue
Block a user