Multilanguage Support!

User Info News
No avatar Welcome, Guest. Please login or register.

Login with username, password and session length
January 09, 2009, 04:40:03 PM
Welcome to the iobinary.com forum.  What do you think of the new theme?
Home Help Search Login Register
+  iobinary.com Forum
|-+  Blogg-X
| |-+  Feature Requests (Moderator: chris)
| | |-+  Multilanguage Support!
« previous next »
Pages: [1] Print

Author Topic: Multilanguage Support!  (Read 4296 times)
 
pulp
Newbie
*
Offline Offline

Posts: 13


Multilanguage Support!
« on: April 26, 2006, 03:30:25 AM »

HI, joomla has a multilanguage component called Mambelfish ( Joomfish on development) wich allows you to translate all text displayed, contents, menus etc...

Since Blogg-X is designed to update contents, and contents should be multilanguage, is it possible for you guys to implement Mambelfish support on this editor. (that would be awsome!)

When selecting a post, there should be a sub option wich should let you select from the active languages wich one would you like to use:
Default
Language1
Language2 ...

 Roll Eyes

Thanks for this great component!!!
Report to moderator   Logged
ebaart
Newbie
*
Offline Offline

Posts: 3


Re: Multilanguage Support!
« Reply #1 on: May 03, 2006, 01:08:28 AM »

I second this ...  Wink
Report to moderator   Logged
n1sus
Guest


Email
Re: Multilanguage Support!
« Reply #2 on: June 22, 2006, 03:33:03 AM »

yeah, that would be very usefull!!! Any plans to implement MambelFish / Joom!Fish -support?

Thanks for your great work!
nisus
Report to moderator   Logged
gGuzz
Newbie
*
Offline Offline

Posts: 1


Email
Re: Multilanguage Support!
« Reply #3 on: December 07, 2006, 04:54:37 AM »

JoomFish support would be great!!!

Thank you for this good component.
gGuzz
Report to moderator   Logged
chris
Administrator
Site Admin
*****
Offline Offline

Posts: 300


WWW
Re: Multilanguage Support!
« Reply #4 on: December 12, 2006, 04:15:03 PM »

Can you give me more details on how you guys think this should work?  I haven't used either of the *fish components so I am a newbie...

Thanks...

chris
Report to moderator   Logged
ozpritcha
Newbie
*
Offline Offline

Posts: 1


Email
Re: Multilanguage Support!
« Reply #5 on: November 17, 2007, 07:54:59 AM »

Have you managed to get anywhere on support for Joomfish?

I upload all of my site content using Blogg-X, and have just added MultiLanguage support to my site. Problem is now... I can do my english content through Blogg-X, but need to go to the Web interface for German.

Any feedback would be VERY welcome.  Wink

Thanks for a great program... which has helped me to actually get around to posting content, instead of always thinking 'I'll do it sometime soon' !!

Thanks,
OzPritchA
Report to moderator   Logged
Willem Gorter
Newbie
*
Offline Offline

Posts: 3


Email
Re: Multilanguage Support!
« Reply #6 on: December 10, 2007, 01:52:48 AM »

Blogg-x is great! I would very much appreciate JoomFish functionality added, as I have some people translating articles, but currently doing it in notepad, and copying the text in the Joomla editor screen, because they have a bad internet connection and it keeps dropping (which makes them lose the work they did)

Chris, JoomFish adds a "language chooser" dropdownlist on each page (well, you can configure that, it's just a module), where you can switch languages. When you switch from the default language, you get your article copied from the [prefix]_content table to the [prefix]_jf_content table which has extra things like "language_id" field and "original_text" field. The article gets copied for each language you add.
So if you retrieve the available languages from [prefix]_languages (name and id), add a dropdown on the blogg-x interface and fill it with the name values, then if you retrieve and article and it doesn't exist in the [prefix]_jf_content table, get the original article from [prefix]_content, display it in Blogg_x, and when you repost it, save it in the [prefix]_jf_content table with the language id from your combobox.
Maybe there is an easier way through the JoomFish API, will look into this, but I have no knowledge of PHP and little of Java (sorry, C# addict), so will be slow going trying to understand.

Anything I can do to help with this? If I can save you some time by sorting out some things, please don't hesitate to ask, I am breathlessly awaiting this functionality.

Keep up the good work Chris,

Willem
Report to moderator   Logged
Willem Gorter
Newbie
*
Offline Offline

Posts: 3


Email
Re: Multilanguage Support!
« Reply #7 on: December 11, 2007, 04:25:15 AM »

Chris,

some more explanations to make Blogg-x JoomFish-enabled.
Here is how JoomFish works:
it uses 3 tables in the database (pfx is the table prefix for the Joomla installation):
1)pfx_jf_tableinfo
You don't need to concern yourself with this one, it keeps per table the name of the primary key, which for your tables is always the "id" field.
2)pfx_languages
This keeps the user-defined languages on the site. Here is the structure:

CREATE TABLE `pfx_languages` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `active` tinyint(1) NOT NULL default '0',
  `iso` varchar(20) default NULL,
  `code` varchar(20) NOT NULL default '',
  `shortcode` varchar(20) default NULL,
  `image` varchar(100) default NULL,
  `fallback_code` varchar(20) NOT NULL default '',
  `params` text,
  `ordering` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
)

"id" is the language key
The "name" displays the language name,
"iso" the ISO-code for the language (en=english, fr=french, de=german, nl=dutch etc)
"active" is set to 1 if the language is available in the front-end, code is the internal name (english, french, german, dutch) "shortcode" is user-defined name (on my site, identical to the code),
"image" is probably meant for a flag-icon to be displayed in the language-choose module,
"fallback_code" is the ordering-value to use if the content is not translated (display the article in english if the german version is not present),
"params" is not used to my knowledge,
and "ordering" is the order in which to display the languages in the language-choose module.

You will need this one to define the language in blogg-x, and retrieve the language ID. You will probably only need the fields "name" and "id".

3)pfx_jf_content

This is where the translations are kept:

CREATE TABLE `pfx_jf_content` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `language_id` int(11) NOT NULL default '0',
  `reference_id` int(11) NOT NULL default '0',
  `reference_table` varchar(100) NOT NULL default '',
  `reference_field` varchar(100) NOT NULL default '',
  `value` text NOT NULL,
  `original_value` varchar(255) default NULL,
  `original_text` text,
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified_by` int(11) unsigned NOT NULL default '0',
  `published` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `jfCreateContentSQL` (`reference_id`,`reference_field`,`reference_table`,`language_id`,`published`),
  KEY `jfContent` (`language_id`,`reference_id`,`reference_table`,`reference_field`),
  KEY `jfReferenceTable` (`reference_table`)
) TYPE=MyISAM AUTO_INCREMENT=547 ;

"id" is the record-ID (auto-increment)
"language_id" refers to the id field in pfx_languages, defines the language of this translation
"reference_id" refers to the id field of the record of the original element (record in pfx_content for example)
"reference_table" is the table where the original element resides (you will probably filter on WHERE 'reference_table' = 'content')
"reference_field" is the field that is translated, one content article has a lot of records where the reference_id and reference_table are the same, and different values for reference_field like 'title', 'intro_text', 'full_text' etc.
"value" is the translation
"original_value" is a hex string, don't know where it is used for
"original_text" is either empty or NULL in my tables, not used probably
"modified" and "modified by" is the modification time&authorID for the translation
"published" is a flag, 1 if the translation is published.
----------------------------------------------------------------------------------
To implement this, you will need to adapt the mambot blogg-x_server.php script.

1) function get_startup_settings($m) => you retrieve unpublished posts from content table, this should have a "if the language is not the default language" block added, where unpublished translations are retrieved.

To get all the titles of all untranslated articles, here's the SQL query ("Fourth query to get unpublished posts"), assuming you check on whether the language is different from the default language:

$num_unpublished_qry = "SELECT c.title FROM #__jf_content j right outer join #__content c
                                    ON j.reference_id=c.id
                                    AND j.reference_table='content'
                                    AND j.reference_field='title'
                                    AND j.language_id=$ACTUAL_language_id
                                    WHERE j.reference_id IS NULL")

2) function getpostdata => you should probably add a "function getpostdata_fish" for retrieving the data from the jf_content table. Instead of retrieving one record and storing it in the array, here you will have to retrieve multiple records (with same reference_id and reference_table), and store the value of each record in an array element, depending on the reference_field value.

Here, the SQL query is somewhat more difficult, as you have to retrieve translations from pfx_fj_content, but some other things from pfx_content. Probably better to keep what you have, then retrieve the translations, and replace the fields from the original with the translated "value" wherever they exist. To retrieve all translated fields:
$post_data_qry = "SELECT value, reference_field FROM `#__jf_content`
                                                                                 WHERE `reference_table`='content'
                                                                                 AND `language_id` = $ACTUAL_language_id
                                                                                 AND `reference_id` = $contentId";

That's it for the mambot part I think, as get_single function etc. uses things like "$queryOne = $queryOnePartOne . $mosConfig_dbprefix . $queryOnePartTwo;" and therefore the table name except for the prefix is defined in the blogg-x program.

I can't help you on that score, as I don't have the source code.

I think most of us would be very happy if only the text can be modified language-dependant. In JoomFish in the frontend, you can also load different images per translation, you translate all the section and category names etc., but I at least would be more than happy if all those stayed as in the original language.

I hope I didn't make to many mistakes, and I especially hope this helps you.

Willem
« Last Edit: December 13, 2007, 01:00:58 AM by Willem Gorter » Report to moderator   Logged

Pages: [1] Print 
« previous next »
Jump to:  



Powered by SMF 1.1 | SMF © 2006, Simple Machines LLC
Copyright (C) 2006 Chris Campbell.  All rights reserved.
The term "Apache XML-RPC" used with permission from Apache Software Foundation