Simplified Chinese tooltips on Highslide not working

Phoca Gallery - image gallery extension
laomeng
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 17 Mar 2010, 03:51

Simplified Chinese tooltips on Highslide not working

Post by laomeng »

I'm using 2.6.0 Beta of phocagallery. I've got the simplified Chinese language files and they are working, at least to the degree they are completed. My problem is on Highslide slide shows the tooltips that pop up (for going to next slide, stopping show, etc) are still English. I noticed that the highslide guy says there should be a hs.lang defined for all this text. While it's done a bit differently than the highslide guy recommends I see that in administrator/components/com_phocagallery/front/assets/js/highslide/highslide-full.js and components/com_phocagallery/assets/js/highslide/highslide-full.js the values are defined. Unfortunately when I change the English text in those files to simplified Chinese characters it told me the encoding was wrong and conversion couldn't happen. It seems the files are encoded in a western character set. So I created a new file encoded with utf-8 and then copied all the contents of highslide-full.js into it and also changed the English strings to Chinese under the lang section (I did this for both of the highslide-full.js files). After doing this when I click on a photo in a gallery the photo comes up on the screen but it is not a slideshow, the controls that have the tooltips are not there and only the one photo shows (at the correct size) but it is not over the top of the page as was the case before. So my changes seem to have broke everything, which I am quit confused about. Can somebody explain to me what is happening and how I'm supposed to use non-western characters in highsilde under phocagallery? Thanks in advance!

(by the way, when I downloaded the simplified chinese langauge zip file and tried to install it in the normal Joomla way it didn't work as Joomla complained there was no xml file present, which was correct, so I just moved the files into place by hand which worked fine)
GenkaiNashi
Phoca Enthusiast
Phoca Enthusiast
Posts: 84
Joined: 12 Jul 2009, 22:03

Re: Simplified Chinese tooltips on Highslide not working

Post by GenkaiNashi »

Do you have a back up of the files you edited? If you do, replace your edited files with the original files for now to fix the broken pages. Also, can you include a link to the gallery? Thanks.

Then try replacing only this portion only on components/com_phocagallery/assets/js/highslide/highslide-full.js:

Code: Select all

var hs = {
// Language strings
lang : {
	cssDirection: 'ltr',
	loadingText : 'Loading...',
	loadingTitle : 'Click to cancel',
	focusTitle : 'Click to bring to front',
	fullExpandTitle : 'Expand to actual size (f)',
	creditsText : '',
	creditsTitle : '',
	previousText : 'Previous',
	nextText : 'Next', 
	moveText : 'Move',
	closeText : 'Close', 
	closeTitle : 'Close (esc)', 
	resizeTitle : 'Resize',
	playText : 'Play',
	playTitle : 'Play slideshow (spacebar)',
	pauseText : 'Pause',
	pauseTitle : 'Pause slideshow (spacebar)',
	previousTitle : 'Previous (arrow left)',
	nextTitle : 'Next (arrow right)',
	moveTitle : 'Move',
	fullExpandText : '1:1',
	number: 'Image %1 of %2',
	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
},
With this:

Code: Select all

var hs = {
// Language strings
lang : {
	cssDirection: 'ltr',
	number: 'Image %1 of %2',
	loadingText :     '载入中...',
	loadingTitle :    '取消',
	focusTitle :      '置于最前',
	fullExpandTitle : '原始尺寸',
	fullExpandText :  '完整尺寸',
	creditsText :     '基于<i>Highslide JS</i>',
	creditsTitle :    '查看 Highslide JS 官方首页',
	previousText :    '上一张',
	previousTitle :   '上一张 (左方向键)',
	nextText :        '下一张',
	nextTitle :       '下一张 (右方向键)',
	moveTitle :       '移动',
	moveText :        '移动',
	closeText :       '关闭',
	closeTitle :      '关闭 (退出键)',
	resizeTitle :     '调整尺寸',
	playText :        '播放',
	playTitle :       '播放幻灯片 (空格键)',
	pauseText :       '暂停',
	pauseTitle :      '暂停幻灯片 (空格键)',
	restoreTitle :    '单击关闭图片,单击不放拖动图片。使用方向键进行图片切换。',
},
Do not forget the comma's , or it'll break.
Let me know if it works, I tested it on my site and it worked fine. Save as UTF-8. Don't change anything else.
laomeng
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 17 Mar 2010, 03:51

Re: Simplified Chinese tooltips on Highslide not working

Post by laomeng »

I tried just changing the section you suggested but I'm getting the same behavior. Unfortunately I can't include a link to the gallery as the person I'm doing this for doesn't want it "public" so it is only running on a server that is not accessible from the outside world. I don't see where I can attach a file to this message, and there is a limit to the number of characters allowed so I can't send the whole thing. so I'll just paste my hs.lang section here. Would you mind checking to see if you put this code your highslide-full.js file if it works or not? Also, perhaps you could email me your file (stampeding.herd@yahoo.com) and I could try it in my setup? By the way, what version of phocagallery are you using?
Thanks!

Code: Select all


var hs = {
// Language strings
lang : {
   cssDirection: 'ltr',
	loadingText: '载入中...',
	loadingTitle: '取消',
	focusTitle: '置于最前',
	fullExpandTitle: '原始尺寸',
	creditsText: '基于<i>Highslide JS</i>',
	creditsTitle: '查看 Highslide JS 官方首页',
	previousText: '上一张',
	nextText : 'Next',
	moveText : 'Move',
	closeText : 'Close',
	closeTitle : 'Close (esc)',
	resizeTitle : 'Resize',
	playText : 'Play',
	playTitle : 'Play slideshow (spacebar)',
	pauseText : 'Pause',
	pauseTitle : 'Pause slideshow (spacebar)',
	previousTitle : 'Previous (arrow left)',
	nextTitle : 'Next (arrow right)',
	moveTitle : 'Move',
	fullExpandText : '1:1',
	number: 'Image %1 of %2',
	restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
},

GenkaiNashi
Phoca Enthusiast
Phoca Enthusiast
Posts: 84
Joined: 12 Jul 2009, 22:03

Re: Simplified Chinese tooltips on Highslide not working

Post by GenkaiNashi »

I tried your code, it works on my server. Maybe try upgrading to Phocagallery 2.6.2 and working with that? I'll email you my Highslide.js later.
laomeng
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 17 Mar 2010, 03:51

Re: Simplified Chinese tooltips on Highslide not working

Post by laomeng »

I've upgraded to 2.6.2 and it all works fine now. I think I may have figured out what stupid thing I did to make it fail previously. I use vim on linux to edit so when I get hold of files that have been edited on PC's and have the <CR><LF> at the end of lines the <LF> shows up as ^M. I hate that. So I did the old :s1,$s/.$//g. Unfortunately it seems that somewhere along the way somebody edited a few lines in this file with an editor that doesn't add the <LF> so my hasty substitution actually wiped out some valid characters, thus ruining the file. My bad :x and I apologize. Anyway, now I've got 2.6.2 running and the correct characters are showing up on my screen. Thanks for your help GenkaiNashi!
GenkaiNashi
Phoca Enthusiast
Phoca Enthusiast
Posts: 84
Joined: 12 Jul 2009, 22:03

Re: Simplified Chinese tooltips on Highslide not working

Post by GenkaiNashi »

Glad I could help and you figured it out. =)
Post Reply