Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Plugins by

I have been trying to translate the qa-Badges plugin to portuguese.

I followed the procedure described in https://github.com/NoahY/q2a-badges#id1

I am basically saving the original file "qa-badge-lang-default.php" as the file "qa-lang-badges.php" in the directory "MyMainDirectory/qa-lang/pt/".

However, I am not able to see in the Administrator Panel the option to change the language.

What am I doing wrong?

Q2A version: 1.7.0

2 Answers

+2 votes
selected by
Best answer

Normally, plugin translation files are placed in the plugins folder. In the case of this plugin, you should do next steps.

  1. Change your translation file name to "qa-badge-lang-pt.php"
  2. Put translation file under qa-plugin/q2a-badges folder

However, Q2A core is not translated into your language (portuguese?). If there is no core language file, you can not select the language.


Easy solution is that you make new "pt" folder under qa-lang.

+2 votes

What sama55 mentions is perfectly fine and it will work in Q2A v1.7.0 and below. The thing is that approach has been deprecated as of Q2A v1.7.0 in favor of the new metadata files (explained here http://www.question2answer.org/qa/40745).

In the new approach, you can freely add any directory name under the qa-lang directory but you'll need to add a metadata.json file to the directory. That file is a JSON file that would contain something like this:

    "name": "Portuguese - Portugal"

The name attribute just contains the value that you want to see in the combobox when selecting languages.