Creating and Editing the Host-Language Template within eeSiteKit
eeSiteKit installs three language templates in a template group called “kit_language”. The three language templates include one “Host-Language” (english_usa) and two “Alternate-Language” (german and spanish) templates. All templates may be found here:
Site Name › Templates › Template Management
Host-Language Template: The host-language template, by default “english_usa”, represents a working example for your website’s host language. If your website only uses one language, it would be the host-language, and just about any language can be set up as the host.
The host-language template requires fewer variable settings as it benefits directly from ExpressionEngine’s default systems and works as-is, right out of the box.
If your website will use English, we recommend you look through the “english_usa” template and adjust the language variable settings to be consistent with the use of English in your part of the world.
If your website will not use English, we recommend you hang on to the “english_usa” template as a guide for creating a host language template in your own host language.
Creating And Editing A Host-Language Template: We recommend you make a complete copy of your “english_usa” template and rename the new template with the name of your new language, then make all your changes in the new template so you always have the old “english_usa” template as a reference.
When looking at the host_language temple, you notice that we’ve divided it up into two sections, “Host Language Settings” and “Language Variables”.
In Host Language Settings, you will be updating the following variables by replacing the words “english_usa” with the template name of your new host language. Pay very close attention to formatting as accidentally deleting a quote or underscore could break things somewhere in the site.
site_language=‘english_usa’
english_usa_channel_name=’{weblog}’
english_usa_channel_url=’{embed:weblog}’
For example, if my new language template was named “dutch”, I would update the variables like this:
site_language=‘dutch’
dutch_channel_name=’{weblog}’
dutch_channel_url=’{embed:weblog}’
If your site will have more than one language, and you would like to have dynamic links for site visitors to be able to switch from one language to the other, there is one more variable in this section you’ll need to update. This time though, you’ll replace “german” or “spanish” with the name(s) of the alternate languages your website will support.
change_{german_cat_url_title}=’{category_url_title}’
For example, if my alternate language is “french” I would update the variable like this:
change_{french_cat_url_title}=’{category_url_title}’
You will want a variable like that for each alternative language your site will support.
Language Variables: In the Language Variables section you’ll want to update all the English that is surrounded in single quotes with the appropriate translation in your new language. We’ve formatted each variable as a stacked pair for easier editing. The top row of each pair is the language variable label and the bottom row is the variable content. Do NOT change the top part unless you really know what you are doing as it can make that text disappear some place in your site. The part you’ll update is the bottom row, in between the single quotes.
lang_edit_this_entry=
‘Edit This Entry’
For example, if I were creating a new Dutch language template, I would update the variable like this:
lang_edit_this_entry=
‘Bewerk dit item’
When you encounter a global variable in the part to be translated, leave it as is (to keep it dynamic) or you may replace it with static text. An example would be the use of {site_name} in the phrase “Contacting you from {site_name}”.
You may also create your own language variables for use within eeSitKit by following this same pattern for variable setting in the language templates. We think you’ll find this is a very powerful tool once you get use to it.
