Hello moazbasha,
If you are working on wordpress then use one domain, one folder, one database..
for this use WPML plugin, it is a multilanguage plugin for wordpress having the functionality for multiple languages by using .po, .mo files..
Thanks for reply
I have tried this plugin before but I didn’t like it because for arabic site some contents of theme must be at right side (rtl)
WPML plugin doesn’t support modify CSS for each language therefor I must make two sites. To make special CSS for each site
My question is if I can make two sites by two languages by po/mo files using multi sites
Fuel
(@denishvachhani)
@moazbasha
how did you manage this?
Currenlty i have same situation like you.
if I can make two sites by two languages by po/mo files using multi sites?
I have tried two solution & I prefer WPML Plugin
You can use multisites or WPML plugin
http://codex.wordpress.org/WordPress_in_Your_Language
Fuel
(@denishvachhani)
i choose multisites instead of WPML. now only one help needed.
How to call different PO/MO files for theme based on different sites in multisite.
for e.g
German — de_DD.mo
Nedharland – nl_NL.mo
But over here in wp-config.php — i can set only one language in ‘WP_LANG’ options for main language.
From My wp-cnfig.php file
define('WPLANG', '');
If you want each site to have it’s own language, you can use PHP if-checks in your wp-config:
If you want each site to have it’s own language, you can use PHP if-checks in your wp-config:
If you want each site to have it’s own language, you can use PHP if-checks in your wp-config:
if ( $_SERVER["HTTP_HOST"] == "domain-en.com" ) { define('WPLANG', 'en_us'); }
if ( $_SERVER["HTTP_HOST"] == "domain-nl.com" ) { define('WPLANG', 'NL_nl'); }
And so on.
Fuel
(@denishvachhani)
@ipstenu – Mike
Finally i solved it, I am sharing this so it might be useful for someone
@mika, The way you are doing will not work for multisite:
Because:
If you see the function at wp-includes/i10n.php
function get_locale() {
global $locale;
if ( isset( $locale ) )
return apply_filters( 'locale', $locale );
// WPLANG is defined in wp-config.
if ( defined( 'WPLANG' ) )
$locale = WPLANG;
// If multisite, check options.
if ( is_multisite() ) {
// Don't check blog option when installing.
if ( defined( 'WP_INSTALLING' ) || ( false === $ms_locale = get_option( 'WPLANG' ) ) )
$ms_locale = get_site_option('WPLANG');
if ( $ms_locale !== false )
$locale = $ms_locale;
}
if ( empty( $locale ) )
$locale = 'en_US';
return apply_filters( 'locale', $locale );
}le', $locale );
}
This function assumes, that if you have multiple websites and one wp-config.php, then this variable should be loaded from the database under totally different name $locale.
So be careful and remember that after installing WordPress multisite, translation files are loaded according to the site meta WPLANG, which is saved in DB. And donβt try to update this value from the admin panel, because it is buggy and does not work. Just go to the database with phpmyadmin and change the value there.
How would that not work?
Don’t set locale globally, set it per-site.