From eb224e82f128dd20f9045b8c372229f190178c44 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 8 Dec 2014 17:04:48 +0100 Subject: [PATCH] Added child theme translation support and other small fixes --- functions.php | 20 +++++++++----- languages/README | 10 +++++++ languages/it.mo | Bin 0 -> 793 bytes languages/it.po | 54 ++++++++++++++++++++++++++++++++++++++ languages/responsive.pot | 55 +++++++++++++++++++++++++++++++++++++++ webbuild.html.inc | 4 --- 6 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 languages/README create mode 100644 languages/it.mo create mode 100644 languages/it.po create mode 100644 languages/responsive.pot diff --git a/functions.php b/functions.php index 8d10012..c2a5c24 100644 --- a/functions.php +++ b/functions.php @@ -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 ""; echo "
"; - echo "openmamba $displaymilestone $medium $forword $currarch ($mlword) 
"; + echo "openmamba $displaymilestone $medium "; + echo _e('for','responsive')." $currarch ($mlword) "; echo ""; - 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 "
"; @@ -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 ""; } add_shortcode('openmamba_webbuild', 'openmamba_webbuild_func'); diff --git a/languages/README b/languages/README new file mode 100644 index 0000000..541cc60 --- /dev/null +++ b/languages/README @@ -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 - diff --git a/languages/it.mo b/languages/it.mo new file mode 100644 index 0000000000000000000000000000000000000000..2392ab3d3aa15bf4f3e85130a7a538bf461ec219 GIT binary patch literal 793 zcmaKp&u$Yj5XKFZe~T(XrJexE5~UKNPB#&)qAehxEo!Aigf?)W?oPIbjlHs+KzI+X zyay7uUU&sA+_-T7i3i|wQl%0HEPeaiS&wJO^L<}h_$aUv=oVB#i_jM+u3yki=r^vR*$-B)JFFLl=M)as;pNRveLJqBCxq7GF+DNzXrPMyK z69el+&)GMe2en_Q*X+EuCXS+Nt$gUG zaU-9_Plhx+B5wzwp~K^(L#7PTq%1pM8bV%lAQ58s1CG)9KBluQ3 zZE{^x#nCkqJ9@~Nt~D$NFfbE`RE_!6yQg{1g^uQFgRKsirIv-3wLba$kAn{57d3qR E3)x4(CIA2c literal 0 HcmV?d00001 diff --git a/languages/it.po b/languages/it.po new file mode 100644 index 0000000..397fc13 --- /dev/null +++ b/languages/it.po @@ -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 , 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 \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 ›" +msgstr "Leggi di piĆ¹ ›" + +#: ../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 "↓ Skip to Main Content" +msgstr "↓ 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" diff --git a/languages/responsive.pot b/languages/responsive.pot new file mode 100644 index 0000000..12cbb63 --- /dev/null +++ b/languages/responsive.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 ›" +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 "↓ 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 "" diff --git a/webbuild.html.inc b/webbuild.html.inc index 61a28a1..d7e3f70 100644 --- a/webbuild.html.inc +++ b/webbuild.html.inc @@ -35,9 +35,5 @@ -