Page 1 of 2

[solved] Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 1:24 pm
by peon2t
Hey there

Because of several problems I had to Update from 1.5.2 MLE to 1.6.3 MLE.
Now I have to use this new ?TRanslationManager' instead of the good old $mle_translation.key strings.

The Problem is: While the old method worked great, the new method always gives me a "nothing to translate" :(
Maybe I'm too stupid to understand the Mini HowTo?

What I tried is:

- Adding the two languages and importing the strings from the old method
(This worked - I now thave in the TranslationManager the languages with the keystrings and the translations)

- Adding the keystrings to the template:

{tr_key key="keystring123" lang="$lang" assign="k123"}

(and use $123)

Now the $123 thing doesn't seem to work at all, and at the place where I put the {tr_key... thing, It always echoes "nothing to translate"... Why is this?

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 2:09 pm
by alby
peon2t wrote: Because of several problems I had to Update from 1.5.2 MLE to 1.6.3 MLE.
Why?

peon2t wrote: Now I have to use this new ?TRanslationManager' instead of the good old $mle_translation.key strings.
It's DEPRECATED and will drop in next releases but work too

peon2t wrote: ... It always echoes "nothing to translate"... Why is this?
TR echoes this when you have not key param or lang param is empty, check that values

Alby

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 2:19 pm
by peon2t
- Why: Because the preview didn't show the Sidebar.

- The old Method does not work anymore for me.

- I think the $lang is empty. But why?

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 2:36 pm
by Peciura

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 2:48 pm
by alby
peon2t wrote: - Why: Because the preview didn't show the Sidebar.
peon2t wrote: Because of several problems I had to Update from 1.5.2 MLE to 1.6.3 MLE.
You had problem in update process or preview in 1.5.2?
...before 1.6.X version preview not display other content blocks
Preview in prev 1.6 (CMSMS or CMSMS MLE) NOT display other content tags

peon2t wrote: - The old Method does not work anymore for me.

- I think the $lang is empty. But why?
Have you MLE and set?

Alby

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 2:52 pm
by peon2t
I tested with the method in your link.

It's right, $lang is empty...

But I saw that $hl has the same value which $lang should have, so I tried to use $hl instead of $lang in {tr...

This causes a new problem:  It works only for the one language but not for the other!
If I use $hl to tell {tr... the language, it correctly displays the translation for the first language. But if I switch to the other language, it still shows the translation of the first language. (Even if $hl now contains another language)... Why this?

(@ alby: I know that preview in pre1.6 did not display other content tags.. this is why I updated. And yes, I have MLE, I'ts a multilingual website.)

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 3:04 pm
by alby
peon2t wrote: It's right, $lang is empty...
You don't follow the Installation/Upgrade procedure case C ....

Alby

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 3:44 pm
by peon2t
Well I tought I did...

But by going trough it step by step again, I saw where the problem could be: The 'locale_cms' field in the config_lang.php is empty. (I don't know why this is.. did I do anything wrong?)

Anyway: I added it manually and now the $lang variable is correct.

But I still have the Problem  from the last posting:

"This causes a new problem:  It works only for the one language but not for the other!"

Now it shows the correct translation for the first language, but when I switch to the other language, it still shows the translation for the first language!!

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 4:08 pm
by alby
peon2t wrote: Anyway: I added it manually and now the $lang variable is correct.
no manual but automating setting ....

Alby

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 4:30 pm
by peon2t
But as you could see, it did not work automatical...
I did do the settings automatical 10 times in Admin -> General Settings -> MLE languages but the cms_locale still were empty... so I had to do it manually and that worked. $lang works now. Unfortunately there is still this other problem which I already mentioned.. and this seems to be a problem of the TranslationManager, not oft any MLE settings.

The problem is, that TranslationManager always gives the string of the default language! So if I set language A as default in TranslationManager, it will always echo the string for language A even if I'm vistining the page in language B... when I set language B as default, it's the other way round...

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 4:41 pm
by alby
peon2t wrote: The problem is, that TranslationManager always gives the string of the default language! So if I set language A as default in TranslationManager, it will always echo the string for language A even if I'm vistining the page in language B... when I set language B as default, it's the other way round...
This is the default value of TR target lang if failed all checking
put {$lang_locale} before {tr_key ...} tag and look the value for any languages

Where you put {tr_key} tag in your template, in body or head section?

Alby

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 4:49 pm
by peon2t
{$lang_locale} returns en_US.utf8 when browsing the english version and de_DE.utf8 when browsing the german version.
{$lang} returns en_US when browsing the english version and de_DE when browsing the german version.

"locale" in the TranslationManager is called de_DE for the german version and en_US for the english version.

I tried to put the {tr_key} tag in head and body - it makes no difference, it always only shows the default language translation.

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 5:36 pm
by alby
peon2t wrote: I tried to put the {tr_key} tag in head and body - it makes no difference, it always only shows the default language translation.
No, {tr_key} must be in body section
Now active debug in config.php and put a {tr_key lang=$lang key=xxxxx} (copy this tag and substitute xxxxx only) without assign

Alby

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 5:58 pm
by peon2t
I have it in body section... just tried to put it in head because you asked.

I activated debug and put your tag (it prints the translation of the key in default language).

Debug gives me the following at the top of the page:

Code: Select all

Notice: Undefined index: path in /home/lsc/public_html/include.php on line 233

Warning: Cannot modify header information - headers already sent by (output started at /home/lsc/public_html/include.php:233) in /home/lsc/public_html/include.php on line 236

Warning: Cannot modify header information - headers already sent by (output started at /home/lsc/public_html/include.php:233) in /home/lsc/public_html/index.php on line 376
I looked after the lines which are mentioned in the warning:

Code: Select all

include.php

232  $pu_root_url = parse_url($config['root_url']);
233  $cookie_path = rtrim($pu_root_url['path'], '/').'/';
234  $cookie_domain = (strpos($pu_root_url['host'],'.') !== false) ?$pu_root_url['host']:null;
235  $cookie_secure = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on') ?true:false;
236  setcookie('mle', $hl, time()+1800, $cookie_path,$cookie_domain,$cookie_secure);


index.php

376  header("Content-Type: " . $gCms->variables['content-type'] . "; charset=" . (isset($pageinfo->template_encoding) && $pageinfo->template_encoding != ''?$pageinfo->template_encoding:get_encoding()));



and a huge output at the bottom... I put it in a textfile which I attached, since I don't know what is relevant for you.

Re: Translation Manager says: "nothing to translate"

Posted: Sun Oct 25, 2009 6:05 pm
by Peciura
Update to 1.6.6 mle
It is diff of regular cmsms.
http://forum.cmsmadesimple.org/index.ph ... #msg181772