silverstripe/silverstripe-translatable — pull request #51 by tractorcow (2012-09-13 02:28:47+00:00)
Title: FIXED: Issue with recent refactor of SiteConfig translation

This pull request fixes an issue noted at https://github.com/silverstripe/silverstripe-translatable/pull/44#issuecomment-8497926 where singleton(SiteConfig) could not be called if the user was not logged in.

The new code correctly respects the results of the canTranslate permission function, and will not attempt to translate the siteconfig if it returns false (instead of simply failing with a permission error).

Also, if a new siteconfig is created when the current translation already has a SiteConfig (such as when singleton(SiteConfig) is called) then the code will not try to translate, as it's likely not to be necessary, and I prefer to keep the code simple.

This update also involves a moderate refactor for the sake of clarity and cleaned up documentation.