Jump to content


Photo
- - - - -

Simple translation patch for Pagelines

i18n translate

Best Answer Simon_P , 12 April 2013 - 01:05 AM

If you test this and it works, I dont mind adding it to core.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 infoadvisor

infoadvisor

    Newbie

  • Members
  • 4 posts

Posted 11 April 2013 - 10:15 AM

Hi,

 

I have a little suggestion for developers. I want to translate PL menu in admin panel, but it is not so simple. Adding i18n for ui_key function in library.functions.php like that:

 

Please Login or Register to see this Hidden Content

Could be much useful.

 



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 12988 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 11 April 2013 - 10:21 AM

Hi,

 

Not sure why you would want to translate the PageLines settings name, as its our brandname. Its the same for brands like Coke Cola, the branding isn't translated, it remains the same throughout most countries.



#3 infoadvisor

infoadvisor

    Newbie

  • Members
  • 4 posts

Posted 11 April 2013 - 10:30 AM

I don't want to translate "Pagelines" or anything related with your brand. Just menu items like "Site Options" or "Drag & Drop" could be translated for better understanding, especially in European languages :)



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 12988 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 11 April 2013 - 11:14 AM

As far as I am aware, it is already possible to translate the backend options, see our translation center -

Please Login or Register to see this Hidden Content

The Dutch full translation has store translation to Winkel, which I assume is a correct translation.



#5 infoadvisor

infoadvisor

    Newbie

  • Members
  • 4 posts

Posted 11 April 2013 - 12:25 PM

I've tested Dutch translation, and all tabs names in admin are still in english. The only way I know is add __() method to ui_key, as i wrote. Of course i can do this manually, but integrating it with core could be helpful thing :)



#6 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 12 April 2013 - 01:04 AM

No sorry that simply wont work.

 

The translation script scans the file for translation strings, it is NEVER actually executed, so:

 

__( 'hello', 'domain' );

would produce:

msgid "hello"
msgstr ""

 

__(ucwords( str_replace( '_', ' ', str_replace( 'pl_', ' ', $key) ) ),'pagelines');

would produce:

msgid ""
msgstr ""

 

So pointless.

 

A better idea would be:

 

Please Login or Register to see this Hidden Content

 
Now you can use a filter to do your translation.


#7 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 12 April 2013 - 01:05 AM   Best Answer

If you test this and it works, I dont mind adding it to core.



#8 infoadvisor

infoadvisor

    Newbie

  • Members
  • 4 posts

Posted 12 April 2013 - 08:25 AM

I made other plugin to generate items for gettext scanner, but idea with filters is much better :)

Adding it to core could be great.

 

Thanks.







Also tagged with one or more of these keywords: i18n, translate