Jump to content

Do translatable strings are functional anywhere ?


Doc
 Share

Recommended Posts

Hi guys,

I've just had this wonderful idea : I know that multi-language field (example : $page->myfield) are useful whatever the page. I mean you can define a multi-language field in your homepage and make use of that same field in another page and benefit of the different translations there too.

Is it the same for translatable string (such as echo __("blablabla")) ? Am I able to translate some strings in one template and benefit of those translated strings in another template ?

Thanks

Link to comment
Share on other sites

I am not a big ML user, but I ended up with a Table field on the home page for sitewide translations. I use a 'name' field for the first column and a textAreaMultilanguage for the second column. This makes it really easy to add new strings and edit via the admin. I wrap the Table field in a fieldsetTab called "Sitewide Translations" to keep it separate from the main content.

  • Like 4
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...