51
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/10/14 14:47

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


My last two ways may not be good or correct. IMHO, I suggest to modify /modules/news/blocks/news_top.php line 39 for logic Quote:
$title = $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";

to be Quote:
$title = substr($myts->makeTboxData4Show($myrow['title']),0,($options[2] -1))."...";

If devs agree with it, please modify it in next release. It'd solve trucation.

mCity.

52
joelg
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/20 11:43

  • joelg

  • Just popping in

  • Posts: 22

  • Since: 2003/10/14


I would like to add my voice to those asking for a "true" multilanguage system. I am working on a site where:
1) There are up to 10 languages at the moment, and counting.
2) The people who update the site are distributed around the world. They can all use an English management interface, but the content must be in all these languages (including Cyrillic and double-byte languages)
3) The authors and editors have zero technical skills - I really don't want to have them put in HTML tags or square-bracket commands.
4) I want to separate the site areas by language, with a drop-down list to choose the language.

It seems to me that the only way to do this is to make it possible to have ALL content (including blocks etc) include a "language" parameter, so that the block is only displayed if the user has chosen the relevant language (should work also for anonymous users). As far as I can understand Xoops, it would also mean detaching blocks from modules: you should be able to include the same module multiple times, but with different titles (languages) etc. In other words, truly separate the different languages. Any thoughts, is this possible?

Cheers, Joel G

53
johny
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/24 13:52

  • johny

  • Just popping in

  • Posts: 23

  • Since: 2003/8/25


I think very highly of Xoops. I was using PhpNuke before, and now I'm trying to adapt to Xoops.

Xoops indeed has better functionality, but lacks multi-language support. I think you guys are doing a great job and I'll stard hardcoding the files using this forum topic.

Thank you for sharing this, and I would like to urge the developers to at least offer multi-language versions of XOOPS in the future, if not switching completely to this functionality.

I could hardly say I'm a newby when it comes to hardcoding modules and other files, but I have to admit that this kind of tweaking certainly requires a lot of energy and attention.

My congratulations and thanks to the brave and bright people who started coding this

54
Daigoro
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/10/24 23:50

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2


Based on your message, mvabdam has started this very interesting thread.

Everybody using or thinking about making a multilangual site is encuraged to participate in the discussion.

Best regards,

55
watar
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/11/5 18:32

  • watar

  • Just popping in

  • Posts: 12

  • Since: 2002/2/7 8


Could someone post the updated files for this hack (2.05)? I only seem too screw things up when I try to implement it

56
mCity
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/11/6 13:00

  • mCity

  • Just popping in

  • Posts: 52

  • Since: 2003/3/31


watar, if you tried, that was good. My files contained other hacks that were not suitable to you. Well here is my simply note and hope to solve your "screw things". I made the note in order to apply it on the XOOPS next release before copy over on my site. So, you need to know which file and where changed for apply to next XOOPS version. That's great that XOOPS sounded to include this in next release. If you still busy or lazy, wait for other post the set of files or next XOOPS release.

#multilingual hack


INSTALL module language

# add include to include/common.php to line 117 before ### Include site-wide lang file; 205 OK
// ############ Include function for language selection ##############
include_once(XOOPS_ROOT_PATH."/modules/language/common/functions.php");

# core coding, content title of news, forums; 205 OK
vi /class/module.textsanitizer.php
function xoopsCodeDecode #line 149
global $xoopsConfig;
$patterns[] = "/\[cc](.*)\[\/cc\]/sU"; ...
$patterns[] = "/\[ee](.*)\[\/ee\]/sU"; ...
function makeTboxData4Show
$text =& $this->xoopsCodeDecode($text, 0);
function makeTboxData4Preview
$text =& $this->xoopsCodeDecode($text, 0);

# dropdown select
vi /class/xoopstree.php
function makeMySelBox
$name = $myts->makeTboxData4Show($name); # line 168

# blocksadmin; 205 OK
vi /class/xoopsblock.php
function &getAllBlocks
$myts =& MyTextSanitizer::getInstance(); # line 344
$ret[$block->getVar("bid")] = $myts->makeTboxData4Show($name); # line 377, under case list

# module names for listbox in admin, checkbox in adv. search, etc; 205 OK
vi /kernel/module.php
function &getList # line 501
$myts =& MyTextSanitizer::getInstance();
$ret[$i] = $myts->makeTboxData4Show($ret[$i]);

# modules names in userinfo; 205 OK
vi userinfo.php
$myts->makeTboxData4Show($module->getVar('name')) # line 175

# modules names in mainmenu; 205 OK
vi /modules/system/blocks/system_blocks.php
function b_system_main_show # line 106
$myts =& MyTextSanitizer::getInstance(); # line 109
$block['modules'][$i]['name'] = $myts->makeTboxData4Show($modules[$i]->getVar('name')); # line 122

# modules names in system preference; 205 OK
vi /modules/system/admin/preferences/main.php
case 'module_cache'
$selform = new XoopsFormSelect($myts->makeTboxData4Show($modules[$mid]->getVar('name')) # line 186
# recover if /kernel/module.php can handle <<---

# Block administration 205 OK
vi /modules/system/admin/blocksadmin/blocksadmin.php
function list_blocks
$myts =& MyTextSanitizer::getInstance(); # line 42 add
$title = $myts->makeTboxData4Show($block_arr[$i]->getVar("title")); # line 99->138
$name = $myts->makeTboxData4Show($block_arr[$i]->getVar("name")); # line 101->140
$myts->makeTboxData4Show($module_list2[$block_arr[$i]->getVar('mid')]) # line 102->141 echo
function edit_block
$myts =& MyTextSanitizer::getInstance(); #225 add
$myts->makeTboxData4Show($myblock->getVar('name')) #235

# block title, page title; 205 OK
vi header.php # block line 170, page title line 97,115
$myts =& MyTextSanitizer::getInstance(); # line 29 just after include xoopsblock.php
$xoopsTpl->assign('xoops_pagetitle', $myts->makeTboxData4Show($xoopsModule->getVar('name'))); # line 95, 113
$xoopsTpl->assign('xoops_pagetitle', $myts->makeTboxData4Show($xoopsConfig['slogan'])); # line 102, 120
switch ($block_arr[$i]->getVar('side')) # blocks title, line 169-197, 5 cases
$myts->makeTboxData4Show($block_arr[$i]->getVar('title'))

# for Admin->News->Modify Topic, show [cc] for edit, use 4Edit not 4Show ; 205 OK
vi /modules/news/admin/index.php
function topicsmanager
<input type='text' name='topic_title' size='50' maxlength='50' /> # 176 size 50
<input type='text' name='topic_title' size='50' maxlength='50' /> # 196 size
function modTopic
<input type='text' name='topic_title' size='50' maxlength='50' value='".$xt->topic_title('E'). # 241 size
vi /modules/news/blocks/news_top.php
$title = substr($myts->makeTboxData4Show($myrow['title']),0,($options[2] -1))."..."; # 39 logic

# News title in blocks
vi /modules/news/blocks/news_top.php
function b_news_top_show
$title = substr($myts->makeTboxData4Show($myrow['title']),0,($options[2] -1))."..."; # line 39


57
ibzan
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/11/7 7:49

  • ibzan

  • Just popping in

  • Posts: 48

  • Since: 2003/8/31


Quote:
Where it says
[quote]$modules[$i]->getVar('name')


I put
Quote:
$myts->makeTboxData4Show($modules[$i]->getVar('name'))


I come up with a blank page with this hack. Don't know why?!? The one for the sublinks works great. Is this because the header.php needs to be updated too? I didn't understand that be the case though.

Chris

58
ibzan
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/11/7 8:11

  • ibzan

  • Just popping in

  • Posts: 48

  • Since: 2003/8/31


Hmm, I figured it out - what was not mentioned was that the

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


also needs to be entered. No big deal, though maybe somebody else also had this problem.

Chris

59
ibzan
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/11/7 8:17

  • ibzan

  • Just popping in

  • Posts: 48

  • Since: 2003/8/31


I haven't see this question asked at all and was wondering if I was the only one who was thinking about this.

Switching languages seems to have been worked out for the time being, but I have noticed that the date function is still returning English names for the months and days.

Is this:

a) a server issue? I mean that what ever local is set on the server is what the date function will will return.

b) a local computer issue? what ever local on the users computer is what the date function looks at to return

c) something alltogether different?

In the global.php file the only settings for how date and time are displayed are the relivent PHP variables for the date function. So.... how can I (or anybody else) get it to also switch the names for the days and months.

Any ideas?

blessings,

Chris

60
ibzan
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/11/7 13:08

  • ibzan

  • Just popping in

  • Posts: 48

  • Since: 2003/8/31


I have made a *little* progress concerning this issue with translating date and time format, however I have run into a wall.

The function setlocale() allows you to set the language locale which then the function strftime() uses to return the correct date / time in the correct language - yeah. BUT...!

I can only get it to work when I hard-code the header.php file by adding the line:
Quote:
setlocale(LC_ALL, "rus_RUS");]


This would be fine however, I don't want the date only in Russian. I have tried to assign a variable from the global.php file which then would correspond to the language code defined there.

I have tried this two ways. First by defining the variable within the header via XoopsTpl->assign... and then using that variable within the setlocale() function. Didn't work.

Then I thought, why can't the setlocale() function be included directly into the theme, however I don't understand smarty tags enough to correctly incorporate this in the the theme file. Every attempt I have made for that has only returned a blank screen.

Any ideas?

blessings,

Chris


Login

Who's Online

182 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 182


more...

Donat-O-Meter

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

Latest GitHub Commits