41
Chado
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/9/20 0:15

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


Quote:

IsiRyder wrote:
When using [language][/language] in titles, changing language to spanish and so on, i have not enough space to do it. How can i change the length in a safe way?

Hi IsiRyder,
I am not sure which titles you mean, but you may need to change the length of the fields in your database. Some title fields were created with a fixed length. MCity's post just before your post deatailed a way to lengthen news topic titles. If that doesn't help, let us know what titles you are talking about and maybe someone has already figured it out.

Hope that helps...
Chad

42
IsiRyder
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/9/20 15:15

  • IsiRyder

  • Just popping in

  • Posts: 2

  • Since: 2003/9/19


Quote:

Chado wrote:

I am not sure which titles you mean, but you may need to change the length of the fields in your database.


Hi Chado. You can find the titles i mean when adding or modifying Categories and Subcategories. Anyway i will try to modify the files and database at my own risk...

43
ibzan
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/6 5:54

  • ibzan

  • Just popping in

  • Posts: 48

  • Since: 2003/8/31


Great hack! Yes, however - has XOOPS develepment ever considered making XOOPS more multilingual friendly? The average person would hardly want to go in and hack around on core files, not to mention that it doesn't take care of everything (i.e. blocks, modules...)

Wouldn't it be more useful for blocks, news, etc., to have an option field to select which installed language to show the block, news article, etc.? Example: I only want "Article 'A'" to show *only* in English, "Article 'B'" *only* in Spanish, "Article 'C'" in all languages.

Forgive me for mentioning it, but this is something other CMS programs offer. XOOPS being, my impression, is far beyond most other CMS's - except in this one little point.

Anyway, at least it's something to consider. Hacking is great ;) but if so many people are looking how to hack the same thing for the same purpose, maybe a plausible solution ought to be thought out.


Chris

44
Daigoro
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/7 10:11

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


ibzan,

You are right, something ought to be though out. And I belive the core team is thinking/working on a solution.
However, until an universal solution has been implemented, this kind of hacking is needed.

I must admit that I realy like using squre brackets to select the language "on the fly", eg. when writing a message. But on other ocations, it's a pain to use!
I'd like to see it implemented in the core, TOGETHER with a system to manage multiple languages.

I don't belive it's possible to make an automatic system that will enable all modules to be multilangual. The modules will need to be written to support it.

45
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/7 15:17

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


Well, I hope XOOPS would add this square backet method to core even if they implement XOOPS multilingual by adding an extra column for language to related tables. We don't need to have extra column for blocks titles. We need news, comment, and forum content, etc for members to use. For admin, I prefer to use this way still: "Select [tch]English[/tch][eng]Chinese[/eng]" for assign title to select language block and most place.

Today, I solved the way to show in blocks administration table.

edit /modules/system/admin/blocksadmin/blocksadmin.php
in function list_blocks(line 41)
Quote:
global $xoopsUser, $xoopsConfig, $myts, $HTTP_GET_VARS; //failed, check next post from Daigoro

(line 98)
Quote:
$title = $myts->makeTboxData4Show($block_arr[$i]->getVar("title"));


if you add multilingual for module name in /modules/news/language/tchinese/modinfo.php for each modules before install modules, you may need to edit line 100
Quote:
$name = $myts->makeTboxData4Show($block_arr[$i]->getVar("name"));


and within the line 101 echo
Quote:
$myts->makeTboxData4Show($module_list2[$block_arr[$i]->getVar('mid')])


You jump, I jump. I do, you do.
Happy to share again.

46
Daigoro
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/7 22:29

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


mCity,

Thanks for sharing!


mCity wrote:
Quote:

Well, I hope XOOPS would add this square backet method to core even if they implement XOOPS multilingual by adding an extra column for language to related tables. We don't need to have extra column for blocks titles. We need news, comment, and forum content, etc for members to use. For admin, I prefer to use this way still: "Select [tch]English[/tch][eng]Chinese[/eng]" for assign title to select language block and most place.


I agree it's a convinient method, IF you happen to know all the languages. I'm webmaster on a danish, japanese and english site, and often I have problems remembering the japanese words - thus other people need to edit the text again, with the risk of axidental mistakes happening in the other languages. Now imagine supporting 20 languages or more, perhaps having 10 or 15 people going thru all the lines to insert/translate their part. It's a hell.

mCity wrote:
Quote:

Today, I solved the way to show in blocks administration table.

edit /modules/system/admin/blocksadmin/blocksadmin.php in function list_blocks(line 41)
Quote:
global $xoopsUser, $xoopsConfig, $myts, $HTTP_GET_VARS;



Great work. I did however have problems with the above line.
Instead of that line, I added the following as a new line 42:

Quote:
$myts =& MyTextSanitizer::getInstance();


All the other lines worked as they should.

I noticed that things like custom blocks, which don't belong to a module will have a name as an unbreabable space:
Quote:
 
- couldn't (within a few minutes) find out how to change it to be nothing.

I also noticed the drop-down box isn't fixed yet.


All in all. Good work!


47
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/8 6:50

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


Daigoro wrote:
Quote:
I also noticed the drop-down box isn't fixed yet.

Daigoro,

I finally found the way to fix the list-box. As it seems the foundation to get the modules name, I guess it'd also solve many place to show module name. So that, we don't need to edit many files for the output. Although we did many already.

Let's edit /kernel/module.php near line 501
Quote:

function &getList($criteria = null, $dirname_as_key = false)
{
$myts =& MyTextSanitizer::getInstance();
$ret = array();
$modules =& $this->getObjects($criteria, true);
foreach (array_keys($modules) as $i) {
if (!$dirname_as_key) {
$ret[$i] =& $modules[$i]->getVar('name');
$ret[$i] = $myts->makeTboxData4Show($ret[$i]);
} else {
$ret[$modules[$i]->getVar('dirname')] =& $modules[$i]->getVar('name');
$ret[$modules[$i]->getVar('dirname')] = $myts->makeTboxData4Show($ret[$modules[$i]->getVar('dirname')]); // Not sure if this is necessary!
}
}
return $ret;
}

It was my fault that my current copy(defined $myts same as you) is not same as my master copy(with global variable) which is not work when I generate a new site. So, I define it also in the function.

mCity...Share with happy

48
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/9 3:50

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


Quote:

Daigoro wrote:

Now imagine supporting 20 languages or more, perhaps having 10 or 15 people going thru all the lines to insert/translate their part. It's a hell.

I agree, but practically, we usually to make our site for two, or up to three languages. Your mother-language, local(where you are living), and English(as general or International). So, at this moment as XOOPS is not designed/developed as true multilingual, square brackets is quite flexible way for us. But there are some more problems still in this way, let's say, if we search an english word and we'd got some posts. Then, if we are using Japanese, we may not see the word in the post. However, we'd still lucky got the related post.

Today, I solved the name of block when we edit.
edit /modules/system/admin/blocksadmin/blocksadmin.php again line around 183 (184 if you edit for listbox) within function edit_block, add
Quote:
$myts =& MyTextSanitizer::getInstance();

around line 196, echo(...
Quote:
'name' => $myts->makeTboxData4Show($myblock->getVar('name'))

49
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/10/9 12:16

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


One of my previous post was incorrect. Please remove additional hack in /class/xoopsform/formcheckbox.php inside function addOptionArray. It would cause GROUP ADMIN to show up hyperlink for BLOCKS. Why no people told me the problem? May be no one used the hack. It was my first hack. So, please forgive me. Hope my others would be correct for you all. Well, this is the way to solve BLOCKS in multilingual in GROUP ADMIN.

edit /class/xoopsblock.php, just inside function &getAllBlocks, add this to line 344 Quote:
$myts =& MyTextSanitizer::getInstance();
and modify the line 377 to be Quote:
$ret[$block->getVar("bid")] = $myts->makeTboxData4Show($name);

If it caused problem, please post here. Thanks a lot.

Still happy in sharing.

50
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/10/14 6:26

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


Quote:

mvandam wrote:
Ah, yes good point dawilby... In many places, the title is truncated, just in case someone puts in a really long title (i.e. so they don't mess up your page layout). This trucation happens to the original full string... it is not until afterwards that the language hack occurs. Thus for the english one, the truncated title is "[spanish]...[/spanish][engl"... and then after the language hack, the 'spanish' part is stripped out, leaving only [engl...

Maybe this indicates a bug... need to look into it

We may have two ways to solved those long title showed in the Recent News block displayed in front page.

1. in the Blocks Administration, edit Recent News, in Option, increase the Length of the title from 25 to your full length (50 or 255). But we need to control our length when we input it for each language.
P.S. Needless if we defined XOOPS_USE_MULTIBYTES 1 in global.php in our /language/english.

2. use shorter code, e.g. [eng] for english. OR [e] for english. I use [ee], [cc]

Login

Who's Online

151 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 151


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits