Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Missing Functionality in GetSimple 3.0 - for Plugins
#1
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
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#2
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.
Reply
#3
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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#4
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!
Reply
#5
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 ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 1 Guest(s)