Added child theme translation support and other small fixes

This commit is contained in:
Silvan Calarco 2014-12-08 17:04:48 +01:00
parent 9bc3238b83
commit eb224e82f1
6 changed files with 133 additions and 10 deletions

View File

@ -6,8 +6,7 @@ if ( !defined( 'ABSPATH' ) ) {
}
add_action('wp_print_styles', 'add_custom_font');
// custom fonts
function add_custom_font() {
$url = get_stylesheet_directory_uri() . '/fonts/comfortaa-regular/stylesheet.css';
wp_register_style('comfortaaregular', $url);
@ -17,9 +16,10 @@ function add_custom_font() {
wp_register_style('comfortaabold', $url);
wp_enqueue_style('comfortaabold');
}
add_action('wp_print_styles', 'add_custom_font');
// openmamba downloads pages
function openmamba_download_link($milestone, $medium, $currarch, $ext, $mlword, $lang, $append) {
function openmamba_download_link($milestone, $medium, $currarch, $ext, $mlword, $lang) {
eval(file_get_contents("/var/ftp/pub/openmamba/media/".$milestone."/".$medium."/".$lang."/latest.inc.php"));
if ("$milestone" == "devel") {
$displaymilestone = "rolling";
@ -29,10 +29,11 @@ function openmamba_download_link($milestone, $medium, $currarch, $ext, $mlword,
$currreleasetag=$releaseTag[$medium.'-'.$milestone.'-'.$lang.'-'.$currarch];
echo "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
echo "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'><a href=\"/media/$milestone/$medium/$lang/openmamba-$medium-$lang-$currreleasetag.$currarch$ext\">";
echo "openmamba $displaymilestone $medium $forword $currarch ($mlword)</a>&nbsp;</h5>";
echo "openmamba $displaymilestone $medium ";
echo _e('for','responsive')." $currarch ($mlword)</a>&nbsp;</h5>";
echo "<i>";
echo _e('File size:').' '.$sizeMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch].'B; ';
echo _e('Date').': '.substr($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch],
echo _e('File size:','responsive').' '.$sizeMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch].'B; ';
echo _e('Date','responsive').': '.substr($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch],
0, strpos($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch], ' '));
echo "; Md5: " . $md5Medium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch];
echo "</i></td></tr></table>";
@ -102,6 +103,11 @@ add_shortcode('openmamba_download', 'openmamba_download_func');
function openmamba_webbuild_func( $atts ) {
$urlargspos = strpos($_SERVER[REQUEST_URI], '?');
if ($urlargspos > 0) {
$urlargs = substr($_SERVER[REQUEST_URI], $urlargspos);
}
$a = shortcode_atts( array(
'host' => 'buildvm01'
), $atts );
@ -111,6 +117,8 @@ function openmamba_webbuild_func( $atts ) {
print fread($file, 20000);
flush();
fclose($file);
print "<script>ajax_getvalues(\"" . $urlargs . "\",\"\");";
print "ajax_getvalues_refresh(\"\",user,user_email,encodeURIComponent(secret));</script>";
}
add_shortcode('openmamba_webbuild', 'openmamba_webbuild_func');

10
languages/README Normal file
View File

@ -0,0 +1,10 @@
Translation management:
-----------------------
1)
xgettext --default-domain=responsive --language=PHP --keyword=__ --keyword=_e --sort-by-file --copyright-holder="Silvan Calarco" --package-name=openmamba --package-version=1.0 --msgid-bugs-address="bugs@openmamba.org" ../*.php
2)
msgmerge it.po responsive.pot -o it.new.po
3)
msgcat it.po | msgfmt -o it.mo -

BIN
languages/it.mo Normal file

Binary file not shown.

54
languages/it.po Normal file
View File

@ -0,0 +1,54 @@
# openmamba child theme translations.
# Copyright (C) 2014 Silvan Calarco
# This file is distributed under the same license as the PACKAGE package.
# Silvan Calarco <silvan.calarco@mambasoft.it>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: Responsive Theme\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-12-08 16:25+0100\n"
"PO-Revision-Date: 2014-12-08 16:25+0100\n"
"Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n"
"Language-Team: Italian, Italy\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../bbpress.php:41 ../webbuild-page.php:54 ../webbuild-status-page.php:41
msgid "Read more &#8250;"
msgstr "Leggi di più &#8250;"
#: ../bbpress.php:42 ../webbuild-page.php:55 ../webbuild-status-page.php:42
msgid "Pages:"
msgstr "Pagine:"
#: ../functions.php:33
msgid "for"
msgstr "per"
#: ../functions.php:35
msgid "File size:"
msgstr "Dimensione file:"
#: ../functions.php:36
msgid "Date"
msgstr "Data"
#: ../header-webbuild.php:87
msgid "&darr; Skip to Main Content"
msgstr "&darr; Salta al contenuto principale"
#: ../sidebar-top.php:34
msgid "Login"
msgstr "Accedi"
#: ../sidebar-top.php:35
msgid "Register"
msgstr "Registrati"
#: ../sidebar-top.php:38
#, php-format
msgid "Howdy, %1$s"
msgstr "Salve, %1$s"

55
languages/responsive.pot Normal file
View File

@ -0,0 +1,55 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Silvan Calarco
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: openmamba 1.0\n"
"Report-Msgid-Bugs-To: bugs@openmamba.org\n"
"POT-Creation-Date: 2014-12-08 16:25+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../bbpress.php:41 ../webbuild-page.php:54 ../webbuild-status-page.php:41
msgid "Read more &#8250;"
msgstr ""
#: ../bbpress.php:42 ../webbuild-page.php:55 ../webbuild-status-page.php:42
msgid "Pages:"
msgstr ""
#: ../functions.php:33
msgid "for"
msgstr ""
#: ../functions.php:35
msgid "File size:"
msgstr ""
#: ../functions.php:36
msgid "Date"
msgstr ""
#: ../header-webbuild.php:87
msgid "&darr; Skip to Main Content"
msgstr ""
#: ../sidebar-top.php:34
msgid "Login"
msgstr ""
#: ../sidebar-top.php:35
msgid "Register"
msgstr ""
#: ../sidebar-top.php:38
#, php-format
msgid "Howdy, %1$s"
msgstr ""

View File

@ -35,9 +35,5 @@
</div>
</span>
<script>
ajax_getvalues("","");
ajax_getvalues_refresh("",user,user_email,encodeURIComponent(secret));
</script>
</td></tr>
</table>