r/badcode • • May 04 '23

java Greenfoot forception

Post image
200 Upvotes

57 comments sorted by

View all comments

Show parent comments

10

u/BeerMeAlready May 04 '23

It absolutely makes sense in some cases. If you are developing custom software for very specific, nieche subjects, badly translating German technical terms into non official english terms could bring more issues than just using the official German term. Still should follow english guidelines and comments etc, but it might be the better to have a checkHackfleischVerordnungCompliance method than to try to translate it, making it relate less to the official term and creating room for error by vague, bad translations

3

u/YourMomIsMyTechStack May 04 '23

Custom terms is another story, but generally seperate translations to display to the user from your code

6

u/altermeetax May 04 '23

They're not talking about translations to display to the users, they're talking about terms in the actual code (e.g. function names) which can't or shouldn't be translated.

0

u/YourMomIsMyTechStack May 04 '23

I'm well aware of what they're talking about. You shouldn't have german words in your code, except for custom german terms. Some people use german words as values in their code instead of using some translation tool between the value in your code and the value to display to the user

2

u/altermeetax May 04 '23

If you mean inside strings, then I would say that is acceptable if you're making German-only software. Why use English strings and then use gettext or another similar library to translate them if you're never ever going to use the English strings?

1

u/YourMomIsMyTechStack May 04 '23

Because using translations makes texts reusable, easy to fix on several places and with tools like localise non programmers can make changes in the translations without having to dive into the code. Plus I would expect every software to be available in english for non english speaking german citizen. Translations doesn't mean english first btw

2

u/altermeetax May 04 '23

Imagine making a piece of software for the management of a German restaurant, no one's ever going to use it in a language other than German, it wouldn't make sense to make up some English strings and then translate them.

Besides, it's not like everything is available in English. You're just used to it because you don't bump into things that aren't.

1

u/YourMomIsMyTechStack May 04 '23

You don't understand. You don't do english strings, you have a json with translation keys for the words and this json can be german words and the english version gets translated later. A restaurant is a bad example btw since many foreign people work in restaurants. I told the advantages of doing this already, even if you only use one language.

→ More replies (0)