Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2017, 07:21 PM
LUC1G07CH1's Avatar
LUC1G07CH1 LUC1G07CH1 is offline
Member
 
Join Date: Mar 2016
Location: Too distant for telling, but it's HUEBR
Posts: 150
Gender: Unknown/Other
Credits: 19,130
LUC1G07CH1 is on a distinguished road
Send a message via AIM to LUC1G07CH1 Send a message via Yahoo to LUC1G07CH1
Default Is language switch on Mysidia script possible?

Because i want to make my sites switchable to portuguese/english but it still has the same server.
Also...because portuguese is my native language and what if a friend of mine wants to access the site and they doesn't understand english after all? Or some random brazilian that also doesn't understand english wants to go on my site?

And because why not?
Reply With Quote
  #2  
Old 07-29-2017, 07:50 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,656
Dinocanid is on a distinguished road
Default

I haven't tried it, but here's my guess:
1. Create a new column in users_options where the preferred language is stored. You could also set the default value to 'english' or 'portuguese'. (Preferably use acronyms like 'en' or 'pr' to avoid any spelling errors that may come up later on while coding)
2. Go into the lang files and copy-paste all the lines, then change them to portuguese. (So keep all the english lines and underneath it have the portuguese lines!) Like this:
PHP Code:
$lang['title'] = "Welcome to Pound Center";
//the rest of the english lines

$lang['title_pr'] = "Bem-vindo ao Pound Center";
//the rest of the portuguese lines 
(I used google translate, forgive me xD) Then in the view files you can do this:
PHP Code:
$language $mysidia->db->select("users_options", array("language"), "username = '{$mysidia->user->username}'")->fetchColumn();
if(
$language == 'en'){
$document->addLangvar($this->lang->title);
}
else{
$document->addLangvar($this->lang->title_pr);

This isn't very in-depth, it's just the main idea. Let me know if you need more direction though!

EDIT: Removed the first option since the second was much cleaner.
__________________

Last edited by Dinocanid; 07-29-2017 at 07:54 PM.
Reply With Quote
  #3  
Old 07-30-2017, 02:58 PM
LUC1G07CH1's Avatar
LUC1G07CH1 LUC1G07CH1 is offline
Member
 
Join Date: Mar 2016
Location: Too distant for telling, but it's HUEBR
Posts: 150
Gender: Unknown/Other
Credits: 19,130
LUC1G07CH1 is on a distinguished road
Send a message via AIM to LUC1G07CH1 Send a message via Yahoo to LUC1G07CH1
Default

I'll try it soon! Thank you.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:07 PM.

Currently Active Users: 457 (0 members and 457 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636