Why should we write types for translation keys? #30
Divinely5782
started this conversation in
General
Replies: 2 comments
-
Hi, This can be defined alternatively like this I think
otherwise
but in the second case you lose type safesty on the locales |
Beta Was this translation helpful? Give feedback.
0 replies
-
either way I suggest to use a different way for localization as this one is obslolete. Follow https://docs.astro.build/en/guides/internationalization/ I will release a template in the near future which will use the integrated way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I am new to TS and have just started to learn it and i have a question. Why do we have write types for translation keys? IMHO it is obvious that all translation in such simple websites are strings?
Thanks for answer!
declare interface Locales { home_description: string; about_description: string; }
Beta Was this translation helpful? Give feedback.
All reactions