Posts: 2,094
Threads: 54
Joined: Jan 2011
It seems, some essential functionalities for plugins are missing in GetSimple 3.0:
- Frontend language: In 2.03 you could use the global variable $LANG, which is the backend language, but in most cases also the frontend language. In 3.0 in the frontend it is always en_US. It is impossible for plugins to automatically select the correct language in the frontend (e.g. for "previous", "next" texts)
- Frontend or Backend: There is no function to determine if the plugin is called in frontend or backend mode (*).
- GetSimple version: There is no function that returns the GetSimple version independent of frontend or backend mode
- Frontend URLs: a function to create a frontend URL to a page is only available in frontend mode.
(*) the wiki information on selecting the correct frontend language (without the I18N plugin) is invalid fro 3.0.
Thus please add the following features to GetSimple 3.1:
- on the setting page a setting for the frontend language and an easy way to retrieve it, e.g. get_frontend_language()
- a function is_frontend()
- a function get_version() for both backend and frontend
- find_url(...) available for the backend, too
Posts: 423
Threads: 15
Joined: Mar 2011
mvlcek Wrote:on the setting page a setting for the frontend language ...
Surely, this should be the job of the language declaration in the page header?
Given that most installations don't have the language declaration changed from the default, I can see a case for setting the language in the backend and adding it to the headers (with
get_header()).
--
Nick.
Posts: 2,094
Threads: 54
Joined: Jan 2011
hameau Wrote:mvlcek Wrote:on the setting page a setting for the frontend language ...
Surely, this should be the job of the language declaration in the page header?
Given that most installations don't have the language declaration changed from the default, I can see a case for setting the language in the backend and adding it to the headers (with get_header()).
The important part is that a plugin must be able to find out the language to output texts in the correct language. I'm open for any suggestions that make this possible.
Posts: 1,848
Threads: 86
Joined: Aug 2009
mvlcek Wrote:It seems, some essential functionalities for plugins are missing in GetSimple 3.0:- Frontend language: In 2.03 you could use the global variable $LANG, which is the backend language, but in most cases also the frontend language. In 3.0 in the frontend it is always en_US. It is impossible for plugins to automatically select the correct language in the frontend (e.g. for "previous", "next" texts)
- Frontend or Backend: There is no function to determine if the plugin is called in frontend or backend mode (*).
- GetSimple version: There is no function that returns the GetSimple version independent of frontend or backend mode
- Frontend URLs: a function to create a frontend URL to a page is only available in frontend mode.
(*) the wiki information on selecting the correct frontend language (without the I18N plugin) is invalid fro 3.0.
Thus please add the following features to GetSimple 3.1:- on the setting page a setting for the frontend language and an easy way to retrieve it, e.g. get_frontend_language()
- a function is_frontend()
- a function get_version() for both backend and frontend
- find_url(...) available for the backend, too
I like the is_frontend() check - i will add that.
find_url() is already available to the backend
get_version() - why do we need this, why cant you check the constant GSVERSION? also, get_site_version() already exists on the frontend
we need to discuss the get_frontend_language() idea a little more
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 2,094
Threads: 54
Joined: Jan 2011
ccagle8 Wrote:I like the is_frontend() check - i will add that.
find_url() is already available to the backend
ok - my fault.
ccagle8 Wrote:get_version() - why do we need this, why cant you check the constant GSVERSION? also, get_site_version()
The problem is that
configuration.php is not included by default, so you have to include it yourself, see
wiki. If
configuration.php is included by default - frontend and backend, that would be ok, too. It should be possible to do checks like (pseudo code):
Code:
if (gs_version > 3) { ... }
instead of
Code:
if ((is_frontend() and gs_version_frontend() > 3) or (!is_frontend() and gs_version_backend() > 3)) { ... }
ccagle8 Wrote:we need to discuss the get_frontend_language() idea a little more
The easiest way probably is to include a
$LANG = 'en_US' in
gsconfig.php for the default frontend language and tell users to change it, if necessary. On the backend it is then changed to the language of the user, when he is identified.
Thus a plugin could always check $LANG for the language (as it could in 2.03) - unless it supports the I18N plugin ;-)