NATS4 Language Skins

From TMM Wiki
Jump to navigationJump to search
NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers
Skins and Templates Admin
The Skins and Templates Admin
Skins
Templates
Site Templates
Language Skins
Language Files
custom_errors.php
Join Page Variables
Skipping NATS Join Form
Post URL Variables
Member Usernames & Passwords
Form Validation
Username Recommendations
Password Retrieval
Post-Biller Templates
Geo-Target Join Options
Random Usernames and Passwords
Smarty
Smarty print array
Smarty Plugins
Available Smarty Functions
Affiliate Support Template
Adding a Verification Image
Custom Program and Campaign Selection Pages
Output An Affiliate's Last Paid Date
Affiliate Signup Email
Affiliate Join Page Linkcodes
Approval/Upgrade/Denial Variables
Approval/Upgrade/Denial Template Variables
CSS Theme Builder

NATS4 now offers the ability to set default language templates for your site's skins. Our new template designs allow for language files, which allow you to use Smarty variables to detect and set the affiliate's or surfer's default language settings.

These language files can contain a set of "global" words that apply throughout NATS, as well as section-specific words, such as terms used in the Affiliate Stats page. The files can be found in the templates/default_templates folder. For example, the English language file is named language_en. NATS allows you to create as many language files as you wish.

The language_en file will look like the following example:

# global variables
title = "English"
#page specific vars
[index]
welcome_msg = "Thank you for joining!"

You can set a page's language using a Smarty code to detect the affiliate or surfer's default browser language, which will then use the language file found in the default_templates folder to display the proper language. The example syntax, shown below, shows how to set your smarty config load.

{if $browser_language == 'fr'}
{config_load file="nats:language_fr" section=$smarty.request.page}
{else}
{config_load file="nats:language_en" section=$smarty.request.page}
{/if}

Your template will call the available language variables like the following:

 {#title#} - {#welcome_msg#} 

If you would like to use this new feature, you can simply add a function call to any template. The following are examples of function calls you can use with this feature:

{use_language_file} - loads global words

or

{use_language_file section="stats"} - loads global and stats section


You will then be able to use any data from language files available to you, such as {#file_title#}.

Currently, only the language_en (English language) file has been created by default. For further customization, you can create any number of language files in the Skins & Templates Admin for a skin of your choosing.