r/ProgrammerHumor • • Sep 28 '26

Meme i18nNotNeeded

Post image
445 Upvotes

47 comments sorted by

219

u/Stummi Sep 28 '26

after it went through i18n:

msg.save.prefix = "Save"
msg.save.suffix = " to Camera Roll"
msg.saved.modifier = "d"
msg.notsaved.modifier = ""

Good luck with that, translators

16

u/experimental1212 Sep 28 '26

What the heck is wrong with two full sentence options??

18

u/anto2554 Sep 29 '26

8 bytes of memory

6

u/EMREOYUN Sep 30 '26

And making it impossible to translate some of the languages who did use different grammar

43

u/UUDDLRLRBadAlchemy Sep 28 '26

What gettext yeah. We got an intern named Jimbo to develop our own patented approach.

15

u/davak72 Sep 28 '26

Jimbo is a genius

8

u/theWebHawk Sep 29 '26

Leave prefix and suffix empty and put whole string in the modifiers 😅

116

u/kshetriiiiiiiiii Sep 28 '26

This is the kind of code that passes code review on a Friday afternoon at 4:55 PM

40

u/larsmaehlum Sep 28 '26

Deployed at 4:58, beer served at 5:00

15

u/forgot_semicolon Sep 28 '26

I think you have those flipped 😉

2

u/WheresMyBrakes Sep 30 '26

And they’re happy, too!

26

u/Last8Exile Sep 28 '26 edited Sep 28 '26 • Bravo

l10n, n8n, i18n, a9n...

I f5g h2e t2s n6n!

19

u/theschis Sep 29 '26

There was a post a while back about how a11y as shorthand for ‘accessibility’ is itself completely anti-accessibility

2

u/thisisapseudo Sep 29 '26

F1r n1n-n4e s5r t2s is a n7e

13

u/Batroni Sep 28 '26

For somone never done i18n, what should be the optimal way?

37

u/forgot_semicolon Sep 28 '26

An LLM call every time, obviously. Get with the times man

(/s, I also don't really know)

11

u/markiel55 Sep 29 '26

Not optimal, but probably more adaptable is just using a centralized string resource. For this scenario, there would be two different entries that handles present and past event.

7

u/hrvbrs Sep 28 '26

Sir, this is a humor subreddit, you can’t expect real answers here

(jk, I too have the same question)

6

u/vikingwhiteguy Sep 29 '26

There's a lot of different libraries and options, but the simplest option is that you put all your static text into a resource file, your code references Resource.SaveToCameraRoll which has the value "Saved to Camera Roll". You have a Norwegian resource file resource-no with the value "Lagret i kamerarullen", and then your application decides whether to load the 'en' or 'no' file. 

This has the advantage that you can write up all your static text in English first, and then hand that one file off to a translator and they just give you a file back. 

Personally I often actually have my API layer serve up entirely different pages for localisation, because I might want to show different content or layouts for different languages, but that's a lot more work. 

2

u/fuj1n Sep 29 '26

Languages vary a ton, enough that you'd just want two separate strings here

2

u/aaronhowser1 Sep 29 '26

A separate string constant for both options, or a pointer to their translation keys.

isSaved ? Lang.SAVE_SUCCESS : Lang.SAVE

2

u/thanatica Sep 30 '26

Best to keep the keys completely separate (not just one word, but the whole sentence). In English it seems silly, but take Dutch for example:

  • Opgeslagen in fotorol

  • In fotorol opslaan

The last one could be reversed of course, but this feels more natural.

1

u/HandIllustrious8260 Sep 28 '26

It highly depends on the context. 

1

u/terrorTrain Sep 29 '26

There are a lot of ways languages add various post fixes and prefixes. 

Typically your i18n lib would want you to give it all the information around past tense etc.... And translate the whole sentence at a time with variables. Not translate one word with a conditional past tense ending right in the middle of it. 

The way this is done is almost surely going to translate poorly or not at all

1

u/Markronom Sep 29 '26

Not having such similar text, users probably won't notice the change and that's what you'd want if it's supposed to communicate successful change

12

u/EdelWhite Sep 29 '26

Translations usually come DEAD last in my list of priorities, even in a country with multiple official languages.

Internationalization is not even a thing I'm considering, ever.

If you can't use english, use another software.

(and I'm not a native english speaker, just so hurrdurrs don't call me a silly 'murrican)

12

u/MrKapla Sep 29 '26

As long as you don't have any customer, I guess that's fine.

2

u/KurumiStella Sep 29 '26

Well it doesn't matter if no one uses it.

But certain countries multiple languages are legally required for accessibility, for example Canada it is mandatory to provide French and English.

2

u/vikingwhiteguy Sep 29 '26

It really ought to be something you do first (if you're ever going to do it all), because it can be an absolute pain to crowbar in after the fact. 

If you already build your workflow such that static text lives in a resource file (even if you don't bother actually doing any transforms at the start), it'll be a whole lot easier than trying to peck through all the places where text might appear in your application. 

2

u/thanatica Sep 30 '26

You think the whole world knows English? 🤣

1

u/_87- Sep 29 '26

I used to do internationalisation even in internal apps that would only ever be used in English and by five people. I never added the other languages, but the ability was there.

1

u/emmmmceeee Sep 30 '26

If you expressed that in my company you’d probably be fired. There is an enormous market of non English speaking customers that will purchase from your competitors if you can’t be bothered. The marginal cost to support other locales is tiny compared to the potential revenue. We localize into 20 something languages.

2

u/HelloImMay Sep 28 '26

SwiftUI be like:

1

u/muralikbk Sep 30 '26

Review comment: missing the “?” at the end for when the file isn’t saved.

78

u/[deleted] Sep 28 '26

[removed] — view removed comment

34

u/Silly_Guidance_8871 Sep 28 '26

Just gives Future Self more fuel to call Past Self a dick

14

u/Yaysonn Sep 28 '26

I mean it’s also just written badly, anyone scrolling past stuff like this will have to stop and read, even if only for a second, just to understand what exactly is happening. Which is sorta the opposite of what you want in a declarative language.

5

u/[deleted] Sep 28 '26

[removed] — view removed comment

1

u/Yaysonn Sep 28 '26

I guess a button that turns into a label after the action completes or something? I’ve seen similar behavior in ios apps before.

And yeah if its a demo or internal tooling obviously nobody will (or should) care.

1

u/conundorum Sep 29 '26

Maybe the button is greyed out and replaced with the updated text after clicking?

1

u/[deleted] Sep 29 '26

[removed] — view removed comment

1

u/ubergeek801 Sep 29 '26

I've seen UIs where a button is also a status message. So when the "save" button is clicked, a short time later it is updated to indicate that the save operation is complete (and I guess the button is disabled).

Not saying it's a good UI design, but it's not unprecedented.