1
chefry
cloning a module with a twist
  • 2011/8/9 13:20

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


I'm doing a Russian translation of "Classifieds" and I have a question about Cloning, or at least a variation of Cloning

I want to have both the English and Russian variants available on the site, and (here's the twist) I want them both to access the same database tables

So, the question is, how can i get the russian module to install using the same "English" tables?

Charset encoding is not a problem. all that has already been done

Any suggestions???

TIA!

2
mboyden
Re: cloning a module with a twist
  • 2011/8/9 21:40

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


Why do you want them to access the same tables? The postings will be in different languages, so wouldn't it make sense to have them separate?

Or you could use one of the two language capabilities EMLH or xLanguage and allow people to post both languages in a single post.

If you truly want them to access the same tables, after you clone the module (a separate issue), you likely could export your database, then edit the SQL for the cloned module to be views of the existing tables.

I've integrated third party apps into XOOPS using the user and groups tables using SQL views (as tables) to access the same info.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

3
chefry
Re: cloning a module with a twist
  • 2011/8/9 22:00

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


xlanguage is useless for what I want.

The ads will be english and/or russian without xlanguage.

I've managed to change the mysql.sql to install 2 versions, but the question is....

Where is the file or files that tells the module what tables to access?

I figure that if I can edit THAT file, I can tell both versions to look into the same tables.

I tried to translate the module, with english & russian appearing. All the text in the module (names, buttons, etc) but it doesn't look good. That's why i decided i would have 2 language versions accessing and editing the same data tables.

It's not the user posted text I'm worried about, it's the text of the module that I'm trying to translate and modules like xlanguage are useless for that. They only handle data, not the templates.

It's primarily the file Language/main.php that I'm translating. Almost everything that appears on the screen is in that file.

4
mboyden
Re: cloning a module with a twist
  • 2011/8/9 22:40

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


Then all you need to do is allow users to change the language; that is what triggers the use of modules/modulename/language/<lang> files. The best method for that is EMLH (easiest multi-language hack, by GIJoe) which does change which <lang> files to use. You have the option of providing multiple languages in the content, too.

As to the tables created by any module, that is in the modulename/sql directory (typically) and is referenced in the module's xoops_version.php file.

Or you can install it anew and then rebuild those cloned tables as views to the original tables. There could be some other oddities, and you may have to create set the same preferences in certain places to get it to work as intended/desired.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

5
chefry
Re: cloning a module with a twist
  • 2011/8/10 11:32

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


ok, i installed joe's hack but I'm not sure about these settings

Quote:

// list language - accept_chaset patterns (perl regex) separated with comma
define('EASIESTML_ACCEPT_CHARSET_REGEXES',',/shift_jis/i');

// list language - accept_language patterns (perl regex) separated with comma
define('EASIESTML_ACCEPT_LANGUAGE_REGEXES','/^en/,/^ja/');


do you know what the correct settings are for english and russian. i can't find anything on google

6
chefry
Re: cloning a module with a twist
  • 2011/8/11 13:58

  • chefry

  • Home away from home

  • Posts: 1005

  • Since: 2006/10/14


unfortunately, EMLH doesn't work.

Does XLanguage trigger modules/modulename/language/<lang> files?

Login

Who's Online

97 user(s) are online (66 user(s) are browsing Support Forums)


Members: 0


Guests: 97


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