Re:Yagni Exceptions (2021)
by matsemann on Monday October 17, 2022 @08:06AM
(#33232411)
YAGNI ;) You can skip all those things the first time. You don't need to have a separate file or anything. Just have a stupid function returning its input or whatever. The important part is having an entry-point, and an easy way to find all relevant uses in the future. You could then later, when i18n is needed, write a script finding those usages and automatically extract them. That's what I've done once before. And it was a thousand times easier than the time before where we had to hunt through all of frontend, backend, cms etc. to find stuff.
[ Parent
| on HN ]
Re:Yagni Exceptions (2021)
by iLoveOncall on Monday October 17, 2022 @08:48AM
(#33232743)
> The important part is having an entry-point, and an easy way to find all relevant uses in the future.
You already have it, it's everything that's in between {{ }} and > </.
Do you want to translate numbers between ><? What about alt-texts not in those tags? Things passed as props multiple layers? What about strings coming from backend? Do you read some things from the environment?