Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Update Plugin: Lang Filter (V1.0.1)

+5 votes
asked Apr 20, 2013 in Plugins by sama55
edited Dec 19, 2014 by sama55

This plugin replace specific word of lang system of Q2A at once.
Refer to readme in download-file for description.

The phrase of Q2A are taken out from lang file in following order.

  1. qa-lang/custom/qa-lang-*.php
  2. qa-lang/(language code)/qa-lang-*.php
  3. qa-include/qa-lang-*.php

When changing expression, it is best to correct lang souce file. But this plugin may be useful when changing words and phrases at once easily. In addition, this version changes word simply by str_replace of PHP. if this plugin is helpful also to heavy users of Q2A, It may be better to also add replace function by regular expression(preg_replace), And, Since the dictionary used for conversion is cached on memory, risk of performance worsening is minimum. 

  1. Screen shot 1: admin -> plugins
  2. Screen shot 2: admin -> plugins -> options (default)
  3. Screen shot 3: admin -> plugins -> options (after setting)
  4. Screen shot 4: page view


1.5.x, 1.6.x, 1.7 (2014/12/19 Updated)


Best regards.


Q2A version: 1.5.x, 1.6.x, 1.7
commented Apr 21, 2013 by Sebastiano Pereiro
Thank you sama55. I was looking for something like this!
commented Apr 21, 2013 by sama55
Thanks Sebastiano, ilkkanka.
commented Apr 9, 2014 by Scott
What is the advantage of this over editing the language files?
commented Apr 9, 2014 by sama55
One example,  variety of words. One of me made Japanese translation file. However, there are few words that I know. When they translate "Vote" into Japanese, various words apply to "投票", "支持" and "賛成", etc in Japanese. Words that translator and user like are different. This problem may be solved by replacing word.

2 Answers

+1 vote
answered Apr 21, 2013 by ilkkanka
thx its useful
+2 votes
answered Apr 9, 2014 by Gurjyot Singh
Well I have started to use your plugin, but I have notice one problem that if I change a word with another word having first alphabet as upper case then I have to replace the some word with first alphabet as lower case as well. like shown below,

Shouldn't it be like if we change a word then it should be changed all over the website irrespective of upper or lower cases.
commented Apr 9, 2014 by sama55
It is specification of this plugin. This is because it may become spillover when I add the specific logic for replacing words. When you use this plugin under restrictive condition, you may realize your hope by remodeling plugin.