Internationalization: Backend or Frontend Translation?

I’m building a website using AngularJS for the front end and a Java-based API for the back end. While I’ve implemented internationalized error messages on the API server, I’m debating where to handle the translation of API responses. For example, if a French user requests a specific item, should the server send back a pre-translated object, or should the client-side AngularJS perform the translation? I’m looking for insights on the best approach.

Based on my experience, I lean toward server-side translation for maintaining a streamlined client environment. By processing language-specific responses on the server, business logic and localization can be managed more centrally and consistently. This approach reduces potential overhead on the client, particularly when multiple views or rapid translations are involved. It also simplifies debugging as all related translations reside in a single location. However, it remains crucial to consider system design and performance, as both scenarios have merits depending on the specific application needs.

i’d push translations to the client side. api can just send simple keys while angular handles localized text. this makes updating messags easier without touchin the backend every time, but u gotta keep both sides in sync.

hey, i’ve been thinkin maybe a mix might work well? doing some translations clientside offers flexibility but leaving key details server side can ease maintenance. what have you guys seen in your projects that makes the difference for performance and ease?

Based on my experience, a hybrid approach can balance flexibility with centralized control. The server should identify language settings and send back neutral data along with keys while the client handles the final localized text rendering. This separation of concerns reduces the risk of translation discrepancies and keeps business logic isolated from presentation details. It also allows for easier updates to localization files without impacting server performance, which is particularly beneficial for larger applications with frequent language updates or varying client requirements.