Files
foreignthon-te/README.md
AnishB 2265e9f5ee
Some checks failed
Pack Validation CI / validate (pull_request) Failing after 10s
chatgpt readme :3
2026-06-13 11:17:53 -05:00

129 lines
2.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# foreignthon-te
Telugu language pack for [ForeignThon](https://foreignthon.keshavanand.net/) — write Python in తెలుగు.
---
## Install
```bash
pip install foreignthon foreignthon-te
```
---
## Example
**`fizzbuzz.te.py`**
```python
రతి i పల పరిి(1, 21):
ఒకవ i % 15 == 0:
("FizzBuzz")
కప_ఒకవ i % 3 == 0:
("Fizz")
కప_ఒకవ i % 5 == 0:
("Buzz")
ిపక:
(i)
```
Compiles to standard Python:
```python
for i in range(1, 21):
if i % 15 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
```
Run it directly without compiling first:
```bash
fpy run fizzbuzz.te.py
```
---
## Keyword reference
| Python | తెలుగు |
|---|---|
| `if` | `ఒకవేళ` |
| `else` | `లేనిపక్షంలో` |
| `elif` | `లేకపోతే_ఒకవేళ` |
| `for` | `ప్రతి` |
| `while` | `ఎంతవరకు` |
| `def` | `రూపొందించు` |
| `class` | `మాదిరి` |
| `return` | `ఇవ్వు` |
| `import` | `చేర్చు` |
| `True` | `అవును` |
| `False` | `కాదు_విలువ` |
| `None` | `శూన్యం` |
| `print` | `చూపు` |
| `input` | `అడుగు` |
| `len` | `పొడవు` |
| `range` | `పరిధి` |
The full mapping is in [`te.json`](https://git.keshavanand.net/foreign-thon/foreignthon-te/raw/branch/main/src/foreignthon_te/te.json).
---
## Postfix syntax
This pack supports the `@@` postfix operator for natural SOV word order.
Instead of writing the keyword first:
```python
ఒకవ x > 0:
(x)
```
You can write it in natural Telugu order — condition first, keyword after:
```python
x > 0 @@ఒకవ:
(x)
```
Both compile to the same Python. Decompile with postfix output using:
```bash
fpy decompile script.py --lang te --postfix
```
See [Postfix Syntax](https://foreignthon.keshavanand.net/postfix-syntax/) for full details.
---
## Start a project
```bash
fpy new myproject --lang te
cd myproject
fpy run src/main.te.py
```
---
## Documentation
→ [foreignthon.keshavanand.net](https://foreignthon.keshavanand.net/)
---
## Contributing
Found a missing translation or a better keyword for your language? Open an issue or PR — no access to the core repo is needed.
---
## License
GPL v3