Question2Answer fully supports non-English languages and is easy to translate. Before proceeding, it's worth checking here to see if a translation is already available. You may be able to use this immediately, or only have to add some missing phrases.
To create a new Question2Answer translation from scratch, follow the steps below:
qa-app-admin.php inside Question2Answer's qa-include directory and look at the function qa_admin_language_options(). This contains an array which maps abbreviated language codes to their corresponding languages. For example, the abbreviation for Russian is ru. Note down the abbreviation for your language. If your language is not in the array, you may add it, but please also tell us so we can include it in future versions.qa-lang directory, and name the subdirectory with the abbreviation for your language, keeping the original capitalization.qa-lang-*.php files in Question2Answer's qa-include directory to the new language directory you created. This is currently a total of 8 files.qa-lang-*.php files that you created. To translate each file:
=> symbol to your language.^). These can be moved but not removed. In some cases, the ^ symbol is followed by a number or word, such as ^1 or ^site_title, and this should also be preserved.=> on each line.qa-lang-admin.php and qa-lang-options.php - these are only used for the admin interface and do not contain any phrases which are visible to normal users of Q2A.qa-lang-*.php file you are working on, then viewing or refreshing the appropriate pages in your browser.qa-check-lang.php is your friend! As you work, use your web browser to view the qa-include/qa-check-lang.php page within your Question2Answer site. This will check your language files for any omitted phrases or substitutions.An incomplete Question2Answer translation may be available for your language, for example because it has not been updated for the latest version of Q2A. To update a translation for the version you are running, follow the steps below:
fr or ru) in Q2A's qa-lang directory.qa-check-lang.php is your best friend! Use your web browser to view the qa-include/qa-check-lang.php page within your Question2Answer site. This will check your language files for errors and auto-generate the PHP code for missing phrases.qa-lang-*.php file that needs attention:
qa-include/qa-check-lang.php into the middle of this file.=> symbol to your language.^). These can be moved but not removed.qa-include/qa-check-lang.php in your web browser and ensure that you resolve all issues shown. You can also browse around your Q2A site to see how the translated phrases are used in context.From version 1.4, it is possible to modify some of the URLs used within a Q2A site. For example, http://mysite.com/questions could be replaced with http://mysite.com/proposals. To do this, look for the commented $QA_CONST_PATH_MAP definition in qa-config.php. This shows an example of how to define a PHP array which modifies the standard URLs used.
Starting in version 1.5, it is also possible to customize specific language phrases for your Q2A site without installing a full translation. To customize a particular phrase, follow the steps below:
qa-include/qa-lang-*.php files to find the file and line containing the phrase.qa-lang-*.php file in Q2A's qa-lang/custom directory, with the same name as the file that you found in the previous step, and paste in the following code:
<?php return array( // custom phrases go here... );
qa-lang-*.php file into the middle of the array( ) in your new file.=> symbol to suit your requirements. Pay attention to substitution points, which use the hat symbol (^). For non-English languages, ensure your text editor is using UTF-8 encoding without a BOM (byte order mark).Below is an example qa-lang/custom/qa-lang-main.php file which modifies the 'Hello [username]' and 'My Account' phrases:
<?php return array( 'logged_in_x' => 'Welcome, ^!', 'nav_account' => 'My Settings', );