We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Oxwall - Multilingual Question (Database Access). | Forum

Locofans
Locofans May 11 '16
Hi everyone,

    I'm looking for a way to make my Oxwall site Multilingual, not by enabling language from the language settings on the main site, but by installing Oxwall on a sub-domain and enabling the corresponding language.

Example:
https://www.locofans.com/en/
https://www.locofans.com/fr/

I tried to make them both share the same database (which was successful). Now every change made to either site affect all sites (I kind of expected that).

How can I set it up so that French contents don't get mixed up with English contents? Or set French/English contents as primary on "FR/English", or vice versa. More importantly, how can I set a language for a specific sites without it affecting the other sites?

I figured since Oxwall is a plugin based project, is it possible to set the plugin settings differently on each sites? Or do I need to build a separate plugin for it?

I hope someone can help.


The Forum post is edited by Locofans May 11 '16
ross Team
ross May 12 '16
Why do you want to use the same database, if you don't want the content to get mixed up? 

What I mean is, a user on the french version, posts something in French language, your English version will have that content in French as you're using the same database. 

I don't really understand what you want to achieve actually. Please elaborate. 

Locofans
Locofans May 12 '16
I apologize for the confusion ross.
What I meant was, I am looking for a way to share/synchronize only my User data information table among my sites. Using the same database for both sites was the first process in exploring my options, since I cannot make changes to the Core.

As you said, contents in French would be mixed up with English version. My original question was, how can I separate the contents for different languages?


ross Team
ross May 12 '16
Locofans, what do you mean by separating the content? I can't understand you. How do you see this separation of content? 
OW-Ghost
OW-Ghost May 14 '16
Is this the only way to make you website with url that are seo friendly for many languages?


I very intresting in this subject because i have dealing with same problem Locofans are right now.


My website need bee visible on google on many languages for SEO my website.


And i think same content need have many urls for every language for SEO you multi language website.



Example:
https://www.marcus.com/en/
https://www.marcus.com/th/



The Forum post is edited by OW-Ghost May 14 '16
Locofans
Locofans May 14 '16
I've done some research regarding the matter, apparently it was once possible to synchronize data tables within PhpMyAdmin, this feature is now removed. By "content separation" I meant that "FR" would be able to pull data from "EN" database without merging them. Synchronizing some tables would prevent duplicate informations, and it wouldn't feel as if "EN", "FR" and "ES" are three different domains.

Example:
1- A user is joining through "FR" with the username "awesome", if the username "awesome" is already owned by another user in "EN", he/she shouldn't be allowed to duplicate the username. (That is if we could synchronize the user data tables)
2- Yet each language version displays it's own contents, but users should be able to send messages to each others regardless were they are signed in.

Just a few examples. I believe these are features are to think about, it would make Oxwall truly multilingual. Selecting a language doesn't necessarily make it multilingual if the contents remains the same.

I honestly do not know how we're going to make this happen, but one thing I'm sure, it is not impossible.
The Forum post is edited by Locofans May 14 '16
dave Leader
dave May 14 '16
OK lets forget about the forest view for a moment, lets look at one tree here.  


So the very basic idea here is the have a site that caters to both languages at the same time as a relational database structure but allow enough non relational structure to be somewhat independent of each other. 


Do i understand it correctly? 


What is the real benefit here as i don't see alot of french people beating down the door to talk on english sites and vise versa?

Locofans
Locofans May 15 '16
That is correct dave. It all depends on your site, since I'm running a Fan based website, not every user shares the same interest. I came from a French culture and I can tell you it is different from the American culture although they shares some similarities.

It would be the same as if you were running a Fan based site for sports, you would want to separate each content.

Example:
www.mysite.com/basketball/
www.mysite.com/football/
www.mysite.com/golf/


dave Leader
dave May 15 '16
OK yes sports, something i did not consider, thanks for sharing that, makes sense now. 


I don't have multiple languages on my site so not sure how they work in a live site, ie if you have two languages one en and one fr  and you have a en member they can choose en for their lang and fr can choose fr for their language.  I assume that is how it works. 


But assuming that, the next thing you would have to do is have a event listener that would hook into every activity possible (similar to my amodchangelog plugin) and then according to that action, reroute the process to do what you want.  


Not every activity is hookable, sometimes they just happen and there is no way to hook into them. Oxwall does seem to be adding more process each update to hook into more activities but it is slow going.  But for those that are hookable that is how i see it being done. 





OW-Ghost
OW-Ghost May 15 '16
Locofans i have same problem, my website is Fan based and not everyone share same interest. And i need sepearate content in at least 2 url or more url for every language on my website.


You tell me this is not possible with oxwall websites?


Maybe i have spent my money on a website that not fit my needs and i need look for another platform that support multilingual 


Please let us know if you will solve this multilingual problem


I think your idea about sub-domain is at least a good try to solve it i hope someone else have solved this and can share it here


I would like to know if multilingual support is possible from Ross because he knows a lot about anything about oxwall. and if it is possible how do it?


Marcus



The Forum post is edited by OW-Ghost May 15 '16
ross Team
ross May 16 '16
what you want to achieve Locofans, is considered as a complicated code modification of the database and the core files, you need to develop a bridge between two versions of the website to sync access details of the users to one domain, besides that you need to write a script (plugin) which will pull different data depending on the domain the user sign-in on. 
ross Team
ross May 16 '16
Topic was moved from General Questions.
Locofans
Locofans May 16 '16
I figured it would require a Core modification and some custom SQL codes/queries. I also believe that a bridge (as you mentioned) should be enough to get started, by installing the plugin on both websites it should automatically synced the desired data tables within both databases. (theoretically)

Scenario:
By building a plugin "Bridge Master".
Once installed, it will give you the ability to access another database within your hosting/cPanel. You'll need to provide:
DB Name     |_____________|
DB User      |_____________|
DB Pass      |_____________|
Tables        |_____________|

The primary tables needed to be synced would be:
ow_base_user*_xxx
ow_mailbox*_xxx

Perhaps Dave can give us more insight in this. How would you proceed with such a plugin Dave?

PS: I am just brain storming ideas, every project starts with a theory.
dave Leader
dave May 16 '16
I know this is jumping ahead a bit but the first thing that hit me was the probability of race conditions.   Still noodling over the idea though... i will have more later. 
Locofans
Locofans May 16 '16
Race conditions? I'm kind of lost here Dave.
dave Leader
dave May 16 '16
It can happen when you are feeding off of a single db and the record does not get updated before the data is pulled, or the value is not updated before security measures are taken, its an old vulnerability on php that for the most part only happens in rare cases but it exists.  


For example if you create a new record and then pull the id all in the same query and you do that many times in a row, it could fail do to the id not being present when asked for, its a timing thing. 

The chances of it happening are increased substantially when bridging other databases.
 

dave Leader
dave May 16 '16
Another thing to consider is that all the fields in each db would need to be named different than the original. Because there are going to be lots of "JOINS"  in this setup and its so much easier and less confusing if your dealing with different names. Otherwise the query can be very long and very confusing indeed. 
dave Leader
dave May 16 '16
There are some videos about race condition on youtube but i don't understand the dialect of the people presenting them.  So you might have a peek.  


There are lots of variations, but basically the more outward your data is from the source the more potential for a race condition to occur either normally or by malicious intent.  


The very basic of basic explanation is what happens if you deduct money from your bank account and then have people put money in your bank account and then you have other withdrawals and deposits at the same time. If it was not coded properly someone could exploit that and take more money out of your account than you have available.  


Its called race condition because its about data racing and which one gets their first. 

The Forum post is edited by dave May 16 '16
Freyer
Freyer Dec 15 '16
I suppose the easiest solution would be to use language and user ID depended strings for the user content for this purpose.

To make this work, there should be an automatic table creation for each added profile question, which is linked to the user ID and to the language ID. So user ID 1 is referring to Profile question x ID1 and to the required language ID x, with the default respons 'no content for this language' (along language ID) it the field has no translation. This situation will still make it possible for user ID 1 to add a different answer in the other language, which will only show up in the requested language