Multilingual

Found a bug? Tell us!!
Post Reply
golfsailor
Regular
Posts: 13
Joined: Sat Apr 17, 2010 9:05 am

Multilingual

Post by golfsailor » Tue Apr 20, 2010 9:47 am

This option seem difficult to use.
Sometimes it works, sometimes not !!

I may first enter an article and it's saved as it should with the default language. Here is the first possible confusion. What is the default language, blog language or browser language.

Then I choose the language by choise and then the message "draft saved" returns and the original message appears though I specifically choose the option to remove the original language from the text box in the setup section. So what is happening ?

One suggestion, take the default language away, then make all languages choosable by name. Default we need to find which language is missing in the list to see what it is.
Second, I have made only three languages possible, still all the other ones is available in the drop down box.

Version is 1.5.2 and Multilingual entries 2.10

One more thing, the body and the extension fields in the database should not be TEXT fields, they should be MEDIUMTEXT, as the text just disappear with no notice and you may have to write the book again ....

Rolf

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Multilingual

Post by garvinhicking » Tue Apr 20, 2010 10:14 am

Hi!

golfsailor wrote:This option seem difficult to use.
Sometimes it works, sometimes not !!


We're here to clear up things, let's see :)

I may first enter an article and it's saved as it should with the default language. Here is the first possible confusion. What is the default language, blog language or browser language.


The actual language doesn't really matter. The "default language" means the "default content", that always appears when NO translation exists. Usually, the default language is the language that's used when a visitor opens your blog. Your personal backend language might differ, but what you put into the usual blog content is always the default content.

Let's say your language is set to "Swedish" but you write your blog entries in english. Then the default language is not swedish (your interface language), but english, because that is the usual content you enter.

If you then enter a translation, you always pick the language you translate into, so there shouldn't be further confusion.

Then I choose the language by choise and then the message "draft saved" returns and the original message appears though I specifically choose the option to remove the original language from the text box in the setup section. So what is happening ?


I believe this is a by-product of fixes that needed to be made to the plugin to properly always fetch content when an entry is shown that has no translation. This fix is made for the frontend in mind, but it also carries over for the backend (because the same routine is used). This means for an "empty" translation you will always get the contents of the "default entry" there. I have not yet had the time to check how the option key's original function can be restored without opening the old bug again.

So for the time being, you should be happy to see a template for the entry there, and you could just remove the existing text for the translation? ;)

One suggestion, take the default language away, then make all languages choosable by name. Default we need to find which language is missing in the list to see what it is.
Second, I have made only three languages possible, still all the other ones is available in the drop down box.


Yes, the plugin shows you all languages that Serendipity supports, taken from the $serendipity['languages'] array. Serendipity currently has no interface to really "configure" which languages it supports, only certain plugins allow restrictions but they have no common means to do that. If you want to fully reduce an available language, you could edit the serendipity_config.inc.php file and change this $serendipity['languages'] array.


One more thing, the body and the extension fields in the database should not be TEXT fields, they should be MEDIUMTEXT, as the text just disappear with no notice and you may have to write the book again ....


Serendipity 1.6 uses LONGTEXT for the text-fields, so future versions will keep that in mind. I'm sorry that this has not been there from the beginning.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

golfsailor
Regular
Posts: 13
Joined: Sat Apr 17, 2010 9:05 am

Re: Multilingual

Post by golfsailor » Tue Apr 20, 2010 10:30 am

Hi Garvin,

well I have some articles that is working, but then I changed the default language and it just don't work.

I make a draft and save the conthent like "this is english".

Then I choose Swedish and that text returns,

Then I change the text to : "this is Swedish".

and save

What happens next time : I get out, choose edit article, get the "this is english", and thats fine.

Then I choose Swedish and the returned text is : "this is english".

Yes I am sure I did save it. (Swedish Version, with response draft saved).

I have three articles where it actually work, however I also have one, with the languages, english, swedish, swedish !

Rolf

golfsailor
Regular
Posts: 13
Joined: Sat Apr 17, 2010 9:05 am

Re: Multilingual

Post by golfsailor » Tue Apr 20, 2010 11:14 am

Hi again Gavin,
now I found something interesting !

on the webfront I chose lets say english, that have a strong influence on what is happening.

Even if I change my "blog language" it doesn't change until I change language on the front side,
which should not have to do with the backside what so ever ? or ?

That option also changes the default language, when entering articles. I guess it should be the other way around ?

/Rolf

golfsailor
Regular
Posts: 13
Joined: Sat Apr 17, 2010 9:05 am

Re: Multilingual

Post by golfsailor » Tue Apr 20, 2010 7:17 pm

Now I know what is wrong, but don't know why

I have one article in english, say title is "title", and "body".

I choose swedish and change it to "swedish title" and "swedish body"

In the database it's fine in both tables.

Next time I wwant to edit the "swedish part" this happens,
first the english version is shown and I select swedish.
Then the ENGLISH version is saved REPLACING the SWEDISH version in the database before editing.

I can see it in the db, so what to do ?

/Rolf

golfsailor
Regular
Posts: 13
Joined: Sat Apr 17, 2010 9:05 am

Re: Multilingual

Post by golfsailor » Wed Apr 21, 2010 6:30 am

I found the code and it works if you publish the article, for drafts it don't.
It will always "translate" the original for you if you save it as a draft.
This mean any change you make while in draft mode will disappear.

How about change it so :

if there already is a draft in the choosen language, use that and do not use the default one again ?

that change is simple.

more complicated is to add one option when selecting language, checkbox for copying default language or not. Then both options would be available.

One more thing, The table for the different languages need to be LONGTEXT as well. (That is also only TEXT in version 1.5).

Post Reply