NATS4 Language Skins
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.