Skip to main content

Localization

  • useTranslationuseSafeTranslation hook

    • Pass in the "namespace" as the parameter  image.png

  • Define string lookup keys as enums

    • Need to be single strings with no spaces

  

  • Use the "t" method

    • If the key doesn't exist it will be added

    • Must run the code and navigate to location

 

 

 

  • locales folder contains all the string translations

    • Namespace matches the name of the json file

  

  • If rendering of page needs to wait for the json file to be loaded in use the ready value from useSafeTranslation, around the return value. (May need if page doesn't load and you get white screen)

image.png

image.png