Jump to content

Recommended Posts

Posted

Hi guys,

I've just discovered (thanks to you) textdomain, which works fine.

Now I'd like to use that functionality with sprintf rather than

echo __("my string to translate", "my path")

Is it possible ?

Thanks

Posted

Thanks @Martijn Geerts

It kinda works but I don't get the opportunity to translate the parameters actually.

I write in my translation file '/path/to/myfile.php ' I write :

__('Hello %1$s how do you %2$s?', '/path/to/'), 'Doc', 'do')

but through the admin, the only sentence I see waiting for translation is :

'Hello %1$s how do you %2$s?'

 

Posted

Yes, I understand that. But then, how can I translate the parameters too ? Do I have to do this separately ?

Posted

Yep, you'd need to translate each string on it's own. And keep in mind that translatable strings need all to be on a separate line for parsing reasons.

  • Like 1

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...