skill-sample-nodejs-fact icon indicating copy to clipboard operation
skill-sample-nodejs-fact copied to clipboard

what is .t() in this line of code randomFact = requestAttributes.t('FACTS');?

Open AyushiMidha opened this issue 6 years ago • 1 comments

I didn't get what is .t( ) in this line const randomFact = requestAttributes.t('FACTS');. Is t( ) is an inbuilt function? what is it doing?

AyushiMidha avatar Feb 10 '20 09:02 AyushiMidha

This is part of Interceptors method, to load strings const based on your language/locale of you Skill is

look at line 148 on attributes.t = function translate(...args) { this is where .t() is loaded with your strings 'FACTS' on bottom of file, you find all string to your skill based on language/locale

mauriliofilho avatar Feb 10 '20 13:02 mauriliofilho