Categorie:
Nuovi commenti:
Nuovi articoli:
Collegamenti:
SML 0.9 per sNews
Symmetric Multi-Language MOD 0.9 per sNews 1.6.0, ho cambiato di nuovo il nome della mia modifica.Perché simmetrico (symmetric)? Perché gli articoli e le categorie sono "simmetriche" nelle varie lingue.
Ogni articolo è pubblicabile in una o più lingue, in questo caseo gli articoli condividono i commenti, la data di pubblicazione, la categoria, e il SEF link.
Dalla precendente release (0.8), ho migliorato il lato admin e ho reso la pubblicazione di ogni articolo indipendente per ogni lingua.
E' possibile cambiare tra le lingue facilmente, cambiando solo l'indirizzo:
http://website.com/en/category/title
http://website.com/xx/category/title
Potete vedere come funziona qui, nel mio sito. L'ultima release è basata su sNews 1.6.0, è un pacchetto unico, e può essere istallato da zero o su una istallazione esistente di sNews. In caso di una precedente istallazione, tutte le altre modifiche devono essere istallate nuovamente.
Il file può essere scaricato qui: sNews16SML.rar.
15.06.2007. 17:56
dandyna in 19.06.2007. 01:46
gran bel lavoro, bravo
Great work!!!
But what's the major change on the structure? I have simple snews1.6 installed. I have my actually a base language. So i make the changes (which are in the readme file).
I setup the Database for an additional language: That means that i dont have to do this for my basic language? And also create the file snews_xx.php for my additional lang? The basic language variables are defined in snews.php, right?
And when a new article has to be written: Write the article in the basic lang and then switch to teh additional lang?
How to create the language - switch link? manually in the index.php?
Great thanks for that mod and greetings to italy (i ll went on vacation to italy this WE yeaa:-)).
Leonardo in 03.08.2007. 19:33
@ codetwist
No yet updates for SML. I was busy lately. If you have any suggestions, please post them.
@ martin
First, SML supposes that your base language is English.
The basic language (english) variables are defined in snews.php. The second language variables are in snews_xx.php (I remind you to change xx to your language.).
In your database, you add the fields only for the second language.
Then you login in english, write the article, change language (clicking in yoursite.com/xx/), re-edit the article in the second language.
Do you want add SMT to an existing website or start from scratch? Which languages do you need?
Is the language variable case sensitive? I have some problems maybe because ($_SESSION['langx']=="EN") is in capitals and en is in small letters.
Maybe it can really help if the readme.html File contents a sample, like:
Modify the MySQL database with this code, changing xx with the 2 letter code of your language (example: IT):
Create a file: snews_XX.php (where XX is your language, example: IT)
Check index.php: change XX to your language (example: IT)
Leonardo in 04.08.2007. 18:07
@ Chrus
It is case sensitive.
$_SESSION['langx'] is always uppercase.
The second language file has to have uppercase language (snews_IT).
While the links (website.com/en/) has to be lowercase, also the database fields have lowercase language (text_it or text_de).
I'll update the guide soon.
If you are upgrading an existing website, you have to translate all the fields in the db, it is better to use program like phpmyadmin.
Remember to upload the new .htaccess too.
martin in 06.08.2007. 03:01
My existing lang is German. I want to add english as an additional lang.
There are already a few articles in my db. What does that mean: you have to transalte all the fields in the db? I can do that without phpmyadmin with just changing the lang and then write the additional article text, right? Or should i change some table entries or change the stucture manually?
My base lang is not english. So i already changed my lang var in the settings admin dialog and changed my lang var in the top of my snews.php. Can i do that also for SML?
Thanks for that great support. I m gonna to a test today so i hopefully get i work :-).
mille grazie!!!
Leonardo in 06.08.2007. 13:22
@ martin
If your sNews is already set in German. You shuold have already the right file snews_DE.php.
Then you have to add to the db:
ALTER TABLE categories ADD name_en varchar(100) NOT NULL;
ALTER TABLE categories ADD description_en varchar(255) NOT NULL;
ALTER TABLE articles ADD title_en varchar(100) default NULL;
ALTER TABLE articles ADD text_en longtext;
ALTER TABLE articles ADD published_en int(3) NOT NULL default '1';
Instead of 1, you can set 0, and then you'll publish manually each translated article.
When you will select /en/, you should see an empty snews. If you go to the admin section you can edit and/or publish your old articles to english.
Yess, I got it work! My last thing: I want my Homepage to be initially in german (/de/), but its in english.
Is it possible to switch to German at Sessionstart? I am a really php noob, so i havnt realize where the lang-var is set? Is it automatically set with calling the lang-directory (eg: /en/) ?
At the moment my LangVar is EN (in the admin-panel). So "en" and "de" are switched (a little bit confusing), so my Startsite is german with english interface lang (this capter is just confusing i know but also not so important:-)).
Sorry for spaming your comments, but i am not able to access my emails at day.
Sorry for asking again, but: What does the field plublished_en do? When its set to 1 the text of the article at yourwebsite.com/en/ is also displayed in yourwebsite.com/de/ ?
I hope you all understand my little strange postings :D.
Leonardo in 07.08.2007. 10:13
The homepage language is based on the browser language (lines 259,270 in snews.php), if the browser is 'DE' you will have german, in all other cases you will have english. If you change the 2 lines ($_SESSION['langx'] ='DE';), you shuold have always german at the beginning.
LangVar is the 'first language', the one the read the old database. In your case shuold be 'DE', because you added text_en, title_en to the db, right?
If you set published_en to 1, you have all the old articles "published" in English (but the articles are still empty, you have to translate, so you have an empty structure to edit); if you set to 0, you have an empty snews, this case is better, because it give you more time to translate.
Next steps: login as admin, go to website.com/en/, go in the admin section, select categories/articles view, select edit and write the translation.
Great MOD leonardo, It´s just what I need, but Im new at this so I follow the instructions But I can make the languajes suich betwen english and spanish, could you take a look... Im jure I`ve done everything pretty well so far.
The instalation is here:
http://www.neikomedia.com/snews/
Thanks, and once again great MOD!
Leonardo in 25.09.2007. 09:39
@Jdd
I checked you website, and I notice that links don't have /en/ or /es/ extensions. Please, be sure you have snews.php that is provided with SML.
I made a ready to use en/es version, please download it here: sNews16ES.rar. You still need to change the database.
codetwist in 04.10.2007. 16:46
Hello, Leonardo ;)
Seems, that I will have to look at Your package more closely. As there were no more news on sNews site I've basically implemented rudimentary version myself, but it's based on 1.5.31.
So, here is what I did:
- used separate sets of content tables for each language (prefix);
- extended settings table with additional field defining for which or any language setting it's usable;
- put language variables outside main file for all languages
Regards,
Valdis
Scrivi un commento
* richiesto