![]() |
|
how to : force a language for translated string - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: how to : force a language for translated string (/thread-12960.html) |
how to : force a language for translated string - vincent3569 - 01-08-2017 I am writing a piwik plugin (I use the unsupported existing one). I want to log pages title, but only in one language (french). I found the way to force zenphoto items titles ( But I didn't find the way to force translation of translated strings (as I tried the function Have you a solution to force translation? Or to well configure the function above? thanks in advance for your help. how to : force a language for translated string - acrylian - 01-08-2017 On class level you can actually request a translation string for each field that is multilingual capable using If you really have a multilingual site and what it tracked correctly I suggest to use the subdomain way suggested. That can be set via the seo_locale plugin. So your main domain (www.)example.com is one language, in your case probably French and for all other language you use subdomains for example en.example.com. That way you have separate urls for each language which naturally is recommended for SEO anyway. Piwik should be able to see these as separate site (may depend on its settings, can't say right now). how to : force a language for translated string - vincent3569 - 01-08-2017 my piwik JS code is generated on server side via my plugin (you cas see older one in https://github.com/zenphoto/Unsupported/tree/master/plugins/piwik). I don't want to have subdommain, only track my multi-language site with one language (as every visitor was french for example). Can you point me in the right direction to use For example, to force display french title of the album stored in
tks how to : force a language for translated string - acrylian - 01-08-2017 Okay, but I really recommend to use subdomains if you really need multilingual sites for SEO reasons alone. And I assume you care a bit about that as a site owner. Multilingual is really only recommend when you actually have your content texts in those languages and not jus the default strings covered via gettext translations. You have to get the raw fields so you get the full array with all languages. You can do that via for example how to : force a language for translated string - vincent3569 - 02-08-2017 hi can you confirm this 2 syntaxes have the same behavior and give the same result :
behavior: give the fr_FR string, or the en_US string if fr_FR doesn't exist, or the first string which ever is present, if first ones don't exist ? how to : force a language for translated string - acrylian - 02-08-2017 Yes, all multilingual capable functions use this function internally (the method |