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] Multi-language simple Mod  (Read 17063 times)

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: [MOD] Multi-language simple Mod
« Reply #15 on: January 29, 2008, 04:09:30 PM »

Me too, Pali! I pm-ed you ...

Back to Etatus' MOD: I'm no programmer, but after looking at the code, it seems that this would support more than 2 languages. Am I right?
A live demo would be nice ... I'm thinking about making one myself  ::)

Later edit: errr, it would be nice if it worked with sNewsMU, too! wishfull thinking?
« Last Edit: January 29, 2008, 07:50:33 PM by Nicu Alecu »
Logged

etatus

  • Newbie
  • *
  • Karma: 2
  • Posts: 8
Re: [MOD] Multi-language simple Mod
« Reply #16 on: January 30, 2008, 11:06:14 AM »

Of course you can add all languages you want. You have to duplicate the corresponding tables in DB for each language.

You can see a demo of the simple multilanguage method I implemented at: http://papa.det.uvigo.es/galaia
« Last Edit: January 30, 2008, 11:10:34 AM by etatus »
Logged

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Re: [MOD] Multi-language simple Mod
« Reply #17 on: January 30, 2008, 02:34:02 PM »

To Nicu Alecu:

i send this to mattonik, joost and agentsmith, hope, we will create some nice package together.

i will try this weekend

pali
Logged
I like sNews!

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: [MOD] Multi-language simple Mod
« Reply #18 on: January 31, 2008, 08:52:14 PM »

@Pali: OK, thanks, I'll be waiting for a sign ...  ;)
@Etatus: I figured I could have as many as I wanted ... Just wondering how other mods will work in such a case, I'll just have to test them one by one. I'll run a test version this weekend, after that I'll be in a one-week vacation, snow-boarding. Thanks!
Logged

Zerosurf

  • Guest
Re: [MOD] Multi-language simple Mod
« Reply #19 on: February 06, 2008, 01:17:06 PM »

guys, i have Lang. versions ready... working example: www.metaltradenitra.sk

Just one db, just one index, just one snews.php

there is hacked htaccess, so site/en/category/article/ give english version and site/de/category/article/ give german version.

Database structure same like original snews (i used explode/implode functions).

Dont have installation instructions, because there is included Luka's gallery (with image description) and too many other hacks. If somebody interested i can upload my full working version and you can play (only for skilled people - too many hacks).

Pali

I would also be interested in your version!

Thx.i.a.
Zerosurf
Logged

Pali

  • Full Member
  • ***
  • Karma: 16
  • Posts: 111
    • LE-PAVON
Re: [MOD] Multi-language simple Mod
« Reply #20 on: February 06, 2008, 02:37:30 PM »

hello guys,

im busy with non sNews related projects, feel free to download Multilang version here:

http://www.le-on.eu/download/multilingual.zip
or
http://www.le-on.eu/download/multilingual.tar.gz

Audience:
only skilled programmers, there are some bugs and hardcoded things!

Whats included?
Flatcart (Shopping cart)
Image gallery (with image script from Zenphoto)
Tiny MCE
Texyla
too many other hacks, mods...

What is not included?
Template!! Site looks ugly, because i removed all template parts (from CSS and images) which wasnt made by me (Licence of the template doesnt allow me to make the template availabe :( )

Structure of the site:
ROOT: just index.php, css, htaccess (its changeg, please change for your LANG needs), xslt-php4-to-php5.php (needed for fatcart) and SQL for database cretion (use phpmyadmin...)

flatcart/
flatcart.xsl -> template for shopping cart

includes/
ml_snews.php -> multilang processing (lang array must correpond with htaccess in root)
db_snews.php -> basic settings of the site
gv_snews.php -> gloval variables (change according to your needs)
fn_snews.php -> core sNews functions
fn_gallery.php -> independent gallery functions
flatcart.php -> flatcart functions
lv_xx_snews -> lang. variables, where xx is language (en, de, sk...)
ajax.php -> currently only 1 function there - deleting images from albums
.htaccess -> deny access to all files except ajax.php

gallery/
here will be stored you albums (change name of folder according to your gv_snews.php settings)

phpmailer/
needed for flatcart

js/
javascript folder (texyla, tiny, slimbox...)

Known issues:
- texyla doesnt work with new article adding, but works fine if you are editing existing one...
- images are deleted only from album folder, not from database

Logged
I like sNews!

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] Multi-language simple Mod
« Reply #21 on: May 30, 2008, 09:19:38 PM »

Hello,
I'm testing your multi-language mod but I have a problem with links.
The index page work well, but all the internal links looks like
//localhost:8888/snews16/FR/login/
and of course I have an error. It's exactly the same in English.

The good link should be "//localhost:8888/snews16/login" I think.

I put your htaccess file. I think the problem is in it ! But where  ???
Code: [Select]
<IfModule mod_php4.c>

    php_value session.use_trans_sid 0

</IfModule>

<IfModule mod_security.c>

SecFilterEngine Off

SecFilterScanPOST Off

</IfModule>

RewriteEngine On

#RewriteBase /sNews16
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_/\-]+)$ index.php?category=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Z][A-Z])/index.php?(.*)$ $2 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Z][A-Z])$ index.php?sessionlang=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Z][A-Z])/$ index.php?sessionlang=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Z][A-Z])/(.*)$ index.php?sessionlang=$1&category=$2 [L]

Any idea about this problem ?

About the index.php tag for flag's I change your's by
Code: [Select]
<a href="EN/"><img src="flags/flag_en.gif" title="English" alt="English flag" /></a>
<a href="FR/"><img src="flags/flag_fr.gif" title="French" alt="French flag" /></a>

which is valid in xhtml.

Thank's anyway for this nice mod.
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] Multi-language simple Mod
« Reply #22 on: May 30, 2008, 09:48:59 PM »

@stephane : remove # from this line - #RewriteBase /sNews16. And links should contain language in them ;)
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: [MOD] Multi-language simple Mod
« Reply #23 on: May 30, 2008, 11:24:17 PM »

Be careful at snews16 from your path example and sNews16 from htaccess file...
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] Multi-language simple Mod
« Reply #24 on: May 31, 2008, 01:14:23 AM »

If I remove # in RewriteBase I have a Internal Error !

 Actually I have in snews.php
Code: [Select]
$db['website'] = 'http://localhost:8888/snews16/';

same with $db['website'] = '/snews16/';
or $db['website'] = 'snews16/';

And htaccess
Code: [Select]
#RewriteBase /snews16

Links look like
Code: [Select]
http://localhost:8888/snews16/FR/login/
or
http://localhost:8888/snews16/FR/archive/
= 404 not found  ??? ???

Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] Multi-language simple Mod
« Reply #25 on: May 31, 2008, 09:05:31 AM »

When You have # in front of line in .htaccess then that line is actually commented out. If path on disk really is /snews16/ under website root then You can access index just because it's right path for index.php. For the rest of rewrite dependent code to function You need working mod_rewrite. And obviously it's not really working/enabled as You got internal error right after uncommenting that single line.
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] Multi-language simple Mod
« Reply #26 on: May 31, 2008, 01:34:22 PM »

Thank's Codetwist.
I know for the # function.
But impossible to make it work, damned !!
Maybe a problem with localhost server.

I will try on a server to see what happen.
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] Multi-language simple Mod
« Reply #27 on: May 31, 2008, 06:55:33 PM »

Very strange, it's working on a distant server.  :o

I try to play with it know  :D

I can log in the french administration (table without lang prefix are for french) everything seems ok.

But I can't log in English administration, is that normal ? (wrong username etc...) I use the default one test/test like in french.
I have duplicate my table like this : EN_articles ; EN_categories ; EN_comments ; EN_settings

How can I set the title for the English part ?
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] Multi-language simple Mod
« Reply #28 on: June 03, 2008, 03:13:38 PM »

Any idea about this error in login admin in English ?

If I can't access in the Engllish Admin, how can I create articles, categories, etc in the English part ?

When I'm log in French Admin I can create articles etc.. And In English admin I should create articles etc. Is that right ?

Thank's for your help
S.
Logged

codetwist

  • Hero Member
  • *****
  • Karma: 50
  • Posts: 940
Re: [MOD] Multi-language simple Mod
« Reply #29 on: June 03, 2008, 07:25:23 PM »

I can only assume that You should be able to login into English interface to work on its content. One question thou - that EN_settings table You created - it contains same data as default settings table? If problem persists I suggest to try out PM-ing author directly and ask for assistance.
Logged
Pages: 1 [2] 3 4