-
I know this is probably a bad idea considering how typesafe-i18n works, but I've been asked if it's possible and I would like to provide a good answer to it 😄 Would it be possible to get a Given I have the I've seen that But would it be possible in some ugly, hacky way to add a translation and have everything work though? My own explorations say that no, this is not possible to do, but I might have missed something and in reality it could be easier than I thought. 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
By default If you just want to load locales in a different way you can also manually set the If you really want to opt opt of the typesafety features, you can load I know of some companies that use a combined approach. They save translations to the Git repo once per day to check if translations contain an error, but also load the translations on runtime once per hour to get the latest strings. Maybe this is a solution you want to apply to your project too. |
Beta Was this translation helpful? Give feedback.
By default
typesafe-i18n
generates a lot of boilerplate code for you. This works fine for 95% of projects I guess. If you want to customize the behavior, just set thegenerateOnlyTypes
-option totrue
and modify the files like you need them.If you just want to load locales in a different way you can also manually set the
loadedLocales
object insidei18n/i18n-util.ts
.If you really want to opt opt of the typesafety features, you can load
Translations
via a ´fetch` calls in runtime, but you will not know if the translated strings contain an error.I know of some companies that use a combined approach. They save translations to the Git repo once per day to check if translations contain an er…