The AVChat forums moved to discuss.avchat.net

Jump to content


Photo

2 languages in AVChat


  • Please log in to reply
24 replies to this topic

#1 Nicole Deinhard

Nicole Deinhard

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 12 February 2011 - 12:49 PM

I want to have 2 langauges in Avcaht, how can i add this, i have en.xml and ge.xml. How is possible that avchat deliever englisch for english browser and german for german broswer.

Thank you

#2 Ede

Ede

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 12 February 2011 - 07:16 PM

I want to have 2 langauges in Avcaht, how can i add this, i have en.xml and ge.xml. How is possible that avchat deliever englisch for english browser and german for german broswer.

Thank you



I found a Solution and have send you an email.

#3 dream12

dream12

    Advanced Member

  • Members
  • PipPipPip
  • 338 posts

Posted 12 February 2011 - 07:24 PM

I found a Solution and have send you an email.

I believe all other users running into the same problem would appreciate if you post your solution here.

#4 Rafa

Rafa

    Advanced Member

  • Members
  • PipPipPip
  • 322 posts

Posted 13 February 2011 - 01:05 AM

Yeah Dream .. you are right .. this is what we expect from our "friends" on this forum ..

Forum is to share ideas and solutions ....

#5 Ede

Ede

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 13 February 2011 - 11:07 AM

Hello,

i have replaced in the avc_settings.php :

$avconfig['languagefile']='translations/en.xml'; (about line 26)

to:
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) == 'de'){

$avconfig['languagefile']='translations/gm.xml';}

else {$avconfig['languagefile']='translations/en.xml';}

It works fine for me.

Regards

Edgar

#6 Rafa

Rafa

    Advanced Member

  • Members
  • PipPipPip
  • 322 posts

Posted 13 February 2011 - 11:13 AM

Thanks for share your solution.

In the future you can create a file called integration.php and add it to avchat root directory.

Inside this file, you can add your custom code.

It helps when you needs to upgrade avchat to a new version .. :angry:

#7 dream12

dream12

    Advanced Member

  • Members
  • PipPipPip
  • 338 posts

Posted 13 February 2011 - 12:38 PM

Great solutions!! :angry:

#8 hollywoodstarrs

hollywoodstarrs

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 10 April 2011 - 12:22 AM

Great solutions!! :P


I went into the integration.php file for the avchat3 and inserted the following code:
========================================================================
//Setup langugae
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) == 'de'){

$avconfig['languagefile']='translations/zh-CN.xml';}

else {$avconfig['languagefile']='translations/en.xml';}
=========================================================================
I was not sure if I should remove this line of code: $avconfig['languagefile']='translations/en.xml';from the avc_setting.php file. I did hide it by using the comment code "#". I created a new .xml file that holds the translation in it (zh-CN.xml). How do I test it? Now my partner in USA has switched his computer over to the simplified Chinese and it didnt work. I could really use some suggestions. -----Allen

#9 maza2

maza2

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 11 April 2011 - 01:24 PM

It's all nonsense!

I now had to AVChat integrated into Social Engine gave tongue in a video chat so what stait site the user is not what browser the user!

4 hours =) wrote

#10 maza2

maza2

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 11 April 2011 - 01:26 PM

ru - en
in the browser Russian now quietly switched!

#11 Richard67

Richard67

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts
  • LocationGermany

Posted 11 September 2011 - 02:57 PM

Hello,

I have a Joomla 1.7 multilingual site, using Joomla's language switcher.

For starting AVChat in the currently selected language I have added following code to the integration.php script:

$lang = &JFactory::getLanguage();

//Change language file to file for adjusted language, if available
$testlangfile = 'translations/'.$lang->get('tag').'.xml';
if(file_exists("$testlangfile")){
$avconfig['languagefile']=$testlangfile;
}

(code end)

The code checks if there is a file named like the language tag, e.g. "de-DE.xml" or "ru-RU.xml" in the translations folder and, if so, overwrites the default value for $avconfig['languagefile'] previously set by the avc_settings.php script.

Maybe this helps someone who wants the same thing, too.

Because this solution does not contain any hard-coded language names and is fully conformal to Joomla standards, it should be considered to integrate it into the AVChat Joomla component with future versions.

#12 Richard67

Richard67

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts
  • LocationGermany

Posted 11 September 2011 - 03:31 PM

Sorry, the language file de-DE.xml I've added with my post before contained modifications for my website.

Here I attach now one which is the translation of the standard English file without these modifications.

(attachment removed, updated version in topic german translation)

#13 Jesper

Jesper

    Advanced Member

  • Members
  • PipPipPip
  • 892 posts
  • LocationDenmark

Posted 11 September 2011 - 07:12 PM

there really is no reason to post this in 3 topics.....

#14 Richard67

Richard67

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts
  • LocationGermany

Posted 14 September 2011 - 09:34 PM

there really is no reason to post this in 3 topics.....

Hmm, sorry, thought is would be helpful but see now you are right.

#15 Octavian

Octavian

    Founder and CEO

  • Administrators
  • 1,911 posts
  • LocationBucharest, Romania

Posted 15 September 2011 - 04:08 PM

Thank you Richard for the code it is very useful.

#16 Richard67

Richard67

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts
  • LocationGermany

Posted 16 September 2011 - 06:50 AM

Thank you Richard for the code it is very useful.

Hmm, meanwhile I think the code I provided for language file setting should be tested if it works without the Joomla Language Filter enabled, i.e. on a single language site.

#17 Guest_mytony_*

Guest_mytony_*
  • Guests

Posted 27 September 2011 - 01:02 AM

i want to have 3 languages files.

#18 Jesper

Jesper

    Advanced Member

  • Members
  • PipPipPip
  • 892 posts
  • LocationDenmark

Posted 27 September 2011 - 03:55 PM

then just do elseif and add another option....

#19 Richard67

Richard67

    Advanced Member

  • Members
  • PipPipPip
  • 131 posts
  • LocationGermany

Posted 27 September 2011 - 04:27 PM

then just do elseif and add another option....

The solution I provided above requires no extension, it works with as many languages as supported on a multilingual site.

#20 Jesper

Jesper

    Advanced Member

  • Members
  • PipPipPip
  • 892 posts
  • LocationDenmark

Posted 27 September 2011 - 05:17 PM

yes if he uses joomla... the other one if he doesn't use a joomla site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users