Irrelon / jquery-lang-js

i18n Allow instant language switching on HTML pages without reloading the page.
https://www.irrelon.com
362 stars 132 forks source link

Can't get the plugin to work #46

Closed isadvertising closed 9 years ago

isadvertising commented 9 years ago

hi there! I'm doing a few tests to see if I can use the plugin to translate one of our client's website from english to spanish. however, after following all the steps on the documentation, I can't get it to work.

did I miss something or am I doing something wrong?

url to my test page: http://isconnect.com.au/maxtend/whatismaxtend.php

at the moment I'm only trying to make 'Maximum Flexibility' change to 'Flexibilidad Maxima'

also, can the 'tokens' be whole paragraphs?

thanks!

Irrelon commented 9 years ago

Hey ya,

If you open your JS console and then try to switch languages the plugin gives you the info you need to fix the error. The two errors your page has are:

Failed to load resource: the server responded with a status of 404 (Not Found)

jquery-lang.js:492 Uncaught Attempt to change language to "es" but no language pack for that language is loaded!

It appears you are missing the jquery-cookie plugin and you also haven't registered the language pack for 'es'.

Hope that helps!

isadvertising commented 9 years ago

Hi, I checked and I had jquery.cookie instead of jquery-cookie. I changed that now. I've also tried to use the 'th' language pack that comes as default (just to test if it working) and also no luck.

Not sure I know how to register the language packs. Can you help me on that? http://isconnect.com.au/maxtend/whatismaxtend.php

Thanks!

Irrelon commented 9 years ago

You need to make sure you have followed the instructions in the readme.md. You are missing the section of code that defines the language plugin instance. Take a look in the readme under:

Add the following to your HTML page in either the head or body
isadvertising commented 9 years ago

Hi,

I tried not to load the packs dynamically using the noDynamic.js file and it kind of worked. But it only changed one sentence (Maximum Flexibility) and it's changing it to Thai, even though I set the .js file as:

"token": { "Maximum Flexibility":"Flexibilidad Maxima",

So not sure what's happening here.

I have the same setup for Maximum Quality, but nothing happens with that sentence.

Will this plugin work if I have a whole paragraph to translate, with punctuation and everything? Or would I have to scan the website and pick up every word used?

Thanks!

isadvertising commented 9 years ago

Sorry, forgot to mention: I tried using both jquery-cookie.js (included in your download) and also the jquery.cookie.js (from https://github.com/carhartl/jquery-cookie) and same result either way. even tried using both at the same time, just to test all possibilities.

isadvertising commented 9 years ago

Hi there,

I'm trying to make the script replace a page that is currently in an iframe, Tried to do the same procedure as with changing images but had no luck.

This is what I have on the HTML code:

And in the nonDynamic.js, I have: "http://www.maxtend.com.au/newsite/experience.php":"http://www.isconnect.com.au/maxtend/newsite/experience_es.php",

You can see the page here: http://isconnect.com.au/maxtend/results.php

Is what I'm trying to do possible?

Thanks!