WordPress.org

Plugin Directory

Changeset 367285


Ignore:
Timestamp:
03/31/11 06:16:32 (3 years ago)
Author:
wet
Message:

wet_proteinshake: US units.

Location:
protein-shake-recipe-calculator/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • protein-shake-recipe-calculator/trunk/wet_proteinshake-de_DE.po

    r366794 r367285  
    2424msgstr "Berechne dein Protein-Shake-Rezept" 
    2525 
    26 msgid "Results in ounces:" 
    27 msgstr "Ergebnisse in Unzen:" 
     26msgid "US units:" 
     27msgstr "US-Maße:" 
    2828 
    29 msgid "Results in grams:" 
    30 msgstr "Ergebnisse in Gramm:" 
     29msgid "Metric units:" 
     30msgstr "Metrische Maße:" 
    3131 
    3232#: wet_proteinshake.php:44 
     
    6666msgstr "," 
    6767 
     68#~ msgid "Results in ounces:" 
     69#~ msgstr "Ergebnisse in Unzen:" 
     70#~ msgid "Results in grams:" 
     71#~ msgstr "Ergebnisse in Gramm:" 
    6872#~ msgid "Post Workout Shake" 
    6973#~ msgstr "Post-Workout-Shake" 
  • protein-shake-recipe-calculator/trunk/wet_proteinshake-en_EN.po

    r366794 r367285  
    2424msgstr "Calculate Your Protein Shake Recipe" 
    2525 
    26 msgid "Results in ounces:" 
    27 msgstr "Results in ounces:" 
     26msgid "US units:" 
     27msgstr "US units:" 
    2828 
    29 msgid "Results in grams:" 
    30 msgstr "Results in grams:" 
     29msgid "Metric units:" 
     30msgstr "Metric units:" 
    3131 
    3232#: wet_proteinshake.php:44 
     
    6666msgstr "." 
    6767 
     68#~ msgid "Results in ounces:" 
     69#~ msgstr "Results in ounces:" 
     70#~ msgid "Results in grams:" 
     71#~ msgstr "Results in grams:" 
    6872#~ msgid "Post Workout Shake" 
    6973#~ msgstr "Post Workout Shake" 
  • protein-shake-recipe-calculator/trunk/wet_proteinshake.php

    r366794 r367285  
    55Description: Allows the user to calculate her optimum post-workout protein shake recipe and determine right mixture of three essential ingredients. 
    66Author: Robert Wetzlmayr 
    7 Version: 1.1 
     7Version: 1.2 
    88Author URI: http://wetzlmayr.com/ 
    99License: GPL 2.0, @see http://www.gnu.org/licenses/gpl-2.0.html 
     
    4646            $options['title'] = strip_tags(stripslashes($_POST['wet_proteinshake-title'])); 
    4747            $options['buttontext'] = strip_tags(stripslashes($_POST['wet_proteinshake-buttontext'])); 
    48             $options['useounces'] = ($_POST['wet_proteinshake-useounces'] == 'oz'); 
     48            $options['useounces'] = ($_POST['wet_proteinshake-useounces'] == 'us'); 
    4949            update_option('wet_proteinshake', $options); 
    5050        } 
     
    5757        echo '<p style="text-align:right;"><label for="wet_proteinshake-buttontext">' .  __('Button Text:', 'widgets') . 
    5858        ' <input style="width: 200px;" id="wet_proteinshake-buttontext" name="wet_proteinshake-buttontext" type="text" value="'.$buttontext.'" /></label></p>'; 
    59         echo '<p style="text-align:right;"><label for="wet_proteinshake-useounces">' .  __('Results in ounces:', 'wet_proteinshake') . 
    60         ' <input style="width: 20px;" id="wet_proteinshake-useounces" name="wet_proteinshake-useounces" value="oz" type="radio"'.($useounces ? ' checked="checked"' : '').' /></label></p>'; 
    61         echo '<p style="text-align:right;"><label for="wet_proteinshake-usegrams">' .  __('Results in grams:', 'wet_proteinshake') . 
    62         ' <input style="width: 20px;" id="wet_proteinshake-usegrams" name="wet_proteinshake-useounces" value="g" type="radio"'.(!$useounces ? ' checked="checked"' : '').' /></label></p>'; 
     59        echo '<p style="text-align:right;"><label for="wet_proteinshake-useounces">' .  __('US units:', 'wet_proteinshake') . 
     60        ' <input style="width: 20px;" id="wet_proteinshake-useounces" name="wet_proteinshake-useounces" value="us" type="radio"'.($useounces ? ' checked="checked"' : '').' /></label></p>'; 
     61        echo '<p style="text-align:right;"><label for="wet_proteinshake-usegrams">' .  __('Metric units:', 'wet_proteinshake') . 
     62        ' <input style="width: 20px;" id="wet_proteinshake-usegrams" name="wet_proteinshake-useounces" value="metric" type="radio"'.(!$useounces ? ' checked="checked"' : '').' /></label></p>'; 
    6363        echo '<input type="hidden" id="wet_proteinshake-submit" name="wet_proteinshake-submit" value="1" />'; 
    6464    } 
     
    7979        $lbl_protein = __('Protein', 'wet_proteinshake'); 
    8080        $lbl_daily = __('Daily protein dose', 'wet_proteinshake'); 
    81         $dim = ($useounces ? 'oz' : 'g'); 
     81        $dim_ing = ($useounces ? 'oz' : 'g'); 
     82        $dim_liquid = ($useounces ? 'oz' : 'ml'); 
     83        $dim_weight = ($useounces ? 'lbs' : 'kg'); 
     84        $default_weight = ($useounces ? '180.0' : '90.0'); 
    8285 
    8386        // all calculation is done by the client, trying to compensate for common errors like mixing meters with centimeters. 
     
    9295                var precision = 0; 
    9396                var factor = 1; 
    94                 var dim = 'g'; 
     97                var factor_liquid = 1; 
     98 
    9599                var theform = document.getElementById('wet_proteinshake_form'); 
    96100                var protein = document.getElementById('wet_proteinshake_protein'); 
     
    103107                    if (use_ounces) { 
    104108                        precision = 2; 
    105                         factor = 28.349523125; 
     109                        factor = 28.349523125; // ounces to gram 
     110                        factor_liquid = 29.573529687517038 // ounces to ml 
     111                        w = w * 0.45359237; // lbs to kg 
    106112                    } 
    107113                    protein.innerHTML = (w * 0.4 / factor).toFixed(precision).replace(/\./, "{$point}"); 
    108114                    carbo.innerHTML = (w * 0.8  / factor).toFixed(precision).replace(/\./, "{$point}"); 
    109                     water.innerHTML = (w * 10.0).toFixed(precision).replace(/\./, "{$point}"); 
     115                    water.innerHTML = (w * 10.0 / factor_liquid).toFixed(precision).replace(/\./, "{$point}"); 
    110116                    daily.innerHTML = (w * 2.2 / factor).toFixed(precision).replace(/\./, "{$point}"); 
    111117                } else { 
     
    135141    <tr> 
    136142    <td><label for='wet_proteinshake_weight'>{$lbl_weight}</label></td> 
    137     <td><input id='wet_proteinshake_weight' type='text' name='wet_proteinshake_weight' value="90.0" size='5' />&nbsp;kg</td> 
     143    <td><input id='wet_proteinshake_weight' type='text' name='wet_proteinshake_weight' value="{$default_weight}" size='5' />&nbsp;{$dim_weight}</td> 
    138144    </tr> 
    139     <tr><td>{$lbl_protein}</td><td><strong id='wet_proteinshake_protein'>-</strong>&nbsp;{$dim}</td></tr> 
    140     <tr><td>{$lbl_carbo}</td><td><strong id='wet_proteinshake_carbo'>-</strong>&nbsp;{$dim}</td></tr> 
    141     <tr><td>{$lbl_water}</td><td><strong id='wet_proteinshake_water'>-</strong>&nbsp;ml</td></tr> 
    142     <tr><td>{$lbl_daily}</td><td><strong id='wet_proteinshake_daily'>-</strong>&nbsp;{$dim}</td></tr> 
     145    <tr><td>{$lbl_protein}</td><td><strong id='wet_proteinshake_protein'>-</strong>&nbsp;{$dim_ing}</td></tr> 
     146    <tr><td>{$lbl_carbo}</td><td><strong id='wet_proteinshake_carbo'>-</strong>&nbsp;{$dim_ing}</td></tr> 
     147    <tr><td>{$lbl_water}</td><td><strong id='wet_proteinshake_water'>-</strong>&nbsp;{$dim_liquid}</td></tr> 
     148    <tr><td>{$lbl_daily}</td><td><strong id='wet_proteinshake_daily'>-</strong>&nbsp;{$dim_ing}</td></tr> 
    143149    </table> 
    144150    <p><input type='submit' value='{$buttontext}' onclick='wet_proteinshake(); return false;' /></p> 
  • protein-shake-recipe-calculator/trunk/wet_proteinshake.pot

    r366794 r367285  
    3030msgstr "" 
    3131 
    32 msgid "Results in ounces:" 
     32msgid "US units:" 
    3333msgstr "" 
    3434 
    35 msgid "Results in grams:" 
     35msgid "Metric units:" 
    3636msgstr "" 
    3737 
Note: See TracChangeset for help on using the changeset viewer.