SOLVED cufon for different lanuage types

More
11 years 2 months ago #1 by laurelle
Hi,

I don't have a multi-lingual site to do any testing on, so it it hard to help you.

After $currlang is set try echoing out its value to make sure that it is set to zh-TW.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #2 by soulpatty
Hello,

Thank you very much for your quick reply.

I did do this but it still didnt work. I've attached the php file I'm using.

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #3 by laurelle
Hi,

You would need to change the file so the lines with:
if ($currlang == "ru-RU") { return; }

has either:
if ($currlang == "zh-TW") { return; }

or:
if ($currlang != "en-GB") { return; }
then it will not use cufon for any language other than English.

Note that this needs to be change in more than one place in the file.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #4 by soulpatty
Hi,

I tried to use this file for zh-TW, but it's not working..
Any suggestions?? The weblink is www.navinode.com , I tested it with en-GB and it's working but for some reason the zh-TW isn't/

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #5 by Sfinx93
Ok thanx for looking. I am not shore if I understand you.. so you didnt see any russian letters at all?
Anyways in the mean time I used time consuming solution and edited all fonts in font editor, I added russian symbols, so they are actually part of font now and everything shows correctly.
Thank you again for taking time to help!

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #6 by laurelle
Hi,

I don't see that the language has been set to Russian on the page. Your going to have to try and debug the problem. I don't know what it is exactly as I haven't used other languages in Joomla.

Sorry

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #7 by Sfinx93
I renamed file and uploaded it, but it doesn`t seem to do anything. You can look my page at www.ambienti-kocar.si/ru/interjer
You will notice that article title is missing, instead there is only few ,,,, signs. Also in the bottom where tabbed module is used, there are no titles (you can check ENG language for comparison). Buttons are also cufon generated (buttons use font nr. 1 - I have 2 fonts on page), but I added russian signs from different font to button font and that is why they are showing as they are.
My second font is one of Cufons default fonts -Prociono and it has no russian signs, also I don`t have original and adding russian signs is not possible.

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago - 11 years 2 months ago #8 by laurelle
Hi,

Try replacing the kc_cufon.php file with the one attached. Note that you will need to change the filename of the attached to kc_cufon.php. I haven't tested this to see if it works or not.

Attachment kc_cufon_1.zip not found



Note, you will need to unzip the file first.

Laurelle
Developer
Keashly.ca Consulting
Attachments:
Last edit: 11 years 2 months ago by laurelle.

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago - 11 years 2 months ago #9 by Sfinx93
Joomla verison 1.5.24
Cufon - Version 1.5.0

p.S. Obviesly I dont know how to attach php file :S . I browsed to file on my computer (select file to attach), but when I submit, attached file is not there...
I could copy php code directly to message, but I dont wanna mess this topic...?
Last edit: 11 years 2 months ago by Sfinx93.

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #10 by laurelle
Hi,

Your attachment didn't come through, could you try that again.

Also, what version of Joomla and the plugin are you using.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #11 by Sfinx93
Hello,
I have the same problem, only that I need inactive cufon for Russian language. I have 3 languages on site (slovenian, english and russian).

I know laurelle has offered a solution and tastymouse confirmed it works, but I cant get it to work.
I don`t know much about php, so my guess is that I am putting it on the wrong place.

I tryed to put code on different places, but no luck. Either it doesn`t do anything or I get php error on page.

I used this code:
$language = & JFactory::getLanguage();
$currlang = $language->_lang;
if ($currlang == "ru-RU") { return; }

Would you be so nice to tell me exactly where to put it?
I attached php file with "my" code added on 3 places (before -onAfterInitialise(), onAfterDispatch() and onAfterRender())
If anyone will have time to look at it I will be grateful.

thanx!

P.S.Language code ru-RU is correct - I checked

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #12 by laurelle
Hello,

Glad that you got it working.

Thank you so much for the donation. I really appreciate it.

Cheers.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 9 months ago #13 by tastymouse
I think I've got it working :).

$language = & JFactory::getLanguage();
$currlang = $language->_lang;
if ($currlang == "ja-JP") { return; }

I'll do some more testing later and will post the outcome.

Thanks, Tom

Edit: yes, it works okay. I get the Cufon fonts in Dutch and English and the normal fonts in Japanese.
ps. I made a donation to thank you for your support :)
Last edit: 12 years 9 months ago by tastymouse.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #14 by laurelle
Hello,

Open the file kc_cufon.php at the top of the functions onAfterInitialise(), onAfterDispatch() and onAfterRender() try adding:

if ($this->language == "jp-jp") { return; }

(Not sure if that is the correct code for Japanese: jp-jp, fix that with the correct code for Japanese)

But I am not sure that the language variable will be defined. If not you will need to add something like:

$language =& JFactory::getLanguage();
$currlang = $language->_default;
if ($currlang == "jp-jp") { return; }

Good luck.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #15 by tastymouse
laurelle wrote:


You could hack the plugin so it didn't do anything if the language is Japanese, just return.

Hi Laurelle, I think that would be the best solution too. Can you tell me how I can do this?

Thanks, Tom

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #16 by laurelle
Hello,

Cufon sets up the name of the font file based on the font family that you are using. The Cufon font file generator is done by the cufon project. They do allow you to change the name that you want used, so I guess you could call the fonts en-GB and jp-JP for example. Then I would have to change the plugin to have a parameter which uses language named font files, but that would limit the font that you could use to 1 font per language. That would be really confusing for most people, so I wouldn't want to add that to the current cufon plugin in.

You could hack the plugin so it didn't do anything if the language is Japanese, just return.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #17 by tastymouse
That could be an option, to use a language dependent template.
Another option could be to change the KC Cufon plugin, so that it calls language dependent js files.
I had a look at this tips at Joomfish: www.joomfish.net/en/blog/30-ivos-blog/90...dent-design-of-course-with-joomfish-only

Thanks, Tom

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #18 by laurelle
Hello,

Sorry, I haven't used Joomfish so I don't know the answer to this.
If the English and Japanese sides have some CSS that has something that makes them different then you could use that to change the font or make the CSS more specific so it only targets the English side.

So if you had the English side wrapped in say a <div id="en"> and the other as <div id="jp"> then you could use for example div#en h1 being font1 and div#jp h1 being font2.

Good luck.

Laurelle
Developer
Keashly.ca Consulting

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 8 months ago #19 by tastymouse
I'm working on a site that has an English and a Japanese version. I use Joomfish. Is there a way to make the Cufon inactive for the Japanese version? Or use a Japanese font for the Japanese version of the site?
Last edit: 12 years 8 months ago by tastymouse.

Please Log in or Create an account to join the conversation.

Joomla! & WordPress Hosts

Liquid Web is our recommended web hosting provider for Joomla! & WordPress websites. This is the host that we use for websites that we build. Liquid Web has an excellent reputation, fast servers and most importantly awesome service! They have technicians that are familiar with Joomla! & WordPress. Their technicians go above and beyond what other hosting providers do, in our opinion.

  

Liquid Web Managed Word Press  

Support Development

Please consider a small donation to support development of the extensions on this site.



Joomla! Login

This is the normal Joomla! login module not the VirtueMart login module. Click the 'Create an account' button to see how you are redirected to the VirtueMart registration form when the KC VM Registration Redirect plugin is enabled.

Joomla! & WordPress Web Design and Development

If you are interested in having a website designed or redesign or need custom Joomla! or WordPress development, please visit Keashly.ca Consulting to view our Portfolio of Joomla! & WordPress website work.

Trademarks and logos remain the property of their respective organizations.
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries.
Keashly.ca Consulting is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Site Map Back to Top