Terry's Second Site Tips

Creating a Custom Language for Your Site

This page updated 5 May 2009

Version note: Applies to Second Site 5 & 6

As described in my article on Minimalist Style Web Pages, I created a custom Language in TMG to get exactly the look I was after in my bullet-style public web pages. This article tells how to create a custom language and use it in Second Site. While the example focuses on the bullet style application, the general methods apply to any custom language you might want to create for Second Site. Other articles in my Second Site Section cover other topics about customizing your site.

When a custom Language is created for use in Second Site, only Sentences are created in the custom Language. You cannot use a custom Language in TMG to change the words and phrases Second Site adds to your data, such as the spelling of months, pronouns and prepositions added as part of the interpretation of variables. Those must be changed in the Strings sections of Second Site's user interface, as described in my article on Customizing Words and Phrases.

Setting up the Custom Language in TMG

My article on Languages provides details of how to create a language in TMG. But briefly, I created a new language (File > Language > Customize) and gave it a name, "SS1."

Second Site automatically supports custom Languages named SS1, SS2, and SS3. Using one of those as the name of your custom Language makes it easier to apply that Language in Second Site.

I did not make any translations in the Language tables, nor did I make the Language active. Rather, I just created custom Sentence Structures in the new Language for the few Tag Types I intended to use in the web site.

Adding Sentence Structures for the Custom Language

Once the Language is created, still in TMG, you modify the Sentence Structures of each Tag Type you will use. In the Master Tag Type List, select the Tag Type and click Edit to open the Tag Type Definition screen, as shown in this screenshot:

Tag Type Definition Screen

Select your custom Language, then enter your customized Sentence Structures. You only need to create special Sentences for those Tag Types and Roles that you will actually use in your site. Since most applications of custom Languages in Second Site involve only limited types of data, this may be a quite manageable task.

For example, for my "Minimalist Style" site I use only Birth, Baptism, Marriage and Death events. Since I don't use Roles for any of these tags except Marriage, I only created Sentence Structures for the Principal Role. I wanted each tag to produce a bold label, and the date and place, but nothing from the Memo field. And I wanted the tags separated by a blank line. Here are the Tag Types and Sentence Structures I created, using standard TMG Sentence variables and codes:

Tag Type Role Sentence Structure
Birth Principal [:CR:][BOLD:]Born:[:BOLD] <[D]> <[L]>
Baptism Principal [:CR:][BOLD:]Baptized:[:BOLD] <[D]> <[L]>
Marriage Principal [:CR:][:CR:][BOLD:]Married:[:BOLD] [PO] <[D]> <[L]>
  Bride [:CR:][:CR:][BOLD:]Married:[:BOLD] [PO] <[D]> <[L]>
  Groom [:CR:][:CR:][BOLD:]Married:[:BOLD] [PO] <[D]> <[L]>
  First [:CR:][:CR:][BOLD:]Married First:[:BOLD] [PO] <[D]> <[L]>
  Second [:CR:][:CR:][BOLD:]Married Second:[:BOLD] [PO] <[D]> <[L]>
  Third [:CR:][:CR:][BOLD:]Married Third:[:BOLD] [PO] <[D]> <[L]>
  Fourth [:CR:][:CR:][BOLD:]Married Fourth:[:BOLD] [PO] <[D]> <[L]>
Death Principal [:CR:][:CR:][BOLD:]Died:[:BOLD] <[D]> <[L]>
Webnote Principal [:CR:][:CR:][BOLD:]Note:[:BOLD]<[M]>

For use of the Marriage Roles, see my article on Using Roles to Manage Multiple Marriages. The custom Webnote tag is used to note conflicting information on lineages, or other brief notes about a person I want to appear on my web pages.

Using the Custom Language in Second Site

Once the Language and Sentence Structures are created, you need to tell Second Site to use them. You do that in the Data > Language section, by selecting it from the drop-down list in the Sentence Language field. Do not change the Site Language setting – that must always be set to a "real" Language. Second Site will now use the Sentences in your custom Language to construct the site.

If you have named your custom Language something other than one of the three supported names – SS1, SS2, or SS3 – you will need to tell Second Site it exists by editing the 2ndsite.ini file, which is more complicated and best avoided.


ReigelRidge Home Terry's Tips Home Contact Terry

 

The Second Edition of my sell-out book, A Primer for The Master Genealogist, is now available.

Details are can be seen here.

 

Copyright 2000- by Terry Reigel