This is an old revision of the document!
This is a current work in progress. Let us know where we can improve it
Important: These instructions are written specifically for customers who are using the default layout of GeoAuctions/GeoClassifieds and are adding a SECOND LANGUAGE to their site.
Existing Install - Adding a second Language to an existing installation. We have used "Spanish" as an example, but the same steps apply to all language imports.
If your site is using multiple languages, it may be useful to present a different template set based on which language is currently being viewed by a user. Individual templates can be assigned to a language through the Admin as detailed above, but there is a PHP code snippet that can do this for an entire set of templates. <tip c w>Warning: Changing PHP code is not covered by Support. Be sure to make backups of any affected files before performing a PHP edit. If you are not familiar with manipulating text files over FTP, use caution when proceeding.</tip>
Open geo_templates/t_sets.php and look for the section marked [CUSTOM SECTION]. Changes made to this section will not be overwritten automatically when making changes to template sets in the admin. Code outside of the [CUSTOM SECTION] block is subject to automatic removal by the admin. Below is some example code you might use to show a Spanish template set if your site is being viewed in Spanish:
# [CUSTOM SECTION] # //Anything manually added to this section will be left intact even if changes //are made in the admin panel. $lang = geoSession::getInstance()->getLanguage(); if($lang == 24) { geoTemplate::addTemplateSet('my_templates_spanish'); } # [/CUSTOM SECTION] #
The first line gets the language chosen by the current viewer, and assigns its id to the variable $lang. This is the numerical ID of the language, as viewable in the Admin's Languages > Languages Home page. The rest of the above snippet checks the variable to see if it is 24 (for the purposes of this example, 24 is the ID of the Spanish language on the site), and, if so, activates the "my_templates_spanish" template set. Obviously, you may need to change the template set name or the ID it checks for, to fit your site.
Controlling the display of languages such as Hebrew and Arabic are not controlled within the software itself. You will need to set this up within the html design you implement within the software. You will need to make changes to the html in the language specific page templates for the language that requires right-to-left character display. Here are a couple pages around the Internet that provide suggestions on how to implement this page wide or for specific blocks of text within html pages:
http://www.i18nguy.com/markup/right-to-left.html http://www.w3.org/TR/i18n-html-tech-bidi/