0

I'm currently working on a Turborepo project (monorepo architecture) and I have managed t share my locales files to both back-end and front-end parts. This means I share the exact same keys across those 2.

When coming to internationalization, I've asked myself few questions and came to these conclusions:

  • Server sending back translation keys is great since my applications share them, but adding a new key / modifying it is quite a labor for what it is (or am I overkilling it?)

  • Server sending back full translated messages is also great because it makes the client-side kind of a dumb renderer. Thing is, the server should keep in mind the user's language. What if there is no language ? (e.g. Wrong Credentials error -> the user is not connected, therefore I have no source of truth regarding its language)

  • Client-side translation based on HttpCodes sent back by the server and associate a translation on the go, ~meh~.

What is considered "the best practice"?

asked Jun 20, 2023 at 14:48
2
  • I'm confused by your last two bullet points. What do you mean by "Wrong Credentials" Commented Jun 22, 2023 at 17:37
  • Please clarify what you mean by "Client-side translation of HttpCodes". How does the HTTP protocol matter to text that is visible to an end user? Commented Jun 22, 2023 at 17:38

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.