Compare commits

8 Commits

Author SHA1 Message Date
5443c67499 Fixed toml issue with tempalte
All checks were successful
Pack Validation CI / validate (push) Successful in 8s
Publish Language Pack / verify (push) Successful in 7s
Publish Language Pack / publish (push) Successful in 12s
2026-06-13 13:09:23 -04:00
9db5af9e07 Fixed toml issue with tempalte 2026-06-13 13:08:36 -04:00
16a16d9ba7 fixed init.py path
All checks were successful
Pack Validation CI / validate (push) Successful in 8s
Publish Language Pack / verify (push) Successful in 7s
Publish Language Pack / publish (push) Successful in 12s
2026-06-13 12:39:38 -04:00
6adedad265 bugfix
All checks were successful
Pack Validation CI / validate (push) Successful in 8s
Publish Language Pack / verify (push) Successful in 7s
Publish Language Pack / publish (push) Successful in 16s
2026-06-13 12:26:37 -04:00
2aa4c05c2d Merge pull request 'chatgpt readme :3' (#4) from update-readme into main
Some checks failed
Pack Validation CI / validate (push) Failing after 8s
Trigger Docs Rebuild / trigger (push) Successful in 2s
Reviewed-on: #4
2026-06-13 16:21:22 +00:00
2265e9f5ee chatgpt readme :3
Some checks failed
Pack Validation CI / validate (pull_request) Failing after 10s
2026-06-13 11:17:53 -05:00
b075faf2e2 Merge pull request 'finished beta version' (#3) from populate-json into main
Some checks are pending
Pack Validation CI / validate (push) Waiting to run
Reviewed-on: #3
2026-06-13 16:06:43 +00:00
e34a08a5ba finished beta version
Some checks failed
Pack Validation CI / validate (pull_request) Has been cancelled
2026-06-13 11:04:21 -05:00
5 changed files with 168 additions and 216 deletions

123
README.md
View File

@@ -1,54 +1,33 @@
<!-- =========================================================
FOREIGNTHON LANGUAGE PACK README TEMPLATE
---------------------------------------------------------
Replace every line marked ← REPLACE with real content.
Remove all comment blocks before publishing.
========================================================= -->
# foreignthon-te
# foreignthon-xx <!-- ← REPLACE xx with your language code, e.g. foreignthon-fr -->
<!-- ← REPLACE with a one-line description -->
French language pack for [ForeignThon](https://foreignthon.keshavanand.net/) — write Python in Français.
Telugu language pack for [ForeignThon](https://foreignthon.keshavanand.net/) — write Python in తెలుగు.
---
## Install
```bash
pip install foreignthon foreignthon-xx
pip install foreignthon foreignthon-te
```
<!-- ← REPLACE xx in the line above -->
---
## Example
<!-- =========================================================
Write a short .xx.py file that shows your language in action.
Good things to include: a loop, a conditional, a function,
print, and at least one exception type.
Then show the compiled Python output below it so readers can
see the direct mapping.
========================================================= -->
**`fizzbuzz.xx.py`**
**`fizzbuzz.te.py`**
```python
<!-- REPLACE this block with a real .xx.py file in your language -->
pour i dans intervalle(1, 21):
si i % 15 == 0:
afficher("FizzBuzz")
sinonsi i % 3 == 0:
afficher("Fizz")
sinonsi i % 5 == 0:
afficher("Buzz")
sinon:
afficher(i)
రతి i పల పరిి(1, 21):
ఒకవ i % 15 == 0:
("FizzBuzz")
కప_ఒకవ i % 3 == 0:
("Fizz")
కప_ఒకవ i % 5 == 0:
("Buzz")
ిపక:
(i)
```
<!-- ← REPLACE the block above. Run fpy compile fizzbuzz.xx.py to get the output below -->
Compiles to standard Python:
```python
@@ -66,91 +45,71 @@ for i in range(1, 21):
Run it directly without compiling first:
```bash
fpy run fizzbuzz.xx.py
fpy run fizzbuzz.te.py
```
---
## Keyword reference
<!-- =========================================================
Fill in the most important keyword mappings.
You don't need to list every single one — pick the ones
a new user would reach for first.
========================================================= -->
| Python | <!-- ← language name, e.g. Français --> |
| Python | తెలుగు |
|---|---|
| `if` | <!-- ← your word --> |
| `else` | <!-- ← your word --> |
| `elif` | <!-- ← your word --> |
| `for` | <!-- ← your word --> |
| `while` | <!-- ← your word --> |
| `def` | <!-- ← your word --> |
| `class` | <!-- ← your word --> |
| `return` | <!-- ← your word --> |
| `import` | <!-- ← your word --> |
| `True` | <!-- ← your word --> |
| `False` | <!-- ← your word --> |
| `None` | <!-- ← your word --> |
| `print` | <!-- ← your word --> |
| `input` | <!-- ← your word --> |
| `len` | <!-- ← your word --> |
| `range` | <!-- ← your word --> |
| `if` | `ఒకవేళ` |
| `else` | `లేనిపక్షంలో` |
| `elif` | `లేకపోతే_ఒకవేళ` |
| `for` | `ప్రతి` |
| `while` | `ఎంతవరకు` |
| `def` | `రూపొందించు` |
| `class` | `మాదిరి` |
| `return` | `ఇవ్వు` |
| `import` | `చేర్చు` |
| `True` | `అవును` |
| `False` | `కాదు_విలువ` |
| `None` | `శూన్యం` |
| `print` | `చూపు` |
| `input` | `అడుగు` |
| `len` | `పొడవు` |
| `range` | `పరిధి` |
The full mapping is in [`xx.json`](https://git.keshavanand.net/foreign-thon/foreignthon-xx/raw/branch/main/src/foreignthon_xx/xx.json).
<!-- ← REPLACE xx in the line above with your language code -->
The full mapping is in [`te.json`](https://git.keshavanand.net/foreign-thon/foreignthon-te/raw/branch/main/src/foreignthon_te/te.json).
---
<!-- =========================================================
POSTFIX SECTION — only include this if your language uses
SOV (subject-object-verb) word order, i.e. postfix_keywords
in your JSON is non-empty. Delete this entire section if
your language is SVO (like Spanish, French, etc.).
========================================================= -->
## Postfix syntax
<!-- ← REPLACE the example below with one from your language -->
This pack supports the `@@` postfix operator for natural SOV word order.
Instead of writing the keyword first:
```python
ஆன x > 0:
பதிி(x)
ఒకవ x > 0:
(x)
```
You can write it in natural Tamil order — condition first, keyword after:
You can write it in natural Telugu order — condition first, keyword after:
```python
x > 0 @@ஆன:
பதிி(x)
x > 0 @@ఒకవ:
(x)
```
Both compile to the same Python. Decompile with postfix output using:
```bash
fpy decompile script.py --lang xx --postfix
fpy decompile script.py --lang te --postfix
```
See [Postfix Syntax](https://foreignthon.keshavanand.net/postfix-syntax/) for full details.
<!-- END POSTFIX SECTION -->
---
## Start a project
```bash
fpy new myproject --lang xx
fpy new myproject --lang te
cd myproject
fpy run src/main.xx.py
fpy run src/main.te.py
```
<!-- ← REPLACE xx above -->
---
## Documentation
@@ -167,4 +126,4 @@ Found a missing translation or a better keyword for your language? Open an issue
## License
GPL v3
GPL v3

View File

@@ -24,7 +24,7 @@ classifiers = [
Homepage = "https://git.keshavanand.net/foreign-thon/foreignthon-te"
[project.entry-points."foreignthon.langs"]
template = "foreignthon_te"
te = "foreignthon_te"
[tool.hatch.build.targets.wheel]
packages = ["src/foreignthon_te"]

View File

@@ -26,4 +26,4 @@ except PackageNotFoundError:
def get_pack_path():
# TODO: Modify this path
return files(__name__) / "template.json"
return files(__name__) / "te.json"

125
src/foreignthon_te/te.json Normal file
View File

@@ -0,0 +1,125 @@
{
"meta": {
"name": "Telugu",
"native_name": "తెలుగు",
"code": "te"
},
"keywords": {
"ఒకవేళ": "if",
"లేనిపక్షంలో": "else",
"లేకపోతే_ఒకవేళ": "elif",
"ప్రతి": "for",
"ఎంతవరకు": "while",
"రూపొందించు": "def",
"మాదిరి": "class",
"ఇవ్వు": "return",
"విరమించు": "break",
"ముందుకెళ్లు": "continue",
"ఖాళీగా_ఉచు": "pass",
"యత్నించు": "try",
"పొరపాటు": "except",
"ముగింపుగా": "finally",
"ఎగరేయి": "raise",
"వాడుతూ": "with",
"చేర్చు": "import",
"నుంచీ": "from",
"పేరుతో": "as",
"లోపల": "in",
"అదే": "is",
"మరియు": "and",
"లేదంటే": "or",
"కాదు": "not",
"తొలగించు": "del",
"సర్వత్ర": "global",
"బయటస్థ": "nonlocal",
"నిర్ధారించు": "assert",
"ఉత్పత్తిచేయి": "yield",
"వేచిచూడు": "await",
"అసమకాల": "async",
"సూక్ష్మక్రియ": "lambda",
"అవును": "True",
"కాదు_విలువ": "False",
"శూన్యం": "None"
},
"builtins": {
"చూపు": "print",
"అడుగు": "input",
"పొడవు": "len",
"పరిధి": "range",
"రకం": "type",
"పూర్తిసంఖ్య": "int",
"దశాంశం": "float",
"వాక్యం": "str",
"జాబితా": "list",
"నిఘంటువు": "dict",
"సమితి": "set",
"జత": "tuple",
"తార్కికం": "bool",
"తెరువు": "open",
"క్రమసంఖ్యతో": "enumerate",
"మార్పు": "map",
"వడపోసు": "filter",
"క్రమబద్ధం": "sorted",
"మొత్తం": "sum",
"అత్యల్పం": "min",
"అత్యధికం": "max",
"పరమ": "abs",
"గుండ్రపరచు": "round",
"అన్నీ": "all",
"ఏదైనా": "any",
"తదుపరి": "next",
"గుర్తింపు": "id",
"అక్షరం": "chr",
"తిరగమారు": "reversed"
},
"exceptions": {
"మినహాయింపు": "Exception",
"మూలమినహాయింపు": "BaseException",
"విలువలోపం": "ValueError",
"రకంలోపం": "TypeError",
"కీలకలోపం": "KeyError",
"స్థానలోపం": "IndexError",
"లక్షణలోపం": "AttributeError",
"పేరులోపం": "NameError",
"చేర్పులోపం": "ImportError",
"దస్త్రంలేదు": "FileNotFoundError",
"నిర్వహణలోపం": "RuntimeError",
"సున్నాతోభాగహారం": "ZeroDivisionError",
"వ్యాకరణలోపం": "SyntaxError",
"నిర్ధారణలోపం": "AssertionError",
"జ్ఞాపకలోపం": "MemoryError",
"మితిమీరినవిలువ": "OverflowError",
"పునరావృతిమితి": "RecursionError",
"అనుమతిలేదు": "PermissionError",
"సమయముగిసింది": "TimeoutError",
"వ్యవస్థనిష్క్రమణ": "SystemExit",
"కీబోర్డు_అతరాయ": "KeyboardInterrupt"
},
"stdlib": {
"గణితం": "math",
"వ్యవస్థ": "sys",
"తేదీసమయం": "datetime",
"సమయం": "time",
"యాదృచ్ఛికం": "random",
"సేకరణలు": "collections",
"మార్గాలు": "pathlib",
"నమూనాలు": "re"
},
"postfix_keywords": [
"for",
"while",
"def",
"class",
"return",
"try",
"raise",
"with",
"import",
"from"
]
}

View File

@@ -1,132 +0,0 @@
{
"meta": {
"name": "Template",
"native_name": "Template",
"code": "template"
},
"keywords": {
"if": "if",
"else": "else",
"elif": "elif",
"for": "for",
"while": "while",
"def": "def",
"class": "class",
"return": "return",
"break": "break",
"continue": "continue",
"pass": "pass",
"try": "try",
"except": "except",
"finally": "finally",
"raise": "raise",
"with": "with",
"import": "import",
"from": "from",
"as": "as",
"in": "in",
"is": "is",
"and": "and",
"or": "or",
"not": "not",
"del": "del",
"global": "global",
"nonlocal": "nonlocal",
"assert": "assert",
"yield": "yield",
"await": "await",
"async": "async",
"lambda": "lambda",
"True": "True",
"False": "False",
"None": "None"
},
"builtins": {
"print": "print",
"input": "input",
"len": "len",
"range": "range",
"type": "type",
"int": "int",
"float": "float",
"str": "str",
"list": "list",
"dict": "dict",
"set": "set",
"tuple": "tuple",
"bool": "bool",
"open": "open",
"enumerate": "enumerate",
"map": "map",
"filter": "filter",
"sorted": "sorted",
"sum": "sum",
"min": "min",
"max": "max",
"abs": "abs",
"round": "round",
"all": "all",
"any": "any",
"next": "next",
"id": "id",
"chr": "chr",
"reversed": "reversed"
},
"exceptions": {
"Exception": "Exception",
"BaseException": "BaseException",
"ValueError": "ValueError",
"TypeError": "TypeError",
"KeyError": "KeyError",
"IndexError": "IndexError",
"AttributeError": "AttributeError",
"NameError": "NameError",
"ImportError": "ImportError",
"FileNotFoundError": "FileNotFoundError",
"RuntimeError": "RuntimeError",
"ZeroDivisionError": "ZeroDivisionError",
"SyntaxError": "SyntaxError",
"AssertionError": "AssertionError",
"MemoryError": "MemoryError",
"OverflowError": "OverflowError",
"RecursionError": "RecursionError",
"PermissionError": "PermissionError",
"TimeoutError": "TimeoutError",
"SystemExit": "SystemExit",
"KeyboardInterrupt": "KeyboardInterrupt"
},
"error_messages": {
"SyntaxError": "SyntaxError",
"ValueError": "ValueError",
"TypeError": "TypeError",
"KeyError": "KeyError",
"IndexError": "IndexError",
"AttributeError": "AttributeError",
"NameError": "NameError",
"ImportError": "ImportError",
"FileNotFoundError": "FileNotFoundError",
"ZeroDivisionError": "ZeroDivisionError",
"RecursionError": "RecursionError",
"RuntimeError": "RuntimeError",
"MemoryError": "MemoryError",
"OverflowError": "OverflowError",
"AssertionError": "AssertionError",
"PermissionError": "PermissionError",
"TimeoutError": "TimeoutError",
"KeyboardInterrupt": "KeyboardInterrupt"
},
"stdlib": {
"math": "math",
"sys": "sys",
"datetime": "datetime",
"time": "time",
"random": "random",
"collections": "collections",
"pathlib": "pathlib",
"re": "re"
},
"postfix_keywords": [
]
}