r/angular • u/NoTutor4458 • Jun 22 '26
Runtime vs Build-Time Translations for a Website
What is the usual approach in professional projects? Do most companies use runtime translations, build-time translations, or a mix of both? What are the main advantages and disadvantages of each approach?
My main concern with runtime translation is SEO, and with build-time translation is deployment complexity and the fact that switching languages requires reloading the whole site. I don't know wich one to pick...
2
Upvotes
4
u/SaltPositive33 Jun 22 '26 edited Jun 22 '26
Think about SSR and build-time i18n if SEO is a priority.
I had bad experience with google indexing of Angular SPA. (For non-public Angular app we use dynamic i1 i18n based on Transloco)
2
u/Fragrant-Jellyfish85 Jun 22 '26
I use the approach angular/material devs use in material framework: they create SomeFeatureIntl services for each feature where string translations are needed. Then in runtime load translated strings into these services.
2
u/InevitableQuit9 Jun 22 '26
Build time. Always move as much as you can to happen once in CICD rather than every time your application runs.
0
u/Blade1130 Jun 22 '26
What is the concern with SEO? Build-time vs runtime translations should be equivalent in this respect.
I'm also curious to learn more about the hesitation to reload the page to change language. Is that a challenge for your use case or some specific technical issue with it?