Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
880 views
in Q2A Core by

Please plugins consider localization, too.

Experimental example code for facebook-login plugin)

qa-plugin/facebook-login/qa-facebook-login.php (modify L166...)

 

'fields' => array(
array(
//for localization 'label' => 'Your Facebook App ID:',
'label' => qa_lang_html('plugin-facebook-login/appid_label'),
'value' => qa_html(qa_opt('facebook_app_id')),
'tags' => 'NAME="facebook_app_id_field"',
),
 
array(
// for localization 'label' => 'Your Facebook App Secret:',
'label' => qa_lang_html('plugin-facebook-login/appsec_label'),
'value' => qa_html(qa_opt('facebook_app_secret')),
'tags' => 'NAME="facebook_app_secret_field"',
//for localization 'error' => $ready ? null : 'To use Facebook Login, please <A HREF="http://developers.facebook.com/setup/" TARGET="_blank">set up a Facebook application</A>.',
'error' => $ready ? null : strtr(qa_lang_html('plugin-facebook-login/fb_hint'),array('^1'=>'<A HREF="http://developers.facebook.com/setup/" TARGET="_blank">','^2'=>'</A>')),
),
),
 
'buttons' => array(
array(
//'label' => 'Save Changes',
'label' => qa_lang_html('main/save_button'),
'tags' => 'NAME="facebook_save_button"',
),
),
qa-include/qa-lang-plugin-facebook-login.php (add file)
<?php
 
/*
Question2Answer 1.3-beta-2 (c) 2010, Gideon Greenspan
 
 
 
File: qa-include/qa-lang-plugin-facebook-login.php
Version: 1.3-beta-2
Date: 2010-11-11 10:26:02 GMT
Description: Language phrases for facebook login plugin
 
 
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
*/
 
return array(
'appid_label' => 'Your Facebook App ID:',
'appsec_label' => 'Your Facebook App Secret:',
'fb_hint' => 'To use Facebook Login, please ^1set up a Facebook application^2.',
);
 
 
/*
Omit PHP closing tag to help avoid accidental output
*/
Sorry, Gideon is very busy...
Best regards.

1 Answer

+1 vote
by
Yes, I imagine localization will come to plugins in the future - for now you can simply make a copy of the plugin and change phrases as appropriate.
...