Template Settings - Multi-language Mod

From TNG_Wiki
Jump to: navigation, search
Ambox notice.png The Template Settings - Multi-language Mod was added to TNG version 8 to use the templateconfig.php file from the languages folder, in order to display the Home page created using the Template Settings in the language selected.

In TNG version 8.1, the file name in the language folder was changed to cust_tmplvars.php.

This mod is obsolete with TNG V9. See Template Settings - V9
TNG version: 8.1.3
TNG version: 8.0
TNG 8.1


Template Settings - Multi-language Mod
Summary Uses the Setup - Template Settings configuration file from the language folders to provide text variables in multiple languages
Validation Mod for TNG 8.1.2 is XHTML compliant.Valid-xhtml10.png
Mod Updated {{{mod_last_update}}}
Download link for
TNG 8.1.2
template_settings_multi-language_v8.2.1a.zip
for
TNG 8.1
template_settings_multi-language_v8.2.1.zip
for
TNG 8.0
template_settings_multi-language_v8.1.0.zip
Download stats {{{download_stats}}}
Author(s) Ken Roy
Homepage Template Settings - Multi-language Mod
Mod Support TNG Community Forums
Contact Developer My Mod Support
Latest Mod 8.2.1a for TNG V8.1.2
8.2.1 for TNG V8.1
8.1.0 for TNG V8.0.0 - V8.0.2
Min TNG V 8.0.0
Max TNG V 8.1.3
Files modified
Related Mods
Notes


Introduction

TNG V8.1

This mod uses the new TNG V8 Setup - Template Settings to create multi-language Home Pages by

  • using the templateconfig.php file for the Enable Template Selection and the Template Number from the configuration file location (TNG root path or Config Path)
  • using the cust_tmplvars.php in the languages/folders that were created after installing the mod, see the After Installation Actions
  • increasing the size of the textarea and the text input fields for easier editing
  • overriding the templateconfig.php $tmp variables with the languages cust_tmplvars.php in begin.php

After installing this mod, copy the templateconfig.php file from your TNG install directory or from your Config Path location to your English or English-UTF8 folder and rename the copied templateconfig.php file to cust_tmplvars.php in the languages/folders, see the Compatibility section in the After Installation Actions if you were previously using this mod.

Additional hard-coded text and images were added to the $tmp variables to allow users to customize the templates in other languages in the Template_Settings_-_V8.1_Fixes, which can be considered a second part to this mod, but can also be installed without installing this mod.

TNG V8.0.0 to V8.0.2

TNG version: 8.0.2
TNG version: 8.0

This mod uses the new TNG V8 Setup - Template Settings to create multi-language Home Pages

  • by getting the templateconfig.php file from the languages/English and other languages/ folders,
  • rather than the configuration file location in TNG V8.0.0 through V8.0.2.

After installing this mod, move the templateconfig.php file from your TNG install directory or from your Config Path location to your English or English-UTF8 folder in TNG V8.0.0 through V8.0.2. For TNG V8.1 rename the copied templateconfig.php file to cust_tmplvars.php in the languages/folders, see the Compatibility section in the After Installation Actions

Note that this mod expects that you have copied all templates/templateN folders and files to your TNG install directory, sometimes called the genealogy directory.

The mod updates the distributed TNG/templates/templateN index.php and topmenu.php files for template1 through template8.

After the mod is installed, in TNG V8.0.0 through V8.0.2, you will then need to copy to your TNG install directory from the template you are using for your site, even though you have done this step before, see After Installation Actions In TNG V8.1 if you Enable Template Selection, you do not need copy the template files to the TNG root folder.

You may also need to update your language file settings after a TNG V8 Upgrade as indicated in the Setup Language

Developer

This mod was developed by Ken Roy.

Our thanks to Cornelis Kuit, Graham Chamberlain, and Jeff Robison for helping test and debug this mod for TNG V8.1.0.

Thanks to Graham Chamberlain for providing the config file updates for TNG 8.1.2 beta

Advantages

This mod provides the following advantages:

  • allows an easy way to generate Home pages in different languages
  • eliminates the need to code pages to provide the same capability

See Multi-Language Home Pages for additional details.

Requirements

Note that this mod expects that you have copied all templates/templateN folders and files to your TNG install directory, sometimes called the genealogy directory, in TNG V8.0.0 through V8.0.2. In TNG V8.1, you should have done this as indicated in the TNG V8.1 readme files.

The mod updates the distributed TNG/templates/templateN index.php and topmenu.php files for template1 through template8 in TNG V8.0.0 through V8.0.2. In TNG V8.1, the mod updates the index.php files for template 4, 5, 6, and 8 only to replace hard-coded English text with either $text or $tmp variables, to allow users to customize the Home page.

After the mod is installed in TNG V8.0.0 through V8.0.2, you will then need to copy to your TNG install directory from the template you are using for your site, even though you have done this step before, see After Installation Actions. In TNG V8.1, you should use the Enable Template Selection. See Templates - Upgrading TNG 8.1

You may also need to update your language file settings after a TNG V8 Upgrade as indicated in the Setup Language

Revision History

Note that there are two different flavors of this mod:

  • one for TNG V8.0.0 through V8.0.2
  • other for TNG V8.1 and above

The version numbers are kept the same, but the config file name is different.

Version Date Contents
v8.2.1a 16 April 2011 updated for TNG V8.1.2 beta provided by Graham Chamberlain
v8.2.1 3 February 2011 updated for TNG V8.1 and above to also switch the page headings on TNG generated pages on a language switch
v8.2.0 14 January 2011 created v8.2.0 for TNG V8.1 and above
v8.1.0 28 May 2010 initial config file released for TNG V8

TNG Modules Involved

TNG V8.1

TNG version: 8.1.0

In TNG V8.1, the following modules are updated:

  • admin_templateconfig.php
  • admin_updatetemplateconfig.php
  • begin.php
  • index.php
  • index.php for templates/template 4, 5, 6, and 8
  • templateconfig.php which you need to copy to each languages/ folder for the languages you use and rename to cust_tmplvars.php

TNG V8.0.0 through V8.0.2

TNG version: 8.0.2
TNG version: 8.0

In TNG V8, the following modules are updated:

  • admin_templateconfig.php
  • admin_updatetemplateconfig.php

for each template in the templates

  • index.php
  • topmenu.php

Changes in TNG V8.1

TNG version: 8.1.0

The following changes made in Template Settings - Multi-language Mod for TNG V8.1

  • Created the file as cust_tmplvars.php in the languages folder
    • This was done to make it easier for Darrin to incorporate this mod into TNG
    • This was also done to allow previous version customizations to survive an upgrade

The following changes were made in the Template Settings - V8.1 Fixes

  • Replaced hard-code English text within each template home page with $tmp variables
    • To allow users to customize that text in more than one language
  • Replaced some of the $text or img subheadings in templates 6 and 8 with $tmp variables
    • To allow users to customize that text in more than one language
    • To allow users to use that section of the Home page for a different reason, such as using multiple Family histories instead of Most Wanted and Resources on Template 6

Automated Installation

  1. Download the appropriate zip file from the Mod Summary in the upper right hand corner
  2. After downloading the config file, unzip it into your mods folder
  3. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the template_settings_multi-language.cfg file.

After Installation Actions

for TNG V8.1.0

TNG version: 8.1.0

After installing this mod,

  1. Copy the templateconfig.php file from your TNG install directory or from your Config Path location to each languages/folder for each language for which you want to enter language specific text
Note that if you were using this mod previous, you should be able to edit the templateconfig.php from your languages folder to add the new variables provided by this version of the mod, and then save it as cust_tmplvars.php in the same folder
  1. Rename the copied templateconfig.php file to cust_tmplvars.php in the languages/ folder(s)
  2. Update the text for your template and image locations for each language in the Admin >> Setup >> Template Settings while logged in using each of your other languages
  3. Use the Enable Template Selection capability to provide your updated template Home page

Your home page text will now display in the language selected by the user.

Second part of the mod

Because some of the template files contained hard-coded English text, another mod was created to replace the hard-coded English text with $text or $tmp variables. There were two reasons for creating this as a separate mod:

  • to allow users who use only English to be able to customize the text
  • to allow deleting of the mod after install, since once you update any of the fields in the Template Settings, the Mod Manager marks the mod as requiring Cleanup, which is only because the values no longer match what is in the config file. See the Template Settings - V8.1 Fixes article for the area that were changed and to obtain what can be considered the second part of the Template Settings - Multi-language Mod.

Compatibility

If you previously used the Template Settings - Multi-language Mod in TNG V8.0.0 through 8.0.2, your template variables were in the templateconfig.php in each language folder. In TNG V8.1, I used cust_tmplvars.php for the variables, in the hope of getting Darrin to incorporate this mod and to provide an override capability that would not be lost across upgrades, if the templateconfig.php file were replaced.

You should be able to edit your previous files, add the new variables included in the mod that replace hard-coded English text and then save the files as cust_tmplvars.php.

Note that if you at one point return the settings to

  • Enable Template Selection = No
  • Template Number = N for your template

then you will need to keep the previous version of the file in your languages folder. Note that those files will not include the additions I made to the template files to replace hard-coded English text.

for TNG V8.0.0 to V8.0.2

TNG version: 8.0.2
TNG version: 8.0

After installing this mod,

  1. Move the templateconfig.php file from your TNG install directory or from your Config Path location to your English or English-UTF8 folder
  2. Update the text for your template and image locations using English in the Admin >> Setup >> Template Settings
  3. After saving the updates, copy the templateconfig.php file from your English or English-UTF8 folder
  4. Paste it in all your other languages folders that you allow in the language pull down
  5. Update the text in the Admin >> Setup >> Template Settings while logged in using each of your other languages
  6. Copy the updated index.php and topmenu.php for your template from the TNG/templates/templateN folder (and not from the original zipfiles) to the TNG install folder, even though you might have done this step before when installing or upgrading TNG, since the files were updated by the mod to look for the templateconfig.php file in the languages/folders rather than where the normal config files would be saved.

Your home page text will now display in the language selected by the user.

TNG user sites using this mod

  • Please add TNG sites that you have found that utilize this modification
URL User Note Mod-Version/TNG-Version User-language
Our Acadian, French-Canadian, and Maine Ancestors Ken Roy Mod Developer V8.1.3/TNG 8.0.2
V8.2.1a/TNG 8.1.2.1 on test system
EN, FR
Kuit's Family History Cornelis Kuit ... V8.2.0/TNG 8.1.0 EN, DE, NL
Chamberlain & Eidenbenz Genealogy Graham Chamberlain ... V8.2.1a/TNG 8.1.2 EN, FR, DE, ES
... ... ... ... ...

Related Links

Setup - Template Settings

Home Pages - Multi-Language

Templates - Upgrading TNG 8.1