We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

problems plugin in other languages - Photo | Forum

groppi massimo
groppi massimo Oct 2 '14
Hello, if i sign it in my website in english (original) language, all is ok, but when sign it in italian language, all my photo are missing, it doesn t show any photo or album, same for the video.
Why? I have only translate the plugin nothing else. But when i enter in italian language i can t see my photo or of an other member photo.
I don t understand. THANKS FOR HELP
Oxwall Software
Oxwall Software Oct 7 '14
How did you translate the plugin?
Philippe
Philippe Nov 26 '14
Hello, i've a identical problem with french translation. I'm use admin/languages pages to traduct.
When i'm change language to english it's ok, but when i'm return in french the javascript script don't work.

In firebug console i've this error :
SyntaxError: missing ) after argument list http://xxxxxx/photo/userphotos/yyyyyyy?language_id=9 Line 1352

The code is
var albumName = new OwTextField('add-new-photo-album-name', 'add-new-photo-album-name', 'Nom de l'album');

The problem is ' not escape.

The Forum post is edited by Philippe Nov 26 '14
Oxwall Software
Oxwall Software Nov 27 '14
Here's the fix:

1) In the file ow_plugins/photo/components/page_head.php in the  __construct method replace this code :
 
$this->assign('isAuthenticated', OW::getUser()->isAuthenticated());
$this->assign('canUpload', OW::getUser()->isAuthorized('photo', 'upload') && !OW::getRequest()->isAjax());
 
with this:
 
$isAuthenticated = OW::getUser()->isAuthenticated();
$canUpload = !OW::getRequest()->isAjax() && OW::getUser()->isAuthorized('photo', 'upload');
 
if ( $isAuthenticated && $canUpload )
{
    $language->addKeyForJs('photo', 'album_name');
    $language->addKeyForJs('photo', 'album_desc');
    $language->addKeyForJs('photo', 'create_album');
    $language->addKeyForJs('photo', 'newsfeed_album');
    $language->addKeyForJs('photo', 'newsfeed_album_error_msg');
    $language->addKeyForJs('photo', 'upload_photos');
    $language->addKeyForJs('photo', 'close_alert');
}
 
$this->assign('isAuthenticated', $isAuthenticated);
$this->assign('canUpload', $canUpload);
 
2)  in ow_plugins/photo/views/components/page_head.html replace this code  :
 which starts with this line
{if $isAuthenticated && !empty($canUpload)}
 
and end with this :
 
    {decorator name="button" class="ow_ic_add" id="btn-add-new-photo" langLabel="photo+upload_photos" onclick="{$url}();"}
{/if}
 
replace with this code
 
{if $isAuthenticated && !empty($canUpload)}
    {decorator name="button" class="ow_ic_add" id="add-new-photo-album" langLabel="photo+create_album"}
    {script}
        jQuery(function()
        {
            var content = $(document.getElementById('add-new-photo-album-content'));
 
            var albumName = new OwTextField('add-new-photo-album-name', 'add-new-photo-album-name', OW.getLanguageText('photo', 'album_name'));
            var albumDesc = new OwTextArea('add-new-photo-album-desc', 'add-new-photo-album-desc', OW.getLanguageText('photo', 'album_desc'));
 
            $('#add-new-photo-album').on('click', function()
            {
                var fb = new OW_FloatBox(
                {
                    $title: OW.getLanguageText('photo', 'create_album'),
                    $contents: content,
                    width: 500
                });
 
                fb.bind('show', function()
                {
                    $('input.ow_ic_submit', content).off().on('click', function()
                    {
                        var value = albumName.getValue().trim();
 
                        if ( value.length === 0 )
                        {
                            $('span.ow_error', content).show();
                            $(albumName.input).focus();
 
                            return;
                        }
                        else if ( value === OW.getLanguageText('photo', 'newsfeed_album') )
                        {
                            OW.error(OW.getLanguageText('photo', 'newsfeed_album_error_msg'));
                            $('span.ow_error', content).show();
                            $(albumName.input).focus();
 
                            return;
                        }
 
                        fb.close();
 
                        var ajaxUploadPhotoFB = OW.ajaxFloatBox("PHOTO_CMP_AjaxUpload", [0, albumName.getValue(), albumDesc.getValue()], {
                            title: OW.getLanguageText('photo', 'upload_photos'),
                            width: "746px"
                        });
 
                        ajaxUploadPhotoFB.bind("close", function()
                        {
                            if ( ajaxPhotoUploader.isHasData() )
                            {
                                return confirm(OW.getLanguageText('photo', 'close_alert'));
                            }
                        });
                    });
                });
 
                fb.bind('close', function()
                {
                    $('span.ow_error', content).hide();
                });
            });
        });
    {/script}
 
    {decorator name="button" class="ow_ic_add" id="btn-add-new-photo" langLabel="photo+upload_photos" onclick="{$url}();"}
{/if}

Then enable dev mode and refresh the page, then disable dev mode.
In 1.7.2 this issue is fixed
The Forum post is edited by Oxwall Software Nov 27 '14
Philippe
Philippe Nov 28 '14
It's ok.

Thanks.
You do not have permission to reply this topic