Merge branch 'master' into testing
This commit is contained in:
@@ -1,9 +1,56 @@
|
|||||||
Localizations for StatusNet are being maintained through TranslateWiki:
|
Localizations for StatusNet are being maintained through TranslateWiki:
|
||||||
http://translatewiki.net/wiki/Translating:StatusNet
|
http://translatewiki.net/wiki/Translating:StatusNet
|
||||||
|
|
||||||
Note if you are working with a direct git checkout, you will need to build
|
Ongoing translation work should be done there to ensure updates are
|
||||||
the binary .mo files from the .po source files for translations to work
|
integrated into future versions of StatusNet.
|
||||||
in the web app.
|
|
||||||
|
|
||||||
If gettext and GNU make are installed, you can simply run 'make' in this
|
|
||||||
directory to build them.
|
== Building runtime translations ==
|
||||||
|
|
||||||
|
If you are working with a direct git checkout or have customized any
|
||||||
|
message files, you will need to build binary .mo files from the .po
|
||||||
|
source files for translations to work in the web app.
|
||||||
|
|
||||||
|
If gettext and GNU make are installed, you can simply run 'make' in the
|
||||||
|
main StatusNet directory, and all core and plugin localizations will be
|
||||||
|
recompiled.
|
||||||
|
|
||||||
|
|
||||||
|
== Customization ==
|
||||||
|
|
||||||
|
User interface texts in any language can be customized by editing the
|
||||||
|
texts in the .po source files, then rebuilding the binary .mo files
|
||||||
|
used at runtime.
|
||||||
|
|
||||||
|
The default/US English texts can be overridden by adding "translations"
|
||||||
|
to en/LC_MESSAGES/statusnet.po.
|
||||||
|
|
||||||
|
Note that texts you change in one language will not affect other
|
||||||
|
languages, which are selected based on visitors' browser preferences.
|
||||||
|
If you customizations include important information or links,
|
||||||
|
you may wish to disable languages that you haven't customized so that
|
||||||
|
visitors always get your text.
|
||||||
|
|
||||||
|
To disable all non-English languages add this to your config.php (you
|
||||||
|
will need to edit both the en and en_GB files):
|
||||||
|
|
||||||
|
$config['site']['languages'] = array(
|
||||||
|
'en-us' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)', 'direction' => 'ltr'),
|
||||||
|
'en-gb' => array('q' => 1, 'lang' => 'en_GB', 'name' => 'English (British)', 'direction' => 'ltr'),
|
||||||
|
'en' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)', 'direction' => 'ltr'),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
To disable everything including British English variant:
|
||||||
|
|
||||||
|
$config['site']['languages'] = array(
|
||||||
|
'en' => array('q' => 1, 'lang' => 'en', 'name' => 'English', 'direction' => 'ltr'),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
== Plugins ==
|
||||||
|
|
||||||
|
This locale directory contains translations for the core StatusNet
|
||||||
|
software only. Plugins may have their own locale subdirectories and
|
||||||
|
their own .po and .mo files as well, so if customizing you may need
|
||||||
|
to poke at those as well.
|
||||||
|
6062
locale/statusnet.pot
Normal file
6062
locale/statusnet.pot
Normal file
File diff suppressed because it is too large
Load Diff
@@ -65,6 +65,26 @@ class MeteorPlugin extends RealtimePlugin
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pull settings from config file/database if set.
|
||||||
|
*/
|
||||||
|
function initialize()
|
||||||
|
{
|
||||||
|
$settings = array('webserver',
|
||||||
|
'webport',
|
||||||
|
'controlport',
|
||||||
|
'controlserver',
|
||||||
|
'channelbase');
|
||||||
|
foreach ($settings as $name) {
|
||||||
|
$val = common_config('meteor', $name);
|
||||||
|
if ($val !== false) {
|
||||||
|
$this->$name = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::initialize();
|
||||||
|
}
|
||||||
|
|
||||||
function _getScripts()
|
function _getScripts()
|
||||||
{
|
{
|
||||||
$scripts = parent::_getScripts();
|
$scripts = parent::_getScripts();
|
||||||
|
@@ -73,9 +73,11 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
$this->serveMobile = true;
|
$this->serveMobile = true;
|
||||||
} else {
|
} else {
|
||||||
// If they like the WAP 2.0 mimetype, serve them MP
|
// If they like the WAP 2.0 mimetype, serve them MP
|
||||||
if (strstr('application/vnd.wap.xhtml+xml', $type) !== false) {
|
// @fixme $type is undefined, making this if case useless and spewing errors.
|
||||||
$this->serveMobile = true;
|
// What's the intent?
|
||||||
} else {
|
//if (strstr('application/vnd.wap.xhtml+xml', $type) !== false) {
|
||||||
|
// $this->serveMobile = true;
|
||||||
|
//} else {
|
||||||
// If they are a mobile device that supports WAP 2.0,
|
// If they are a mobile device that supports WAP 2.0,
|
||||||
// serve them MP
|
// serve them MP
|
||||||
|
|
||||||
@@ -139,8 +141,19 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
'windows ce'
|
'windows ce'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$blacklist = array(
|
||||||
|
'ipad', // Larger screen handles the full theme fairly well.
|
||||||
|
);
|
||||||
|
|
||||||
$httpuseragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
$httpuseragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||||
|
|
||||||
|
foreach ($blacklist as $md) {
|
||||||
|
if (strstr($httpuseragent, $md) !== false) {
|
||||||
|
$this->serveMobile = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($this->mobiledevices as $md) {
|
foreach ($this->mobiledevices as $md) {
|
||||||
if (strstr($httpuseragent, $md) !== false) {
|
if (strstr($httpuseragent, $md) !== false) {
|
||||||
$this->setMobileFeatures($httpuseragent);
|
$this->setMobileFeatures($httpuseragent);
|
||||||
@@ -149,7 +162,7 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
|
|
||||||
// If they are okay with MP, and the site has a mobile server,
|
// If they are okay with MP, and the site has a mobile server,
|
||||||
// redirect there
|
// redirect there
|
||||||
@@ -167,7 +180,9 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$type) {
|
// @fixme $type is undefined, making this if case useless and spewing errors.
|
||||||
|
// What's the intent?
|
||||||
|
//if (!$type) {
|
||||||
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ?
|
$httpaccept = isset($_SERVER['HTTP_ACCEPT']) ?
|
||||||
$_SERVER['HTTP_ACCEPT'] : null;
|
$_SERVER['HTTP_ACCEPT'] : null;
|
||||||
|
|
||||||
@@ -180,7 +195,7 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
throw new ClientException(_('This page is not available in a '.
|
throw new ClientException(_('This page is not available in a '.
|
||||||
'media type you accept'), 406);
|
'media type you accept'), 406);
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
|
|
||||||
header('Content-Type: '.$type);
|
header('Content-Type: '.$type);
|
||||||
|
|
||||||
@@ -221,9 +236,12 @@ class MobileProfilePlugin extends WAP20Plugin
|
|||||||
|
|
||||||
function onStartShowHeadElements($action)
|
function onStartShowHeadElements($action)
|
||||||
{
|
{
|
||||||
if (!$action->serveMobile) {
|
// @fixme nothing appears to set a serveMobile on any action,
|
||||||
return true;
|
// so this is useless and spews errors. Is this supposed to be
|
||||||
}
|
// checking $this?
|
||||||
|
//if (!$action->serveMobile) {
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
|
||||||
$action->showTitle();
|
$action->showTitle();
|
||||||
$action->showShortcutIcon();
|
$action->showShortcutIcon();
|
||||||
|
@@ -34,7 +34,7 @@ function update_core($dir, $domain)
|
|||||||
xgettext \
|
xgettext \
|
||||||
--from-code=UTF-8 \
|
--from-code=UTF-8 \
|
||||||
--default-domain=$domain \
|
--default-domain=$domain \
|
||||||
--output=locale/$domain.po \
|
--output=locale/$domain.pot \
|
||||||
--language=PHP \
|
--language=PHP \
|
||||||
--add-comments=TRANS \
|
--add-comments=TRANS \
|
||||||
--keyword="_m:1,1t" \
|
--keyword="_m:1,1t" \
|
||||||
@@ -64,7 +64,7 @@ function do_update_plugin($dir, $domain)
|
|||||||
xgettext \
|
xgettext \
|
||||||
--from-code=UTF-8 \
|
--from-code=UTF-8 \
|
||||||
--default-domain=$domain \
|
--default-domain=$domain \
|
||||||
--output=locale/$domain.po \
|
--output=locale/$domain.pot \
|
||||||
--language=PHP \
|
--language=PHP \
|
||||||
--add-comments=TRANS \
|
--add-comments=TRANS \
|
||||||
--keyword='' \
|
--keyword='' \
|
||||||
|
Reference in New Issue
Block a user