Recent Topics

1 Jul 28, 2007 21:31    

My b2evolution Version: Not Entered

Hi

is possible to write posts in 2 languages ?

I dont want 2 post: one in english and one in my language
I want one post where people can choose language

sorry for my english and thanks to all

2 Aug 09, 2007 16:30

This 'problem' has been in my thoughts for some time also. I believe there was a previous post.

What if you tried this:

<?php if ( $locale_lang == 'fr' )
{
echo('
  <style>
    div.french{
    visibility: visible;}
    div.english{
    visibility: hidden;}
  </style>
');
}
else
{
echo('
  <style>
    div.french{
    visibility: hidden;}
    div.english{
    visibility: visible}
  </style>
');
};
?>


Or something along those lines. This gives you a possible <div class="french"> and a div <div class="english"> you can both use in your post.
This is only a concept. I haven't worked on it or tested.

*edit*
This is not it, it calls the locale of the blog, I need the locale of the user.

*edit*
make it:

<?php
if ( $mb_language == 'fr' )
...

balupton replied:

balupton wrote:

global $current_User;
if ( is_logged_in() )
$locale = $current_User->locale;
else
$locale = locale_from_httpaccept(); // set default locale by autodetect

then use the locales instead of "french" "english" etc. And this should be a new topic instead of bloating my plugin's topic ;)

see also: [url=http://forums.b2evolution.net/viewtopic.php?t=12170&start=0&postdays=0&postorder=asc&highlight=][Plugin] Show/Hide Post Contents
[/url]


Form is loading...