Jump to content

Recommended Posts

Posted

As the administration backend of the Comments module is not translated and i have a costumer which does not speak English i am trying to make it translatable.

I already made some parts translatable (Dropdown with "Pending", "Approved", "Spam" and "Delete" and the status which is shown at the right side ("Approved" and "Pending") - now i am trying to translate this part:

"\n\t\t\t<span class='CommentsAdminItemBy'>Comment #$num Posted " . date('m/d/y H:i', $comment->created) . " by " . htmlentities($comment->cite, ENT_QUOTES, 'UTF-8') . "</span>" . 

As this is my first attempt to make a module translatable i made it like this, which works fine for my personal use:

"\n\t\t\t<span class='CommentsAdminItemBy'>".$this->_("Comment")." #$num "
.$this->_("Posted") ." ". date('m/d/y H:i', $comment->created) ." "
.$this->_("by"). " ". htmlentities($comment->cite, ENT_QUOTES, 'UTF-8') . "</span>" . 

But of course it's not very smart to have the words "Comment", "Posted" and "by" translatable as seperate strings and as i saw in the documentation there seems to be a possibility using something like:

$out = sprintf(__("Created %d pages."), $count); 

I tried to make the string translatable in a similar way but i cannot get it to work - would be great if somebody could help me with the part above to show me the right direction.

Posted

Doolak, I will go ahead and make this translatable and included in the core this week -- didn't realize I'd missed this one. 

  • Like 1
Posted
Doolak, I will go ahead and make this translatable and included in the core this week -- didn't realize I'd missed this one. 

Great, thanks - that will make it unnecessary that i have to replace the InputfieldCommentsAdmin.module everytime after an update - or use a duplicate of that module just for the translated part ;-)

But certainly it was a good thing for me to learn a bit about the translatable strings - and thanks to Martijn and Soma, i managed it to include the #$num - part now with the sprintf function:

"\n\t\t\t<span class='CommentsAdminItemBy'>".sprintf($this->_("Comment #%d Posted"),$num)." ". date('d.m.Y H:i', $comment->created) ." "
.$this->_("by"). " ". htmlentities($comment->cite, ENT_QUOTES, 'UTF-8') . "</span>" . 

@ryan: If you will be working on the InputfieldCommentsAdmin.module making it translatable, i have a fews suggestions for the module:

1. Don't know if this makes sense, but would be nice to have a possibility to change the date format in the field settings

2. If you sort newes to oldest - the comment numbers stay counting from 1 to ... - they should be inverted, too.

3. Would be great if instead of "Spam is automatically deleted after the amount of time specified in the field configuration." one could display the amount of time or the date the Spam will be deleted

Posted

Ahh, forgot to mention: In the FieldtypeComments.module there are several strings untranslated, too (all the field settings and the text of the notification email).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...