I don’t understand why you’re downvoted — Sometimes small questions help learners or beginners; I guess that defeats the expectation of everyone on coding subreddits being a programming god? Who knows…
Not sure exactly what the previous comment said before it was deleted. But assuming the full source was leaked (well, at least you have this Rosetta Stone of a header)… you can run the code through only the C Preprocesser stage and have normalish C code. For GCC that’s simply gcc -E
Oh, good call. I suppose you could protect the include’s with sed or awk (s/#include/XXXincludeXXX/, preprocess, and convert them back. Just need to make sure to keep the include for this silly translation header. Actually, I think you can force an include which is even better since it might get included transitively. -include?
msvc has already a compilation flag to generate those files after the preprocessor step. I had to use it once to debug a complex macro, oh boy it was verbose with all the extended includes
Yeah. That is true. I commented on another thread that at least one method to keep things somewhat sane would be to use sed to protect the includes. Something like cat file.c | sed 's/#include/XXincludeXX' | gcc -E -include stupid_translation_header.h -o- -xc - | sed 's/XXincludeXX/#include/' Also, -fdirectives-only might be useful.
A custom script could be a better option, but it isn’t as trivial as it might seem at first glance.
Well, yeah, not trivial at all if done properly; it would probably be enough, though, to simply replace text occurrences of Polish words, from the longer to the shortest, with what those defines assign them to. (And the assigns could be isolated in a single file and matched via regular expressions.) Any hardcoded strings containing any such occurrences would be compromised, but that shouldn't be a problem for anyone trying to understand how their software works.
Anyway, I'd bet that, if at that company they're translating C++ in their native natural language, they're not the kind of developers that would be doing something worthy of anyone's interest in digging through their source code. LOL Oh, that is, though — unless they're doing some project for the government, in which case it might matter strategically! (Mostly joking, but who knows...)
Interestingly though, it seems IDEs could build i18n into the language itself. It could be a good way to do things - the codebase is "linted" to the default language, but users write in their language.
Bonus points for variable names (if they stick to pascalcase or something that could be doable).
This comment, along with others, has been edited to this text, since Reddit is killing 3rd party apps, making false claims and more, while changing for the worse to improve their IPO. I suggest you do the same. Soon after editing all of my comments, I'll remove them.
// C (polish translation)
#define automatyczna auto
#define stała const
#define przecin double
#define zmien_przecin float
#define cyfra int
#define krótka short
#define struktura struct
#define niepodpisany unsigned
#define wybij break
#define dalej continue
#define inaczej else
#define dla for
#define długa long
#define podpisany signed
#define wymień switch
#define pusty void
#define wypadek case
#define wyliczenie enum
#define idźdo goto
#define rejestr register
#define wielkość sizeof
#define nowytyp typedef
#define ulotna volatile
#define litera char
#define zrób do
#define zewnętrzny extern
#define jak if
#define oddaj return
#define statyczny static
#define unia union
#define podczas while
Ah yes it's the same in Swedish. The real word is "heltal' but in general people will use siffra for both integer and decimal numbers and heltal is more mathematical/formal
Oh really? I just checked and it might have been russian then.
On the topic of Bulgarian and Russian I think it's hilarious that направо (not sure about the spelling) means straight up in Bulgarian but in Russian it means to the right (also Czech)
The real badcode part of this is the mistranslations: switch (replace), case (acident), signed (signed, as in signing a document), unsigned (not signed, as in signing a document), double (comma?), float (change comma).
I remember when i was on high school one guy had as his final work to create programming language and he just redefined keywords in similar fashion as this post. The teacher was like "Are you fcking kidding me?" because the guy didn't consulted the work with him much.
Don't know the polish word for death, but in Czech it's smrt (also russian I think), and since it doesn't have vocals it looks like just random letters
ř is a š, but the the tip of your tongue should touch the center of your top mouth cavity, instead of the front(where your teeth are). If you do correctly, you should get it.
Yeah I noticed in Prague, I met three girls, one from Russia, one from Belarus, and the third Ukraine, and they all spoke their native language to eachother. Much like us Scandinavians though(although younger people can't understand other scandinavian languages well so have to speak English with them)
412
u/DaniilSan Apr 15 '23
This isn't bad code. This is based code, even if it means to be unmaintainable by foreigners. Job security I would call it.
54
u/Ultra980 Apr 15 '23 edited Jun 09 '23
This comment, along with others, has been edited to this text, since Reddit is killing 3rd party apps, making false claims and more, while changing for the worse to improve their IPO. I suggest you do the same. Soon after editing all of my comments, I'll remove them.
Fuck reddshit and u/spez!
17
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Apr 15 '23 edited Apr 16 '23
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
12
u/eruanno321 Apr 15 '23
Unless compiling such code causes fatalities, there is very little sense in translating "case" to "wypadek".
3
u/Marcelektro Apr 15 '23
Do you possibly have a repo with this, or a gist? Id love to try it myself and make a functional app with polish keywords xD
3
u/TurncoatTony Apr 15 '23
People actually use auto in C?
317
u/ChiefPastaOfficer Apr 15 '23
#define kurwa throw
82
u/ebalonabol Apr 15 '23
Lmao they translated "signed" as in "signed documents" xD
35
u/Vivid-Sherbet Apr 15 '23
public static pusty main(String[] args) {}
34
u/ImAMouseInAHouse Apr 15 '23
ok, I'm keeping "pusty" though
58
u/Marcelektro Apr 15 '23
“if” keyword should probably be “jeżeli", makes more sense.
64
u/fiddz0r Apr 15 '23 edited Apr 15 '23
There's too few cszscszs in those words. Can't be polish!
Edit: I also noticed the word cyfra which is not too far away from Swedish siffra
10
u/ikonfedera Apr 15 '23
signed should be oznakowana
switch - przełącz
if - jeżeli
return - zwróć
while - gdy
This is to ensure compatibility with existing Polish documentation. Also just sounds better.
7
u/myhntgcbhk Apr 15 '23
pusty
6
u/SatanicTriangle Apr 15 '23
Christ.... What a terrible day to understand polish
3
u/damix69420_ Apr 15 '23
https://github.com/latinary/lat_pp
3
u/Hmmmnnmm Apr 15 '23
Okay I’m convinced typedef should be nowytyp now
3
u/mrheseeks Apr 15 '23
ifndef lunch
define kielbasa deeznuts
endif
3
u/KarBoy2314PL Apr 15 '23
5
u/[deleted] Apr 15 '23
The real badcode part of this is the mistranslations: switch (replace), case (acident), signed (signed, as in signing a document), unsigned (not signed, as in signing a document), double (comma?), float (change comma).
2
u/creeper6530 wicked Apr 15 '23
As a guy from Czechia (Poland's neighbors) I fully enjoy it.
4
u/3nd3rCr0w1ng Apr 15 '23
Why is this bad? Can someone explain?
1
u/[deleted] Apr 15 '23
Heh "pusty void"
1
u/Nachf Apr 16 '23
wrong sub...
1
u/unsigndid Apr 16 '23
I do so wonder what happens if I write code with them
1
u/[deleted] Apr 16 '23
Why are you doing this to me.
1
u/Such-Bar-2351 Apr 16 '23
Im not sure what sucks harder, code or translation
1
u/dvidsnpi Apr 16 '23
so wrong on so many levels 😂
1
u/AverageSrbenda Apr 16 '23
Let me introduce you to Ћ++
1
u/ziza148 Apr 16 '23
Reminds me of Ostra Java - pun on Sharp java and Ostrava which dialect it uses. https://github.com/tkohout/OSTRAJava
1
u/100c1p43r Apr 16 '23
There is one missing: isPies
1
u/MapsCharts Apr 16 '23
This is based
1
u/JustSpaceExperiment Apr 16 '23
Please someone needs to build app that transpiles into C polish version :D
1
u/JustSpaceExperiment Apr 16 '23
I remember when i was on high school one guy had as his final work to create programming language and he just redefined keywords in similar fashion as this post. The teacher was like "Are you fcking kidding me?" because the guy didn't consulted the work with him much.
1
u/JustSpaceExperiment Apr 16 '23
This is basically low code way of creating new programming languages.
1
u/Hacks_Depth460 Apr 17 '23
There are some similarities with Russian.
0
u/[deleted] Apr 15 '23
[deleted] — view deleted comment
-5
u/[deleted] Apr 15 '23
[removed] — view removed comment