It seems to work too with \AtBeginEnvironment{tikzpicture}{\shorthandoff{;}} (command form etoolbox package) So one can hack the environment globally and not every single environment.
–
TobiDec 7 '12 at 22:53

@Tobi What's the difference between 'globally' and 'every single environment'?
–
marczellmJan 20 '13 at 22:23

2

Note that this won't work in beamer unless the fragile option is given to the frame since in beamer the frames are read in before processing and catcodes are frozen at that time.
–
Loop SpaceApr 22 '13 at 14:28

As with the question that Claudio links to, the problem is in some extra code that TikZ loads which doesn't have the same amount of checking for active characters as the main TikZ parser does. As Babel doesn't change the catcode of ; until the start of the document all of the semicolons involved in the declare function routine are inactive and thus don't match the active semicolon in the declaration of the function. Also as in that question, one solution is as Jake says: to switch off the activeness of ; in a tikzpicture. Another is to hack the code to make it robust with respect to the catcode of the semicolon:

TikZ 3.0 introduced a new babel tikzlibrary to solve these kind of problems.

A tiny library that make the interaction with the babel package
easier. Despite the name, it may also be useful in other contexts,
namely whenever the catcodes of important symbols are changed
globally. Normally, using this library is always a good idea; it is
not always loaded by default since in some rare cases it may break old
code.