Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+12 votes
3.1k views
in Q2A Core by
edited
Hello to everybody,

Is there a possibility to change the language or translate it?


Thank you
by
it good asked

1 Answer

+5 votes
by
edited
Hi there,

Yes, Question2Answer definitely supports multiple languages, though it does not yet contain translations because it is still in early beta.

If you like, you can already translate it for your own use by doing this:

1. Look at qa_admin_language_options() in qa-include/qa-app-admin.php to see the list of language codes supported.

2. Create a subdirectory in qa-lang with the appropriate two-letter code for the language you wish you use. For example, es for Spanish. There is already a subdirectory there for en-GB.

3. *Copy* (don't move) all the qa-lang-*.php files from qa-include to this directory that you created. There are currently 6 such files, for example qa-lang-main.php is one of them.

4. In the 'Admin' panel, select your created language from the setting labelled "The language for your site interface:". You won't immediately see a change in the words on the web page, but this is preparation for viewing your progress in the next stage.

5. For each line in these files you created, translate the PHP strings *after* the => symbol to your language. Be sure to use your text editor in UTF-8 mode, and preserve special symbols that are used for substitutions. These always start with ^, such as ^1 or ^name, or often ^ on its own.

For example, if you were using Spanish, you would change the line in qa-lang-main.php from:

'x_days' => '^ days',

to:

'x_days' => '^ días',

If you are not sure how a phrase is used you can search for its key in the source code. The key is before => on each line, e.g. x_days in the example above.

6. As you go through translating phrases, you can save the file and view or refresh different pages in the Question2Answer interface to check your work.

As I said, future versions of Question2Answer will include translations for languages other than English, but this way you can use it in your language now.

I hope this is clear, and good luck!
by
I've converted this into a detailed translation guide on the main site:

http://www.question2answer.org/advanced.php#translate
...