Skip to content

Instantly share code, notes, and snippets.

View simoneeconomo's full-sized avatar

Simone Economo simoneeconomo

View GitHub Profile
@simoneeconomo
simoneeconomo / devnotes3.markdown
Created November 12, 2011 09:03
Developer Notes #3

Symphony 2.3 comes with a new localisation system that allows translators to provide different translations for the same string, according to the given context.

Symphony contexts

But, what's a context? A Symphony context is a string that tells you which backend page you are currently browsing. The syntax is path-like, so if we're inside the Datasources main page, the context is /blueprints/datasources, while if we are editing an entry it's /publish. It that sounds familiar to you, it's because the syntax is consistent with delegate subscription, and should be after all.

As you can see, guessing the context it's pretty straightforward. Say you are editing an event, what would the context be? Inspired by the last example, I hear you saying "it's /blueprints/events". You couldn't be more right! What if you are inside the login page? Well, this one is a bit trickier, but still intuitive: it's /login. Easy no?

Please note that subpages are not considered as different contexts: in fact, a context is