Posts: 972
Threads: 27
Joined: Aug 2009
Yesterday I received a message from Russian GetSimple user Deimos.
Apparently giving a page a Russian title would break the functions that normally take care of the slug. This would have very odd results: the page was saved blank and the data file wouldn’t have a name (just “.xmlâ€Â).
He provided me with an array that could be used to convert the Russian alphabet into the Latin alphabet.
I implemented this into an unofficial GetSimple build (it has as of yet not been updated on the SVN nightly build) that I would like to share. Get it here.
This build introduces a new function: alpha_conv. It’s an alphabet converter that can be found at the top of /admin/inc/basic.php. This function is easily expended so if you are using a non-Latin alphabet but can supply us with a conversion array it will take only seconds to implement.
I would like to ask all our Russian users to test and comment. I couldn’t do a lot of real tests.
GetSimple 2.03 with Russian page title support.
Posts: 4
Threads: 0
Joined: Sep 2010
Zegnat, Thank you! Everything works fine!
Here is a new translation for version 2.03 - http://rapidshare.com/files/422280543/ru_RU.zip
I will be glad to help in any development for Russian users.
Posts: 1,848
Threads: 86
Joined: Aug 2009
Martijn, Is there a way we can implement this intot he current build, but only turn it on when a GSCONFIG variable is set or we are using the ru_RU language file?
- 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: 91
Threads: 2
Joined: Aug 2009
Translator: Deimos
Interesting...
Posts: 4
Threads: 0
Joined: Sep 2010
2010-09-30, 22:31:52
(This post was last modified: 2010-09-30, 22:34:36 by bpiper.)
vsky Wrote:Translator: Deimos
Interesting... Sorry, translation did for myself, didn't think that I will spread somewhere. Should be:
Stanislav Ulver (vsky) - www.designskill.org, update to 2.03 - Deimos ;-)
Posts: 1,928
Threads: 88
Joined: Apr 2010
ÑÂÿðÑÂøñþ
Posts: 679
Threads: 80
Joined: Nov 2009
Why don't we release this as a plugin that just adds this function?
Does it really need to be in the core? (just one more thing the server would have to check before displaying or creating a page?)
Posts: 972
Threads: 27
Joined: Aug 2009
OWS_Matthew Wrote:Why don’t we release this as a plugin that just adds this function? Looking into that. I did it like this now because it’s easier. There is only one (?) hook into changedata and that’s after the slug has been specified and cleaning has been done. So I’d have to reparse information that the server has already wrongly-processed.
OWS_Matthew Wrote:Does it really need to be in the core? (Just one more thing the server would have to check before displaying or creating a page?) It’s not really a big thing though, it’s a straightforward PHP string replacing function. I don’t think it would slow down the system very much.
ccagle8 Wrote:Is there a way we can implement this into the current build, but only turn it on when a GSCONFIG variable is set or we are using the ru_RU language file? Wouldn’t be hard, but what would the idea behind that be? As I said, I don’t think it will really slow down anything (feel free to test that though).
Another alphabet that might needs to be added is the greek one. Would it then depend on the translation used what alphabet will be parsed? What if someone like vsky, based in Italy, uses an Italian translation for GetSimple but still needs to add pages in Russian?
Seems we all have questions about how this should be implemented, so I did the right thing putting this up as an unofficial build.
Posts: 4
Threads: 0
Joined: Sep 2010
Transliteration can be turned off in gsconfig, such as adding an additional parameter ('TRANSLIT', 'ru'); if an attribute is RU then basic.php, to handle an array of RU (Russian), if the IT, to handle an array of IT (Italy) and so on.
Who is it simply did not have to let him leave the parameter ('TRANSLIT', 'ru'); commented out - # define ('TRANSLIT', 'ru');
This will be a simple and universal way.
Posts: 972
Threads: 27
Joined: Aug 2009
Launched in the form of a plugin now. Get it on GetSimple Extend: ‘slug Transliteration’.
Important: don’t use this with the special GetSimple 2.03+ version. It’s made for the standard GetSimple 2.03.
This plugin uses your current translation file when it replaces your characters. Of course, no translation file is ready for this yet so I’ve attached a version of the Russian translation file ( as Deimos made it) with a transliteration map added to it. After a little more testing I will release some better documentation on how to add transliteration to your translations and how you could make your own plugins use this.
For everyone concerned about speed: if no transliteration map is found in the current used language it will not parse anything. The language file is already included so this plugin causes no extra file reads either.
If you are experiencing any problems with it at the moment, please let me know in this topic.
Posts: 1,928
Threads: 88
Joined: Apr 2010
2010-10-03, 22:02:04
(This post was last modified: 2015-02-20, 22:39:09 by Oleg06.)
Posts: 972
Threads: 27
Joined: Aug 2009
I can’t seem to recreate those errors. What version of PHP and GetSimple outputted those errors? And when did you see them?
Posts: 1,928
Threads: 88
Joined: Apr 2010
2010-10-03, 22:53:10
(This post was last modified: 2015-02-20, 22:38:55 by Oleg06.)
admin
admin
if the text for the link is not entered, try to save the page
Posts: 972
Threads: 27
Joined: Aug 2009
Weird.
I’ve tested both PHP 5.2.11 and PHP 5.3.0. With a clean GetSimple install, only this plugin and the special Russian language file and I didn’t get any errors.
Still, I think I know what the problem might be. So I’ve changed a few things and uploaded a new version of the plugin. Could you try again with version 2?
Posts: 1,928
Threads: 88
Joined: Apr 2010
2010-10-04, 02:21:21
(This post was last modified: 2015-02-20, 22:38:45 by Oleg06.)
Notice: Undefined index: existing-url
Posts: 972
Threads: 27
Joined: Aug 2009
Do you have those errors without my plugin as well? Because they all seem to be caused in changedata.php before my plugin runs. You can try the following:
Find line 115 in changedata.php, it should be this:
Code: if ( file_exists($file) && ($url != $_POST['existing-url']) )
Now change it to this:
Code: if ( file_exists($file) && isset($_POST['existing-url']) && ($url != $_POST['existing-url']) )
Tell me whether that fixes your problems, if it does I will add that change to the core.
(It’s hard debugging a problem when you don’t see it yourself.)
Posts: 1,928
Threads: 88
Joined: Apr 2010
error disappeared, but the page is not saved
Posts: 1,928
Threads: 88
Joined: Apr 2010
2010-10-04, 05:49:13
(This post was last modified: 2015-02-20, 22:37:34 by Oleg06.)
yes you spit (translation of Google) getsimple-s203 + works, if someone will need this feature let her use
Posts: 972
Threads: 27
Joined: Aug 2009
Yes, GetSimple 2.03+ should work. But a plugin would be better.
If anyone else could try out the plugin and report back I’d be very grateful. I can’t figure out why Oleg keeps getting errors.
Posts: 407
Threads: 22
Joined: Aug 2010
2010-10-04, 07:19:47
(This post was last modified: 2010-10-04, 07:20:33 by tariq123.)
Zegnåt Wrote:Yes, GetSimple 2.03+ should work. But a plugin would be better.
If anyone else could try out the plugin and report back I’d be very grateful. I can’t figure out why Oleg keeps getting errors.
Hi there Zegnåt. Just out of interest sake I also had a problem when testing with Oleg06 the cart system where suddenly it started moaning about the headers already being sent etc.. I solved it by using index-pretemplate and index-posttemplate triggers to allow
ob_start();
and ob_flush();
to be executed. The reason I mention this is, wont it be worthwhile just to do a small test. Give him a version where the load.php has ob_start and ob_flush at beginning and end and see if the problem goes away.
Just a thought ?
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Posts: 972
Threads: 27
Joined: Aug 2009
I don’t think that a buffer is of any use since my plugin is not supposed to output anything. It simply rewrites 2 variables. But thanks for the input, I’ll look into it anyway. You never know, right?
Posts: 407
Threads: 22
Joined: Aug 2010
Hi there.
I suddenly had a idea.. maybe the problem is that the output buffer is getting full and then PHP is flushing it (flush not forced by code) and that is why it is suddenly a problem ?
you can also add this code to the loader.php for testing purposes
Code: function headercheck($errno, $errstr, $errfile, $errline) {
if (!(error_reporting() & $errno)) {
return;
}
if (headers_sent()) {
error_log('ERR : '.$errstr);
error_log("HEADERS LIST : ".print_r(headers_list(),true));
}
//allow normal error reporting
return false;
}
$tmp_old_hndler = set_error_handler("headercheck");
This sill create a header dump when ever a error occurs and headers was already sent back.
I almost feel certain it is the output buffer that is getting full and being flushed by the system. that is why the ob_start and ob_flush will work.
hope it helps
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Posts: 1,204
Threads: 30
Joined: Jun 2010
Ohh found it at last. Works like a charm. I updated pl language file with a small array.
Are there any special chars I should consider in the array, beside national uppercase and lowercase letters ?
Addons: blue business theme, Online Visitors, Notepad
Posts: 972
Threads: 27
Joined: Aug 2009
GetSimple should be able to handle punctuation and weird characters already. It really is up to you what characters you want to encode.
Out of curiosity, are you using the plugin?
Posts: 1,204
Threads: 30
Joined: Jun 2010
2010-11-12, 02:36:11
(This post was last modified: 2010-11-12, 02:39:28 by BlackRose.)
ohh, I lost focus on this thread.
Yes, I'm using it. I added to translation file needed characters conversion array, and it's working gorgeous ! :]
If you say that standard special chars (such as ^ * ! ... ) are handled natively by GS, there's no need to add them.
1 question: have you considered to add code of this plugin into GS core ?
I think transliteration should be a part of core functionality, not as a standalone plugin, for those who know about it, and need it.
There are many users who don't know, that they shouldn't use national characters in file names, uri's, and this functionality is imo a "must have in GS".
Addons: blue business theme, Online Visitors, Notepad
|