Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 2 3 [4]

Author Topic: [MOD] Multiple Languages  (Read 21150 times)

Joost

  • Guest
Re: [MOD] Multiple Languages
« Reply #45 on: May 08, 2008, 01:08:21 PM »

I've tested ML long, long time ago, so some things might have changed.
Back then, I've found out the following:
Ml is session based, you cannot access a non default language page, without changing the language setting first.
So if  English is default, I cannot access a Russian page that's stored in my bookmarks or is linked to from a different site.
The 302 is generated by sNews, a design flaw in sNews. Instead of producing a 404 instantly it starts off with a redirect (302) to the 404 page, then followed by a 404 header.
Logged

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: [MOD] Multiple Languages
« Reply #46 on: May 08, 2008, 01:21:33 PM »

Thanks Joost, I got it and it looks like I'm not that smart afterall!  :'(
What you said about not being able to access a 2nd (3rd or whatever) language page from an external link makes sense now ... and I guess it's because there's no session present to direct the browser (or robot) to that specific page (or article). Pushing this logic further, it means that even though Rui's solution works extremely nice when doing regular browsing through a site, the generated content cannot (and will not) be able to be deeplinked (is that the word?) and pretty much worthless from the SEF point of view ... am I right?
Cause if I am, it means I'll have to "redo" a lot of work on the sites that I've been using ML on ... uhhh! ::)
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] Multiple Languages
« Reply #47 on: May 08, 2008, 02:38:38 PM »

@ Nicu : You got it right. Session based features are best for in-house systems as they are simpler. But for public anonymous use and SEO they don't work at all unless it's supported by additional processing of urls. If same category/page/article has different seftitles for different languages then You can switch languages and reload language var-s in start-up according to data found for specific seftitle. Or You can search this forum for other mods which were incorporating language in urls from very beginning.
Logged

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: [MOD] Multiple Languages
« Reply #48 on: May 08, 2008, 02:41:35 PM »

Yep, I think I'll do just that, thank you codetwist.
Like this one, for instance: http://snewscms.com/forum/index.php?topic=6421.msg43288#msg43288
« Last Edit: May 08, 2008, 02:43:27 PM by Nicu Alecu »
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: [MOD] Multiple Languages
« Reply #49 on: May 08, 2008, 09:56:31 PM »

Hello Nicu.

I'm sorry, I know there are some bugs I need to fix. A few time ago, I start my 2nd generation of ML (with no sessions). I was very busy with some projects (sNews1.7, my website sNews and sNews Gallery).

I've one ideia to devellop the 2nd version sNews ML, I'll use one ideia that I use in sNewsGallery I think will solve all problems, please be patient I'll be very, very busy next 3 weeks.

I promisse I'll finish this version, I want to my website too.

Yes etatus has a good solution

Thank you, mates
« Last Edit: May 08, 2008, 09:59:53 PM by Rui Mendes »
Logged
Need a Job on Europe. Linkdin - Facebook / Group

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: [MOD] Multiple Languages
« Reply #50 on: May 09, 2008, 08:32:37 AM »

Rui, you're a man with many good ideas  :)
I'll be waiting for ML2, but in the meantime, I'll just have to ditch all ML installs, cause it it really messes up the indexing.
Logged

rubenpol

  • Newbie
  • *
  • Karma: 2
  • Posts: 8
    • Diseņo Web CSS
Re: [MOD] Multiple Languages
« Reply #51 on: June 26, 2008, 04:54:13 PM »

Small fix for xhtml validation.

On flag() function change & for &


Search for:
Code: [Select]
href="'.$db['website'].'index.php?action=language&lang='.$lang.'"
And Replace for:
Code: [Select]
href="'.$db['website'].'index.php?action=language&lang='.$lang.'"
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: [MOD] Multiple Languages
« Reply #52 on: June 26, 2008, 05:39:21 PM »

Thanks rubenpol.

First Karma 2 U
Logged
Need a Job on Europe. Linkdin - Facebook / Group

rubenpol

  • Newbie
  • *
  • Karma: 2
  • Posts: 8
    • Diseņo Web CSS
Re: [MOD] Multiple Languages
« Reply #53 on: June 26, 2008, 05:57:17 PM »

Hi Rui!

I'm modifying your code to generate a language ul, and show the small flags through CSS.

Example

In snews.php
Code: [Select]
// LANG FLAGS
function flags() {
$langlist = explode(',',s('langlist'));
foreach($langlist as $lang) {

echo '<li><a title="'.$lang.'" href="'.$db['website'].'index.php?action=language&amp;lang='.$lang.'" class="'.$lang.'">'.$lang.'</a></li>';

}}

In index.php
Code: [Select]
<ul id="lang">
    <?php flags(); ?>
  </ul>

IN CSS stylesheet I defined a class for each lang like
Code: [Select]
#lang .EN {
background: url(flags/flag_en.gif) no-repeat;
padding-left: 20px;
padding-right: 10px;
display: inline;
}

We could generate an inline style on each <a>, but the code will become so dirty, and i think that the better way is make it manually. Sorry, but i love semantic code ;)

Congratulations RUI, it's a great addon for our snews!
« Last Edit: June 26, 2008, 05:58:59 PM by rubenpol »
Logged

antvoi

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
Re: [MOD] Multiple Languages
« Reply #54 on: September 06, 2008, 08:36:08 AM »

did you integrate ML with Sub Categories?
Logged

rjs

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
Re: [MOD] Multiple Languages
« Reply #55 on: March 03, 2011, 06:51:49 PM »

i was wondering if anyone got this working in sNews1.7 yet, just curious as this mod seems to be a little more straight forward than the others available, and I have already used it in 1.6 and love it.

Would like to play with 1.7 but really need this mod as I use multilingual content
Logged
Take me as I am or watch me as I go.
Pages: 1 2 3 [4]