That depends on your Discourse version. I18n used to be globally defined so you didn’t need to import it on older Discourse versions.
If your site is on a recent commit like the OP, then you need to import / require it.
https://github.com/discourse/discourse/commit/eab560fe2aa9053f6d227d29ec6c1ad0939ea940