What do you get from the t custom Twig filter (translate string to current language)? What do you get for a result if you output {{ 'MY_STRING'|t }}. If it's empty or undefined, you should be able to simply put an if in front of it, do if .. is defined, if .. is not empty etc.
Is language supported: html_lang in config.system.languages.supported
Is translation available: html_lang == grav.language.getLanguage
Does string have translation: 'TRANSLATE_ME'|t != 'TRANSLATE_ME'
Created a site with the following settings:
YAML
/user/config/system:languages:supported:(Note:no Spanish)-it-fr-entranslations:truetranslations_fallback:false/user/config/site:default_lang:enuser/pages/01.home (Note:page for supported languages + Spanish)default.en.mddefault.fr.mddefault.it.mddefault.es.md
The site has a theme with the following translations:
YAML
languages.yaml:(Note:No Italian, No Spanish)fr:TRANSLATE_ME:Traduis-moien:TRANSLATE_ME:Translate me
This setup yielded the following when browsing to the different pages:
YAML
http://localhost/grav-dev/enhtml_lang:enIs language supported:Yeshtml_lang == getLanguage:YesIs translated:YesTranslation:Translate mehttp://localhost/grav-dev/frhtml_lang:frIs language supported:Yeshtml_lang == getLanguage:YesIs translated:YesTranslation:Traduis-moihttp://localhost/grav-dev/ithtml_lang:enIs language supported:Yeshtml_lang == getLanguage:NoIs translated:NoTranslation:TRANSLATE_MEhttp://localhost/grav-dev/es -> Page does not exist errorhtml_lang:enIs language supported:Yeshtml_lang == getLanguage:NoIs translated:NoTranslation:TRANSLATE_ME