0

In i18n, $t("myKey") displays the translation of myKey in current language. But what if I want the translation of myKey in a specified language?

Something like $t("myKey", "de"), except this doesn't work.

Is there any way to achieve this though?

drake035
  • 3,955
  • 41
  • 119
  • 229
  • 1
    Why not hardcoding it in that case? If you don't want to make it dynamic, write it statically. – kissu Jan 24 '23 at 13:00
  • check out this example https://codesandbox.io/s/example-i18n-k2431ywqm3?file=/locales/fr.json – Amaarockz Jan 24 '23 at 13:15
  • 1
    Does this answer your question? [How to force translate i18n in some specific text (variable) in Vuejs](https://stackoverflow.com/questions/68434953/how-to-force-translate-i18n-in-some-specific-text-variable-in-vuejs) – Debug Diva Jan 25 '23 at 06:44
  • 1
    @RohìtJíndal it does indeed! Thank you. – drake035 Feb 03 '23 at 00:05

0 Answers0