Open jachinn opened 8 years ago
OSX, Chrome
This may have been a cookie issue? I'm no longer having trouble with my language choice being preserved...
(Looks like all pages load first in Portuguese and then switch to English after loading, sorry for jumping the gun.)
Thank you so much for taking the time in doing this, Janis! As you had noticed, Portuguese is the default and then the JavaScript fires and displays the English according to the cookie information. The switch is obviously noticeable so I’m considering creating two different sites, one for each language. That way, if you are browsing the site in the non-default language, you won't notice the change.
I've run into the same situation on the Repertorium site: if there's a lot of content, it loads (and flashes) in the default language before switching to the select one. An alternative would be to create parallel pages in the two languages, use JavaScript to check the language selection, rewrite the URL, and then load the selected page in the correct language. Whether you need complete parallel pages or just separate includes for the different languages depends on the content. @andrewntz23 developed a method for doing this on the RMTP pages; the JavaScript is at https://github.com/andrewntz23/Russian_Movegoing/blob/master/javascriptFilename.js. But it might be simpler to send the language cookie to the server and do it in PHP, instead of revising the URL client-side and fetching a different page that way. I need to come up with a more robust strategy for this for the Repertorium anyway; it might be worthwhile for the three of us to give it thorough consideration now.
On Wed, Mar 16, 2016 at 12:31 PM, Helena notifications@github.com wrote:
Thank you so much for taking the time in doing this, Janis! As you had noticed, Portuguese is the default and then the JavaScript fires and displays the English according to the cookie information. The switch is obviously noticeable so I’m considering creating two different sites, one for each language. That way, if you are browsing the site in the non-default language, you won't notice the change.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/HelenaSabel/linguistic_variation/issues/10#issuecomment-197411938
An aside: I'm not sure Andrew's JavaScript is working on the Russian moviegoing site: http://rmtp.obdurodon.org/index.xhtml as I can't seem to load Russian there at all--but maybe that's a content issue? I'd wondered if the slow jumping and loading of the pages here was a PHP problem. Is there a reason or a particular benefit for the entire site to be coded in PHP?
Okay--after a little exploring, I see your whole site isn't PHP, just everything after the index page, and I think I see why you're using it. I was mystified at first by the about.php page, but I wonder if you're generating your SVG on the fly by executing an XQuery script--which would be really neat to learn how to do! I left a comment on Obdurodon inviting more discussion there, since it's likely to be instructive to me and others who need to be working with PHP and need to find more time to learn it. Thanks for sharing your resources!
Indeed those graphs are generated by executing an XQuery script: that way whenever I upload more songs to eXist, everything gets up-to-date.
Very cool! That is something I'd like to (and actually quite need to) try, and what's more, perhaps we should be sharing how to do it with our students! All your code is on this GitHub, right? Would you be willing to write a guest tutorial for newtFire (okay, asking as we're suggesting that, for Obdurodon and really all our DH people) on how you did it?
At the very least, since I need to be applying this myself on the Mitford project, I am happy to follow whatever rapid sketch you can toss at me, and work on writing it up--just let me know. PHP is something I have long been meaning to work on and haven't found enough connected time to synthesize properly, so I have to start over from zero or old code every time I pick it up. With my class working on XQuery and SVG (together) starting next week, I think this might be a good moment for us at least to try to build some new tutorial material.
I'm not comfortable enough with my php knowledge to write about it. After many days working on it, I wasn't even able to get my forms to work using the "POST" method (so I can only use "GET") which means that if somebody selects many individual options, it would break (so you can see how weak my code is). However, if the only thing you need to do is to execute an XQuery file, that's two lines of code.
<?php
$xqr = "URL-of-the-XQuery-file";
echo file_get_contents($xqr);
?>
Well, that in itself is helpful, and some of it is accessible to us both--I have done some dabbling with PHP and MySQL to produce basic webpages, but I can't remember if that involved GET or POST. The process of tutorial writing sometimes builds confidence and expertise (witness Becca and GitHub), and this is something obviously useful to more people than you and me, so that is why I suggested it and hope you will reconsider--particularly if you imagine continuing to apply PHP in your projects. At the very least @djbpitt ought to have a PHP section of links on Obdurodon, since some of his students (like Yi and others) have been working PHP into their projects. It often surprises me that there is no PHP section on his pages, since I know from our conversations that he'd consider building a unit into his course if he had time. The learning curve for it is a bit steep, so it is just the sort of thing we could use a tutorial on. Perhaps we should be asking David to write it!
The language selector works well but doesn't remember my choice across pages. I kept having to switch back to English every time I clicked a link.