How to cook and plan meals when ingredients are not reliably available?
One of the things that we forget in the U.S. is that foods are seasonal -- if we didn't have food flown in from the southern hemisphere, we wouldn't have berries and most other fruits available year round.

Learning to cook based on what's available isn't something that's typically taught, but I'd recommend the following:


Learn different techniques, and what can be prepared with that given technique, so that you can more easily improvise.  You might consider reading Pam Anderson's How to Cook Without a Book: Recipes and Techniques Every Cook Should Know by Heart. (unfortunately, not available as a download, sorry.  And no, not that Pam Anderson, this one used to work for Cook's Illustrated), which goes over some basic things that can be easily varied using whatever's on hand.
Stock up on non-perishable stapes when they're available.  I wouldn't recommend clearing out a small store of all of their flour, but if you know they don't always have it, pick up some extra so you'll have some on hand when they don't.
Learn to make 'ingredients'.  There's a lot of stuff that we take for granted in the U.S. as being an ingredient, but are processed foods to some degree.  You mention bread and yogurt, but also pasta or stocks.  If you can't always find it, you might still be able to find the necessary stuff to make it.  (although, I admit, some of them require being prepared in advance)
Ask the natives.  The local recipes are going to be made to use the local ingredients, so if you're going to rely on recipes, use theirs.  You could also ask the local shopkeepers for advice on what to use and how to prepare it ... odds are, there are going to be produce that wasn't available wherever you used to live, so you're not considering some things when shopping.  There might be some good local alternative to carrots.  (eg, yams come to mind, and not what we get in the U.S. as yams, but African yams, which are firmer than sweet potatoes)


... as for the online resources ... well, the only one that comes to mind right off the top of my head is The Cook's Thesaurus aka. foodsubs.com, which offers substitutions when you can't find an ingredient, but unless you're going to either look in advance of shopping what all of the alternatives are, you're going to need a smartphone and data service wherever you're shopping ... it might be easier to just ask the shopkeeper what they'd use as an alternative, as they'd know what they have, rather than your trying to look for 5 different alternatives that aren't in stock, either.