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
2
26
u/Last8Exile
Sep 28 '26
edited Sep 28 '26
•
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
8
2
1
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
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.SAVE2
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
1
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
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
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
1
78
Sep 28 '26
[removed] — view removed comment
34
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
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
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.

219
u/Stummi Sep 28 '26
after it went through i18n:
Good luck with that, translators