Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Multi-language MOD for 17  (Read 1584 times)

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Multi-language MOD for 17
« on: December 21, 2010, 11:50:57 AM »

Hello,
I really need a multi-language solution for snews 17.
You can read my post here : http://snewscms.com/forum/index.php?topic=8915.0
This MOD works fine in 16 but how to make it work in 17 ?

I will paid for this (with bill). Let me know if you are interested, and tell me your price  ;)

Thanks a lot,
Stéphane
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Multi-language MOD for 17
« Reply #1 on: January 01, 2011, 10:05:52 AM »

Stéphane,
You can do it like this
(I can explain in more detail if you're interested).
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Multi-language MOD for 17
« Reply #2 on: January 03, 2011, 11:12:26 PM »

Thanks a lot for your answer Fred.
Yes, if you have time, I'd like more detail.

Happy new year to you and all the sNews Team.
Stéphane
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Multi-language MOD for 17
« Reply #3 on: January 04, 2011, 05:58:52 AM »

Stéphane, I've put the details here.
What you get is a splash page at the root with a language selection. Cookies make sure that the language selection "sticks" until the cookie is removed. The details in the mod post describe the bare necesseties, you can of course embellish things as you please.
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Multi-language MOD for 17
« Reply #4 on: January 04, 2011, 12:47:46 PM »

Thanks a lot for this Fred.
Is it possible to use this without a splash page ? With a flag language selection for example, and a default language index (french in my case) ?

Karma for you  ;)
Stéphane
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Multi-language MOD for 17
« Reply #5 on: January 04, 2011, 07:20:31 PM »

Yes, it's possible to use it without a splash page. I hadn't tried that before so I didn't say anything about it, but I've tested it now and it seems to work fine. All you need to do is make sure you have a "normal" database setting along with your language prefixed tables. Keep snews.php in the root, as well as css, js and lang folders. Remember to take out the language variables from snews.php and put them in a config.php for the root - this one will of course *not* have a prefix. Then make the root index.php file look something like the following (again, this just has the bare necessities, fill it out as you like, including using flag images for your language links):

Quote
<?php if (!isset($_COOKIE['lang'])) {
// The following two lines is the change from the original mod, for the root index.php
include('config.php');
include('snews.php'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="your-default" lang="your-default">
<head>
   <?php title(); ?>
   <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
   <div id="wrapper">
      <div class="center">
         <p><a id="start" href="./">Start</a> | <a id="en" href="en/"><img src="images/en.gif" alt="English" /></a> | <a id="nl" href="nl/"><img src="images/nl.gif" alt="Nederlands" /></a></p>
         <hr />
         <?php center(); ?>
      </div>
   </div>
</body>
</html>
<?php }
   else {
      $lang = $_COOKIE['lang']; // sets $lang variable to the value of the cookie ("en" or "nl")
      header('Location: http://your-domain/'.$lang.'/'); exit;
   }
?>

Keep in mind though - once you select a language, the cookie for that language is set so until the cookie is cleared you'll always get that language even when entering the root address. But that behaviour is on the other hand what people mostly want when selecting a different language than the default. Anyway, try it if you like and see if it works for you.
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Multi-language MOD for 17
« Reply #6 on: January 04, 2011, 08:39:29 PM »

Stéphane - I forgot one important thing before. Each language folder must have its own .htaccess file, with the appropriate RewriteBase line. In case you run into problems, that might be one thing to check. Sorry for the miss. I've made the same addition in the original mod post.
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Multi-language MOD for 17
« Reply #7 on: January 05, 2011, 12:23:47 AM »

Well what a good news  :)
Many many thanks to you Fred. I will try all of this very soon.
I'll let you know if it's working fine.

Thanks again,
Stéphane
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Multi-language MOD for 17
« Reply #8 on: January 06, 2011, 05:17:36 PM »

Hello, I really need a multi-language solution for snews 17.
You can read my post here : http://snewscms.com/forum/index.php?topic=8915.0
This MOD works fine in 16 but how to make it work in 17 ?

@ Stephane .... I have figured out how to get Etatus Multilingual Mod (1.6) working OK with sNews 1.7.1 .... though it required a different approach to getting the Language prefix into the URLs. I've completed and posted the Mod for sNews 1.7 Here.
« Last Edit: January 06, 2011, 07:02:18 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Multi-language MOD for 17
« Reply #9 on: January 06, 2011, 11:51:04 PM »

Waouu what a good news.  :)
Now we have two different way to add multi language in sNews, great.

I'll try all of this very soon and let you know if it's working fine.

Many thanks to you Keyrocks
You own a karma too  ;)
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Multi-language MOD for 17
« Reply #10 on: January 07, 2011, 03:11:33 PM »

Waouu what a good news.  :) Now we have two different way to add multi language in sNews, great.  I'll try all of this very soon and let you know if it's working fine.

Many thanks to you Keyrocks You own a karma too  ;)

Yur welcome of course and thanks for the Karma.  :-*   ;D
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU