Access the translations within a helper function #5190
Answered
by
stevenjoezhang
lorezyra
asked this question in
Question / Answer
-
How should one use Ideally, I'd like to use the |
Beta Was this translation helpful? Give feedback.
Answered by
stevenjoezhang
Apr 19, 2023
Replies: 1 comment 2 replies
-
Use hexo.extend.helper.register('post_edit', function(src) {
const { post_edit } = this.theme;
if (!post_edit.enable) return '';
return this.next_url(post_edit.url + src, '<i class="fa fa-pen-nib"></i>', {
class: 'post-edit-link',
title: this.__('post.edit')
});
}); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
lorezyra
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
this.__
. For example: