The multi-language version of the default site profile is in fact identical to the intermediate default site profile except for a few minor things:
In any given site, there is going to be some static text for things like buttons, auto-generated headlines and such. We can make these translatable by surrounding that text in a
__('your text here') function. Once you've done that, you can translate that text per-language in ProcessWire's admin (Setup > Languages), and output values will be automatically changed depending on the language. There are also a couple of other variations on this function, used for certain situations. Here's an example of them all:
// This makes 'text' translatable __('text'); // Same as above, but with a specific context // useful if the same term appears in multiple places _x('text', 'context'); // For when we need singular and plural translation _n('singular', 'plural', $count);
For more about making your static text translatable see our documentation on code internationalization.
The only other thing different about the multi-language default site profile is that it contains some additional code in the _main.php file for navigation that lets you view the page in each language. You'll see this near the top of the _main.php file.
Next: More template file resources »
- Introduction to template files
- Beginner version
- Intermediate version
- Multi-language version
- More template file resources
Your e-mail is kept confidential and not included with your comment. Website is optional.