I want to translate Python into Albanian language.Like to use albanian with my editon bcs it's similar to eng and instead of typing the commands in engl it will be typed in albanian.Can everybody anybody help me out???
Asked
Active
Viewed 228 times
0
-
2You can name variables, functions, classes, etc. in whatever language you want. The Python keywords and built-in functions can not be changed. – MattDMo Feb 13 '15 at 19:40
-
http://stackoverflow.com/questions/202723/coding-in-other-spoken-languages this is sorta related, and you might find it interesting reading – TehTris Feb 13 '15 at 19:47
-
I suggest typing in your language and creating another script to parse an translate with regular expressions. – Malik Brahimi Feb 13 '15 at 20:03
1 Answers
0
If you feel like it's worth it, you could use regular expressions and a dict
structure to "translate" your native Albanian into vanilla Python code. Doing so would involve mapping each function name, built in variable name, etc., to it's equivalent: dictionary = { 'print': 'shtyp', 'dict': 'fjalor'}
Then run your code, as a text file, through your translator.
asdf = fjalor(a=1)
shtyp asdf
becomes
asdf = dict(a=1)
print asdf

H.R.
- 16
- 2
-
What about keywords that aren't functions like `if` `and` `in` `or`? – Malik Brahimi Feb 13 '15 at 20:07
-
Re.: Malik Brahimi, there's no reason you couldn't translate those too. The way I invison it, one would use regular expressions to iterate over the entire file, pulling out only whole words (so you don't translate the 'if' in 'knife', etc.), get the word length, and crossreference with a set of dictionaries. Honestly, I think that, especially for a language like Python, which is popular for those new to programming/scripting in general, that could be very beneficial for the community. Like, in schools, etc. – H.R. Feb 14 '15 at 23:54
-
Yes, I know. That is exactly what I did in [this](http://stackoverflow.com/questions/28507958/how-do-i-change-a-python-interpreter-from-english-to-my-dialect/28508362#28508362) thread. – Malik Brahimi Feb 15 '15 at 00:25