Writing FAQ's in multiple languages
You can write FAQ's in multiple languages, which is useful in multi-lingual installations. The process is not quite automated and requires a few simple file manipulations.
The basic receipe involves the following:
- Entering an reference entry, for example#faqlist[FAQ_000_head]# in the FAQ item header and corresponding #faqlist[FAQ_000_head]# in the FAQ item body, replacing the usual header and body content.
- Editing entries like $faqlist["FAQ_000_head"] etc. in the language file using the Language File Edit Utility.
The process is a little more involved, because there is only one such entry in the file (named FAQ_000), and the file is likely to be overwritten with PGV upgrade, wiping out all your work.
Contents
Create FAQ list in the first language
You can either write the FAQ's in a text editor, or use the FAQ editor in the Help/FAQ List or Admin/FAQ List menus (both lead to the FAQ list, with editing tools if you have Admin privileges). Writing is a little tricky: you can use HTML tags, keeping in mind that some behave differently (see FAQ writing tips), but the FAQ editor allows you to immediately verify the result.
Having prepared several FAQ's (you can always add more later), follow those steps (assuming that the first language was English):
- Locate the file faqlist.en.php in the Languages subdirectory of your PGV installation. If the primary language as not English, substitute the language code for en in the file name.
- Make a backup copy and open the file in a text editor. You will find an entry like
$faqlist["FAQ_000_head"] = "\"FAQ\" I've heard of it, but what is it?";
- Add more entries like it. Since you could later receive an update of an genuine PGV FAQ's, it would be useful to differenntiate your entries from the original ones. Start your numbering with 501 or, better yet, prepend them with a letter, e.g. 'C' for custom, creating your entry for $faqlist["FAQ_C001_head"]. The numbering is entirely arbitrary - the whole string is referenced in the FAQ list only; those who have the horrid habit of counting from zero should start from C000. Your entries should like this, in pairs:
$faqlist["FAQ_C001_head"] = "Header of my first FAQ entry";
$faqlist["FAQ_C001_body"] = "Body of my first FAQ entry";
- Save the file
Translate into other languages
Once you have created the entries in the first language, you can use the language translation tool in Admin/Translation tools/Language File Edit Utility menu (alternatively you can repeat the process described above in a different language). The tool shows you the text in your primary language and allows you to enter a translation. Continue untill all entries are translated. This should create a file faqlist.xx.php where xx is your translation language
Copy your work to the Extra file
The Language File Edit Utility will create the extra.xx.php file for you, but will not work for editing them. You need to manually open the files extra.xx.php in all languages (including primary) and copy all your FAQ entries (the header and body definitions, as described above) to the matching language extra.xx.php file.
This step is important, since only the Extra files will not be overwritten during an upgrade. You should keep a backup copy anyway.
Enter FAQ references
In your FAQ list, enter the references to your FAQ's, in any order you need.
#faqlist[FAQ_C001_head]#
in the FAQ item header and
#faqlist[FAQ_C001_body]#
in the item body. When you change languages, translated FAQ's in different languages will be displayed. Test it, and re-edit the FAQ translations if any errors occur.