I am playing around with ConTemplate and am very pleased with the way you can insert a whole host of php variables.
I have the following in one of my node types:
<div style="background-color:#efefef;width:200px;height:30px;border:3px outset silver;font-size:1.1em;list-style-type:none;"> <a href="profile/<?php print $node->user->uid ?>">My Profile</a> </div>
and it does indeed provide a link to the user's Profile page. As I have a multi-lingual site, I need to now be able to translate that "My Profile" string. I can't find it under Localization/Manage Strings.
I know that in standard module scripts, you only need to wrap the string in t() to be able to manage and translate that string using Localization. So, in short, how can text I add using ConTemplate be made into a translatable string? Does anyone have any experience of this?
thanks
Neil
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
I am playing around with ConTemplate and am very pleased with the way you can insert a whole host of php variables.
I have the following in one of my node types:
<div style="background-color:#efefef;width:200px;height:30px;border:3px outset silver;font-size:1.1em;list-style-type:none;"> <a href="profile/<?php print $node->user->uid ?>">My Profile</a> </div>
and it does indeed provide a link to the user's Profile page. As I have a multi-lingual site, I need to now be able to translate that "My Profile" string. I can't find it under Localization/Manage Strings.
I know that in standard module scripts, you only need to wrap the string in t() to be able to manage and translate that string using Localization. So, in short, how can text I add using ConTemplate be made into a translatable string? Does anyone have any experience of this?
Did you try wrapping it in t()?
Cheers, Gerhard
This is what I now have:
<div style="background-color:#efefef;width:200px;height:30px;border:3px outset silver;font-size:1.1em;list-style-type:none;"> <a href="profile/<?php print $node->user->uid ?>"><?php print t('My Wibbly'); ?></a> </div>
(I've used Wibbly instead of Profile to make string searching easier!!)
The output is perfect but I still can't find that string using Admin/Localization/Manage Strings. Is this syntax correct?
Neil
----- Original Message ----- From: "Gerhard Killesreiter" gerhard@killesreiter.de To: support@drupal.org Sent: Monday, April 09, 2007 7:12 PM Subject: Re: [support] Translating strings added using ConTemplate
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
I am playing around with ConTemplate and am very pleased with the way you can insert a whole host of php variables.
I have the following in one of my node types:
<div style="background-color:#efefef;width:200px;height:30px;border:3px outset silver;font-size:1.1em;list-style-type:none;"> <a href="profile/<?php print $node->user->uid ?>">My Profile</a> </div>
and it does indeed provide a link to the user's Profile page. As I have a multi-lingual site, I need to now be able to translate that "My Profile" string. I can't find it under Localization/Manage Strings.
I know that in standard module scripts, you only need to wrap the string in t() to be able to manage and translate that string using Localization. So, in short, how can text I add using ConTemplate be made into a translatable string? Does anyone have any experience of this?
Did you try wrapping it in t()?
Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGGnQOfg6TFvELooQRAneyAJ9q8KkcTKYfEmV3vsBXCDBwKNkNHwCeLmS/ Smkv6mU0BOoH+8mgRmuWKlM= =zmqC
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
This is what I now have:
<div style="background-color:#efefef;width:200px;height:30px;border:3px outset silver;font-size:1.1em;list-style-type:none;"> <a href="profile/<?php print $node->user->uid ?>"><?php print t('My Wibbly'); ?></a> </div>
(I've used Wibbly instead of Profile to make string searching easier!!)
The output is perfect but I still can't find that string using Admin/Localization/Manage Strings. Is this syntax correct?
Yes, it is, I fail to see why it wouldn't work. Can you have a look directly at the locales tables if the string is in there?
Cheers, Gerhard
I have just checked. I did a search for "Wibbly" in the whole of my drupal mysql db and the only occurence was in dru_contemplate which is the actual place I saved it.
<a href="/profile/<?php print $node->user->uid ?>"><?php print t('My Wibbly'); ?></a><br>
So it hasn't been saved as a text string in any other place across the db, which is clearly why the Manage Strings tool isn't picking it up. Is there something I can do to resolve this problem? I now have untranslatable strings it seems!
Neil
----- Original Message ----- From: "Gerhard Killesreiter" gerhard@killesreiter.de To: support@drupal.org Sent: Thursday, April 12, 2007 10:39 AM Subject: Re: [support] Translating strings added using ConTemplate
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
This is what I now have:
<div style="background-color:#efefef;width:200px;height:30px;border:3px outset silver;font-size:1.1em;list-style-type:none;"> <a href="profile/<?php print $node->user->uid ?>"><?php print t('My Wibbly'); ?></a> </div>
(I've used Wibbly instead of Profile to make string searching easier!!)
The output is perfect but I still can't find that string using Admin/Localization/Manage Strings. Is this syntax correct?
Yes, it is, I fail to see why it wouldn't work. Can you have a look directly at the locales tables if the string is in there?
Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGHfBQfg6TFvELooQRAu6eAJ9mE85F0kUBd/HG/viUWOsCTizbjACfbOoq JXcnAOR2DZDLfKg4SPC1MtE= =tkN2
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
I have just checked. I did a search for "Wibbly" in the whole of my drupal mysql db and the only occurence was in dru_contemplate which is the actual place I saved it.
<a href="/profile/<?php print $node->user->uid ?>"><?php print t('My Wibbly'); ?></a><br>
So it hasn't been saved as a text string in any other place across the db, which is clearly why the Manage Strings tool isn't picking it up.
I don't understand what you are trying to tell me :(
Once the string is in the database the string tool should pick it up.
Did you chose the correct options when searching?
As an alternative you could export your strings into a PO file, edit that and re-upload.
Cheers, Gerhard
Yes, I don't understand why the string tool isn't finding it because it is inside t()
I've run cron too so that isn't the problem.
The thing I don't understand about PO files is the numbers in the first line of each entry, those referring to the module lines I presume. I hope I can leave those empty.
----- Original Message ----- From: "Gerhard Killesreiter" gerhard@killesreiter.de To: support@drupal.org Sent: Thursday, April 12, 2007 11:24 AM Subject: Re: [support] Translating strings added using ConTemplate
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
I have just checked. I did a search for "Wibbly" in the whole of my drupal mysql db and the only occurence was in dru_contemplate which is the actual place I saved it.
<a href="/profile/<?php print $node->user->uid ?>"><?php print t('My Wibbly'); ?></a><br>
So it hasn't been saved as a text string in any other place across the db, which is clearly why the Manage Strings tool isn't picking it up.
I don't understand what you are trying to tell me :(
Once the string is in the database the string tool should pick it up.
Did you chose the correct options when searching?
As an alternative you could export your strings into a PO file, edit that and re-upload.
Cheers, Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGHfq9fg6TFvELooQRAn3TAJwNiAGitz36ygtpMwzy6I9qFaBYfQCgvc0I y3n6m9AP3BVlKK9eDtFsM98= =qDUU
-----END PGP SIGNATURE-----
[ Drupal support list | http://lists.drupal.org/ ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Neil: esl-lounge.com schrieb:
Yes, I don't understand why the string tool isn't finding it because it is inside t()
I've run cron too so that isn't the problem.
The thing I don't understand about PO files is the numbers in the first line of each entry, those referring to the module lines I presume. I hope I can leave those empty.
Yes, these lines start with # and are only comments.
Cheers, Gerhard