Jump to content

Search the Community

Showing results for tags 'translatable strings'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hi guys, I was advised to ask that question here rather than in general, so here it is : I detect the default language from the user browser. Let's say that user is not loggedin, I don't know anything about him. I'd like to display the page in the language retrieved from the browser. What I have now : - a multi-language homepage : displaying french (the default language) if user goes to www.website.com/ or english if user goes to www.website.com/en -> I'm using multi-language fields for that. I'm able to use translatable strings also, such as : echo __("My text to translate"); It works when I switch the url "/" to "/en" for example. I'd like to do that without manual intervention : - detect the browser's language - load the right version of the homepage (User not loggedin, never seen him before scenario). I know how to do it with multi-language : $page->of(false); // turn off outputFormatting (if it's not already) $lg_id = $languages->get('en'); // get the language we want $body = $page->body->getLanguageValue($lg_id); // get the unformatted value in english Is there a similar way to do it with translatable strings ? Thanks
×
×
  • Create New...