To translate a string in a template, do
<% _t('CLassOrTemplateName.SOMEPHRASE', 'Some Phrase') %>
You can put that lang directory in mysite, then create a file mysite/lang/en.yml like so
SOMEPHRASE: 'Some Phrase'
SOMEOTHERPHRASE: 'Some other Phrase'
Then for another language xx.yml:
SOMEPHRASE: 'Some xx translation'
SOMEOTHERPHRASE: 'some other xx translation'
'ClassOrTemplate' can be any name, but the idea is that the name points in the direction of the file where the translation is being used. So you could use something like MyTemplate_ss to make a distinction between classes and templates...
Originally in templates, you would omit 'ClassOrTemplateName': the languagefile would then just (autmatically) use the name of the template file. But that wouldn't always work with nested and included templates.