From 2a82bc59fa13078283571aa3b9d7793309e4197f Mon Sep 17 00:00:00 2001 From: djoate <56777051+djoate@users.noreply.github.com> Date: Sun, 24 Nov 2019 13:43:26 -0500 Subject: [PATCH] Add support for translation notes To add a translation note, use it as a filter. For example, consider {% Free %} If we want to say that this means free as in no monetary value, wrap it around in {{ }} and apply the tl_note filter: {% {{ "Free" | tl_note: Free as in no monetary value }} %} The tl_note parameter will be ignored when this Liquid filter is parsed, but the entirety will be used as the keyed string. Just make sure that translators don't remove the quotes around "Free". --- _plugins/translate-filter.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_plugins/translate-filter.rb b/_plugins/translate-filter.rb index 30376223..936ccec6 100644 --- a/_plugins/translate-filter.rb +++ b/_plugins/translate-filter.rb @@ -38,6 +38,10 @@ module Jekyll "#{page}/#{page_language}" end end + + def tl_note(text, comment) + text + end end end