polyglot icon indicating copy to clipboard operation
polyglot copied to clipboard

Support liquid tags `t` similar to multiple-languages plugin

Open pke opened this issue 4 years ago • 2 comments

This plugin seems to be only able to translate pages and posts in whole, not individual parts using liquid directives like {% t key %}?

pke avatar Apr 30 '20 12:04 pke

Yes, this plugin is focused on helping entire pages and posts be translated.

You can use your data directory and refer to language specific rich-text strings though. See the site directory for more details

untra avatar Apr 30 '20 13:04 untra

In my case I migrated my code from using jekyll-multiple-languages-plugin to use polyglot. Previously I used a lot of {% t key %}, but now not so much is needed. Where I still wanted to use that approached what I did was:

  • moved my keys from _i18n/LANG.yml to _data/LANG/strings.yml
  • use them as {{ site.data[site.active_lang].strings.key }}

george-gca avatar Feb 25 '24 17:02 george-gca

I believe this can be closed now.

george-gca avatar Mar 06 '24 00:03 george-gca