User Pages - Multi-Language
In order to create user pages that will switch when the visitor or user selects a different language, you can use the following two approaches:
- create a shell page and language-specific page content
- use $text variables for the page content
Using language-specific pages
You can create the shell page using the historytemplate.php as shown in the User Pages - Getting Started
- In the section where it says to replace the text within the historytemplate.php file, you would enter something like the following
<?php include($cms['tngpath'] . "$mylanguage/your-page-name.php"); ?>
- In each of your language folders that you support on your web site, you would create the internal portion of the page that you normally would have put in the replace the text section.
This page should not have any of the TNG code snippets use to generate the page, nor have any HTML page and body tags.
You must of course provide the translation of the page text yourself.
See Post #5 in the following TNG Community Forum thread for an example provided to Randal
Using $text variables
Another alternative is to use $text variables when constructing the text portion of your pages that you would save in each of the different language folders you support on your web site.
- TextWrangler on the Mac