Your priv/ translations directory is maybe being compiled to a non-existent path when you load the local dependency from B, or not being compiled at all. Try Gettext.known_locales(A.Gettext) from B and if it returns [] then it can’t find your translations directory.
If you have any gettext config in a/config/*.exs then it is not available in B and you’ll have to set that config in b/config/*.exs as well.
I had a little time to test this out. If you are pulling in A as a local path dependency then your priv translations directory should be compiled along with the dependency into b/_build/dev/lib/a/priv/path_to_locales/. If it’s not there, then my theory is that you compiled your PO files in A (mix compile.gettext) after the last compilation of A as a dependency in B. Running mix do deps.clean a, deps.update a, deps.compile from the B directory should fix that, and then it all should work.
You probably need to use put_locale("de") rather than put_locale(A.Gettext, "de"), which will set the locale for all Gettext backends in the current process, rather than just the one from A: Gettext — gettext v0.19.1