Multilingual web site home page with t() function
PermalinkI’m utilizing Concrete5’s latest version 8.4.4.

t("Text String")
t($text_string)
where you have to translate the latter on the multilingual interface translation page in the Dashboard. But it's going to work if the multilingual setup is done correctly.
There is no PHP code block available for Concrete5’s latest version 8.4.4.
So how then let multiple PHP code sections including that t() function be inserted for that home page?
But is it compatible with latest Concrete5 version 8.4.4?
The add-on homepage doesn't include a descriptive text about the compatibilities.
But you shouldn't be approaching this as a coding problem. Its an organizational problem. The t() function is for interface strings, not for content. Whilst it could be hacked onto content, you would be creating a mechanism that would be fragile, difficult to work with and expensive to maintain.
As @mlocati notes, there is a lot more to a multilingual site than translating a few words of content. The site structure and navigation needs to be translated. Hence the c5 system of separate branches.
If you don't want to go that far and can accept a site infrastructure in a single language with some translated content, then have a look at c5DK's multilingual content block.https://www.concrete5.org/marketplace/addons/c5dk-multilingual-conte...
Sure, you may use an add-on that lets you add PHP code to the page (so that you can use t() calls).
BTW, t() is used to translate a string to the page language. Because concrete5 pages are always defined in a language tree (except for single pages), that wouldn't solve your problem: if a page is part of the English section, t() will translate strings to English. If a page is part of the Italian section, t() will translate strings to Italian.
So, t() is absolutely useless, unless you are working with single pages.
For my new international web site to be established, there will be a need for multiple languages.
For the 20 languages web site as an example then, I would need 20 duplicated pages to be created and maintained. That's just too stupid.
What I need for the Home page as an example, is a 1 Page only to maintain for the 20 languages in total.
If you have just one page:
- how would you let users choose the language?
- how would you translate non-content texts (like for example the page title)?
If you have content shared across different languages, you can use stacks: just define your content in a stack, then add that stack to every page you want.
Furthermore, having different pages lets you give write access to specific pages/languages to specific translators.
What I need consequently is to let home page and all other pages be based on a single page.
Has anyone succeeded in making such a single page based web site with a language selector for the site guests to appear in global area?