Forums

RecipePress
How to delete the plural S in ingidients? (7 posts)

  1. ashchi
    Member
    Posted 1 year ago #

    Hi, I am considering the use of recipe press for my language. There is no difference in singular or plural counting in my language, and when I add some thing for ingridients which has more than two (like 2 onion, or 100 Gram etc), recipe press adds a S at the end and changes them to (2 onions, or 100 Grams). I know in english it is the way to write, but it realy is annoying to see them in my language. In a language, like arabic, there is no way to understand the added s at the end of any word!

    - How can I remove it from the codes?
    Or
    - how to prevent it from being exacuted at first polace.

    Regards

    http://wordpress.org/extend/plugins/recipe-press/

  2. Travers
    Member
    Posted 1 year ago #

    I have just spent the better part of this afternoon doing exactly this. My 'sizes' are in g, kg, etc and needed the exact same thing.

    There are two ways you can do this.

    1. Edit wp-content/plugins/recipe-press/includes/template_tags.php.

    Find the line with "/* Convert size to plural if more than one */" (approx line 366) and comment out the if statement (5 lines worth). This will make the size display as you have entered it in the size settings. Only down side to this, it will not then 'fix' pluralisation when size is something like "cup".

    2. Edit /wp-content/plugins/recipe-press/includes/inflector.php

    Add the terms you do not want to be pluralised into the array generated by "static function cacheUncountable()". You can also use the static function cacheIrregular() in a similar way.

    Option 2 means that you can still have pluralisation being used, but only on items that then make sense.

    Hope this helps. I know my recipes now make more sense.

    Cheers,
    Trav

  3. ashchi
    Member
    Posted 1 year ago #

    Hi Trav,

    And, a very big thank for you for solving this for me. I followed your 1st direction and now am happy to say that every thing works as I wanted.

    Regards

  4. curtismchale
    Member
    Posted 1 year ago #

    Remember that doing either option will get overwritten when the plugin is upgraded.

  5. ashchi
    Member
    Posted 1 year ago #

    Hi curtismchale,

    Will remember if new version is out.

    Regards

  6. Travers
    Member
    Posted 1 year ago #

    Yeah, I should be more diligent when writing my instructions - I tend to assume that if you want to hake code you would know that it gets overwritten when you upgrade plugins, themes, etc.

    I keep a top level folder outside public_html with copie of modified files (as my own backup) and also a "mods_log" text file which pretty much has instructions on what to look for for my changes and the actual change matching the version of plugin/theme...but that's the Architect/Engineer in me taking control of me ;-)

    Good luck all, and hopefully the great support for this wonderful app will continue after grandslambert moves on...

    Trav

  7. Devin Humbert
    Member
    Posted 1 year ago #

    We've added a setting for enabling/disabling pluralization and singularization of ingredients and serving sizes. It will be included in the next update (coming soon), but for now you can get it by checking out the plugin from SVN here:

    http://code.google.com/p/recipe-press/source/checkout

    Devin

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic