Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

change language in non-wordpress use ?


  • Please log in to reply
7 replies to this topic

#1 A T

A T

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 17 December 2010 - 04:02 PM

http://tubepress.com...ub...r_language:

Define the LANG environment variable to your two or four letter language code. Add this statement somewhere before the inclusion of tubepress-pro.php



eg put in define('LANG', 'it_IT');

I've tried this in the standalone php example but the language remains English.

Is this feature fully enabled and working correctly or is a modification needed eg like this
http://groups.google...es...f748940030

#2 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 19 December 2010 - 05:52 PM

This should be working without modification. Could you send along the content of your PHP page where you're using TubePress Pro? Also, it would be helpful if you could send along a link to your site so I could take a look. Feel free to PM me the address if you don't want to share it with the world. Thanks!

#3 A T

A T

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 20 December 2010 - 06:39 AM

This should be working without modification. Could you send along the content of your PHP page where you're using TubePress Pro? Also, it would be helpful if you could send along a link to your site so I could take a look. Feel free to PM me the address if you don't want to share it with the world. Thanks!



Hi I modified the tubepress_pro_2_1_2/examples/standalone.php as a test and all worked well except the language change.

I'll send you a link later to a site where I've installed it and the language change does not seem to work.

BTW I see a lot of requests on here for a search facility, presumably a Javascript based one. Anyone can just copy the part of my code below that submits a simple search by tags, but this does mean the page reloads.

Also does filter_racy = true mean it DOES filter adult content, or not? I wasn't sure, and in any case it seems the most recent uploads escape that filter. I think in the wordpress plugin this filter has three settings, not two.

Also I was wondering where the cached files are stored and whether the cache is self-cleaning?



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php 

define('LANG', 'de_DE');  

/* STEP 1/4: Enter the web-accessible URL of your TubePress installation */
$tubepress_base_url = "http://localhost/video/tubepress_pro_2_1_2"; //worked better without trailing /
 //original: = 'http://yoursite.com/tubepress_pro_2_1_0/';

/* STEP 2/4: Include the TubePress stand-alone library file (tubepress-pro.php) */
include '../env/pro/tubepress-pro.php';
//original: include '/var/www/html/yoursite/tubepress_pro_2_1_0/env/pro/tubepress-pro.php';
?>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>TubePress Pro Example in Plain PHP</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

		<!-- STEP 3/4: Include this statement inside the HEAD of your HTML document -->
		<?php print tubepressHeadElements(true); ?>

    </head>
    <body>
<div>

<!-- STEP 4/4: Include this statement anywhere you want your gallery -->
<form name="input" action="" method="get" >
<?php
echo"<input type=\"text\" name=\"search\" value = \"$keyword\"  onfocus=\"this.value = ''\" />";
?>

<input type="submit" value="Video Search" />
</form> 
<?php 
//if there is a search search by tags, otherwise fetch most recent
if(!empty($_GET['search'])){
$vid_search_term = strip_tags(trim($_GET['search']));
$mode_selected = 'tag';
} else {
$mode_selected = 'most_recent';
}
print tubepressGallery("resultsPerPage='15' mode='$mode_selected'  playerLocation='fancybox' ajaxPagination='true' mode='tag' tagValue='$vid_search_term' tubepress randomize_thumbnails='true' filter_racy='true'"); 
//print tubepressGallery("resultsPerPage='3' mode='user'  playerLocation='fancybox' ajaxPagination='true'"); 
?>

</div>
</body>
</html>


#4 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 23 December 2010 - 05:43 PM

does filter_racy = true mean it DOES filter adult content, or not?


Thanks for pointing out a bug in my documentation. "filter_racy" accepts the following three values: none, moderate, strict. The docs say that it just takes true/false. I'll fix that today.

Also I was wondering where the cached files are stored and whether the cache is self-cleaning?


TubePress will use a temp directory on your server, usually defined by https://github.com/e...lo...s.php#L181

#5 A T

A T

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 24 January 2011 - 07:45 AM

Hi I've sent you a live URL where the language change isn't succeeding, had the same problem on my local install. I tried also changing the language declaration to utf8 such as it_IT.utf8 or it_IT.UTF8 but it made no difference (sometimes it works for locale in PHP), I still get the views and other labels returned in English.

#6 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 24 January 2011 - 11:20 PM

In case anyone is following this thread, I'm working with this user in an offline channel (to maintain his site's privacy) to resolve this situation.

#7 Attila Acs

Attila Acs

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 04 May 2011 - 12:30 AM

if I set the language in my main php like this:
define('LANG', 'es_ES');

it does work but as soon as I navigate around (AJAX pagination), it switches back to the default language. Do I have to define the language elsewhere? Can I just make it default somewhere in a config file?

#8 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 08 May 2011 - 02:15 PM

Hmm this sounds like it could be a bug. Let me try to reproduce the issue here and get back to you. Stand by...