jDiction Forum

English => General Questions => Topic started by: wonderland on March 09, 2015, 04:41:50 pm

Title: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 09, 2015, 04:41:50 pm
I would like to know is it possible to have 2 symbol language name in language switcher module, instead of Full name English=EN and so on.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 09, 2015, 06:20:39 pm
in the language switcher module you can change the settings or with some html knowhow you can override the template.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 09, 2015, 08:45:45 pm
In jDiction language module there are only these options:
Show current language
Add alternate meta tags
Style (none of options have 2character language code)
Update fragment

But none of these settings changes the display of full language to 2 letter sybmol

Then I looked into original language switcher module and found the code that can  do this.

So in the end I changed this in modules/mod_jdlanguage/tmpl/default.php on line 46:
from
echo $language->title_native;

to
strtoupper($language->sef);

And now instead of displaying Englsih, I get EN.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 09, 2015, 09:26:27 pm
good and when you copy your default.php to /templates/<yourtemplate>/html/mod_jdlanguage/default.php it will be preserved after the next update
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 09, 2015, 10:12:12 pm
Yes, that I already did :).

I think it wouldn't be bad to include this option in module, I do think that others would find this useful as well.

I also think that it would be beneficial to have a copy button, when you press it it copies content from original language, it may be easier to translate in some cases, but that is up to you of course.

But mainly I would like to thank you for this extension. I will definitely give it a 100% rating on JED. Once I'm finished with this project I'm building I would like to volunteer to improve your documentation, or alternatively I could donate something :)
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 09, 2015, 10:38:21 pm
I think it wouldn't be bad to include this option in module, I do think that others would find this useful as well.
I will consider this.

I also think that it would be beneficial to have a copy button, when you press it it copies content from original language, it may be easier to translate in some cases, but that is up to you of course.
If you click on the blue "I" it copies the text.

But mainly I would like to thank you for this extension. I will definitely give it a 100% rating on JED. Once I'm finished with this project I'm building I would like to volunteer to improve your documentation, or alternatively I could donate something :)
Thanks, every help is welcome!
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 11, 2015, 05:59:26 pm
I actually tried pressing the blue "I" button many times now but not once did the original text copy over.  I can delete the text written by pressing red "X" button, but If I press the blue "I" no text gets copied.

I think I found a bug as well. When I write text in the main text area, without entering intro text (because you don't always have intro text) the whole text of original language gets copied over, please see attached images.

If I then go back to administration panel write something in intro text area and then delete it, the main language text disappears.

I also wanted to ask is it mandatory that there are 2 content areas, intro text and main text? I think the interface would look so much cleaner if there would be just one content box. And people who don't use blog type layouts don't often use "Read More" function to split their text.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 11, 2015, 06:12:50 pm
please open the javascript console of your browser and paste the error massage after clicking of the "I".

If you only translate the full text it will use the introtext of the original language. You can type a space into the intro text to overwrite this.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 11, 2015, 06:26:31 pm
I get this error:
TypeError: e is undefined
....fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.setti...

Regarding the previous thing I mentioned, if I write something in the intro text box and then press the red "X" and leave it empty the entire content of original language also gets copied over. Is this something that is intetional?
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 11, 2015, 06:29:34 pm
yes the red X means delete the translation and take the original text.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 11, 2015, 10:38:28 pm
Could you please let me know why can't I copy the content when I press the blue "I"? I tried another browser just in case, but got the same result.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 12, 2015, 12:01:20 pm
hmm it works for me, so I need super user access to your installation, then I can check if its a problem with the editor or k2 or the javascript framework...
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 14, 2015, 07:41:32 pm
I've sent the access. Thank you for looking into this.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 18, 2015, 10:34:47 am
You are using JCE thats not supported atm.

Another querstion, you have installed jdiction 1.4.1 completly new correct? because the Icons in Backend are missing.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 18, 2015, 12:47:38 pm
Actually, when I was testing this I also switched back to Tiny Mce, but I had the same problem. You can check the site again, I've switched back to tiny MCE, but the problem is still there.

Yes, I installed it from scratch. Which icons do you mean? The one in Tools section?
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 18, 2015, 01:36:19 pm
Ok seams to be only with k2, I will check this later.

Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 18, 2015, 05:39:45 pm
Indeed it is problem only with k2. In Joomla native article component, JCE editor works as well by the way.

Could you please let me know when you do this? Thank you.

Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 24, 2015, 05:32:03 pm
Attached is a version that fixes missing flags in backend and supports Language-Tag in language switcher module.

maybe you would like to try it.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 26, 2015, 09:10:23 am
Thank you very much!

Do I just install it over current version?
Title: Re: jDiction language switcher language name with 2 symbols
Post by: Harald Leithner on March 26, 2015, 09:19:45 am
Yes this will replace your current jdiction Installation.
Title: Re: jDiction language switcher language name with 2 symbols
Post by: wonderland on March 26, 2015, 10:58:42 am
I installed this and I can see the flags in back end now. But unfortunately pressing on the blue "i" still does nothing for me. I even cleared the browser's cache.
I still have the same password if you would like to take a look.