<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pedro Brandão on Medium]]></title>
        <description><![CDATA[Stories by Pedro Brandão on Medium]]></description>
        <link>https://medium.com/@pedrobrandao?source=rss-9743cdbc0290------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*roWatnOSiy2au5P4I9aPPw.jpeg</url>
            <title>Stories by Pedro Brandão on Medium</title>
            <link>https://medium.com/@pedrobrandao?source=rss-9743cdbc0290------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 10:41:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pedrobrandao/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[On creating synergies]]></title>
            <link>https://medium.com/significa/on-creating-synergies-60cce7486296?source=rss-9743cdbc0290------2</link>
            <guid isPermaLink="false">https://medium.com/p/60cce7486296</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[strategy]]></category>
            <dc:creator><![CDATA[Pedro Brandão]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 00:01:01 GMT</pubDate>
            <atom:updated>2019-05-21T21:16:11.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfUf1dp5CG87oTka5bOhAw.png" /></figure><p><a href="https://significa.co/">Significa</a> is a design-led company that takes on product creation from concept to launch. Sounds simple, but behind the scenes there’s more to it: we currently share office space with 2 other companies and our work and culture is tightly shared between all.</p><p>Significa started out as a design studio and that‘s something that we mean to keep deeply melted into our DNA. We’re all designers and we all think like designers (even our developers and office manager come from a design background).</p><p>At a certain point of our early life as a company, about 2 years ago, we were struggling to deal with wider scoped projects. Our development man-power was frankly limited and our outsourcing efforts were falling short with communication issues and the fruition ending miles away from expectation.</p><p>It was frustrating doing our best and witnessing the ever-growing quality of our work being questioned by some not-as-good-as-possible implementation. It lacked the polishing and the level of perfection we were working hard to achieve.</p><p>Enter <a href="https://coletiv.com/">Coletiv</a>. They are a new tech company that approached us and we both saw an opportunity to create something special without compromising our identity.</p><p>Coletiv’s vision aligns perfectly with ours: to deliver quality driven products. <br>The first project we took together ran perfectly fine. Their developers are not only excellent coders but they actually fit like a glove within our culture. <br>Even though they are hardcore technical people with no design background, we all get along pretty well as we understand the value in each other.</p><p>By bringing everyone together in the same physical space we bring new perspectives to the table, create dialogue between different thought processes allowing us to keep things fresh. There’s also undeniable value in having close contact and merging teams together to fulfil the shared goals of a project, allowing us all to push the limits but, at the same time, adapt and pivot quickly around limitations.</p><p>By keeping things separate, we allow each other to keep focus on what we do best. It allows us all to become the best on what we love to do instead of trying to absorb every know-how into a single entity that wouldn’t correctly represent who we are. It allows everyone to grow at their own pace and to their own vision while keeping all the advantages of having no gap between design and development, the ability to share processes and, together, an overall amazing capability of being able to take on any kind of project — no matter how challenging it is.</p><p>More than two years went by and things are going smoothly. Even though we share office space, project management, Christmas dinners and company retreats we like to keep things separate. We don’t want to take on development-only projects and Coletiv doesn’t want to take on design-only projects. We’re working on almost every project together and we’re learning a lot from each other. We’re even closing the gap further on Product Development with <a href="https://adamantsec.com/">Adamant</a>: a third company specialised in cyber-security.</p><p>Let’s see what the future holds.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuyGY2NfYpeE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuyGY2NfYpeE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuyGY2NfYpeE%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf117d26987ce8c3b303377c7bccc76c/href">https://medium.com/media/cf117d26987ce8c3b303377c7bccc76c/href</a></iframe><p>Pedro <em>el patron</em> Brandão is the founder and CEO at Significa.<br>Pedro’s playlist is made entirely of songs no one has ever listened to.<br>Got a project? <a href="https://significa.pt/enquiry/">Tell us about it</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60cce7486296" width="1" height="1" alt=""><hr><p><a href="https://medium.com/significa/on-creating-synergies-60cce7486296">On creating synergies</a> was originally published in <a href="https://medium.com/significa">Significa Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[i18n with Gatsby]]></title>
            <link>https://medium.com/significa/i18n-with-gatsby-528607b4da81?source=rss-9743cdbc0290------2</link>
            <guid isPermaLink="false">https://medium.com/p/528607b4da81</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <category><![CDATA[i18n]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Pedro Brandão]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 10:05:54 GMT</pubDate>
            <atom:updated>2018-07-02T10:05:54.026Z</atom:updated>
            <content:encoded><![CDATA[<p>Taking advantage of Gatsby nodes to add internationalisation to a Gatsby project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pPgIZmFPC3UsgXJVz4R0gw.png" /></figure><p>Nowadays, the world is our audience. When building a global product for multiple markets, Internationalisation is essential and must be catered from the get-go. English might be a safe bet for most, but there’s undeniable power in serving people content in their native language.</p><p>Coming from a Middleman background we honestly were a bit puzzled on how scattered i18n support with Gatsby was: There are some issues at Github, <a href="https://github.com/angeloocana/gatsby-plugin-i18n">a plugin</a> that <a href="https://github.com/angeloocana/gatsby-plugin-i18n/issues/12">requires us to duplicate code</a> and a <a href="https://www.gatsbyjs.org/blog/2017-10-17-building-i18n-with-gatsby/">semi-official blog post</a> with an approach that <strong>doesn’t statically render the strings into the html</strong>, which IMHO defeats the purpose of using a Static Site Generator. When you build, you’ll just get empty strings that get populated when the JS kicks in. Overall, adding i18n just wasn’t as smooth as it should be.</p><p>This quick article gives an alternate approach to i18n with Gatsby for those of us who need all the content to be statically rendered. It also provides two examples on how to use it: one with no external dependencies (except for gatsby source and transformer plugins) and one with <a href="https://github.com/yahoo/react-intl">React-Intl</a>.</p><h3>Creating pages for each locale</h3><p>There’s one fundamental step to achieve static rendering: <strong>duplicating each page for each locale.</strong></p><p><em>In this example, we’ll assume that the default language doesn’t require language in the path (i.e. If we have English (default) and Portuguese, we’ll need </em><em>/about and </em><em>/pt/about).</em></p><p>It’s always a good idea to centralize the locales definition, so create a locales file somewhere:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/400b6fd2ea2a4f4844b4789230cea238/href">https://medium.com/media/400b6fd2ea2a4f4844b4789230cea238/href</a></iframe><p>Then, in gatsby-node.js let’s create a page for each locale:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00a82ff74fc5073fed80a7e608a4df60/href">https://medium.com/media/00a82ff74fc5073fed80a7e608a4df60/href</a></iframe><p>For each page, we’re basically just deleting it (so we can take over) and creating it again for each language <strong>passing the locale to the page context</strong>.</p><p>Now, if you go to http://localhost:8000/___graphql and query the site’s pages you’ll see a duplicate for each locale:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*77k53Bmst1c93Mj5Z3eHTw.png" /></figure><p>Honestly, that’s pretty much it. Now you can use the pageContext ‘s locale in any way you like. 🎉</p><h3>Example A — with <a href="https://github.com/yahoo/react-intl">React-Intl</a></h3><p>React-Intl is a very powerful i18n package with cool helpers for date relatives, currencies and whatnot. It’s my go-to package for internationalisation so this example will make use of it.</p><p>Each page will receive the pageContext object. The main idea is to get the locale from that object and pass it to a Layout component that takes care of creating and feeding the Provider.</p><p>First, create some string files. In my case they’ll be src/i18n/en.json</p><pre>{<br>  &quot;hello&quot;: &quot;Hello world&quot;<br>}</pre><p>and src/i18n/pt.json</p><pre>{<br>  &quot;hello&quot;: &quot;Olá mundo&quot;<br>}</pre><p>Finally, the Layout Component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68be974b2c87a8c3815e43abc84dce8c/href">https://medium.com/media/68be974b2c87a8c3815e43abc84dce8c/href</a></iframe><p>All that’s left is to simply use it in the pages:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2761f3d90b43f1243d7e006a634ed305/href">https://medium.com/media/2761f3d90b43f1243d7e006a634ed305/href</a></iframe><h4>What about links?</h4><p>Sure, if we use Gatsby’s Link as-is, we’ll have some trouble navigating between pages. As the URL is our source-of-truth for the locale, if we simply link some page to /about we’ll always be directed to the English about.</p><p>We need to make a wrapper around Link, so we can still use &lt;Link to=&quot;/about&quot;&gt; as usual, without worrying about the current locale.</p><p>Luckily, React-Intl has a very convenient injectIntl HOC that provides us with the intl object (that, unsurprisingly, contains a locale key).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08509545f373bf7e2f60314a1bcde999/href">https://medium.com/media/08509545f373bf7e2f60314a1bcde999/href</a></iframe><h3>Example B— with no external dependencies</h3><p>Sometimes you don’t need React-Intl’s power (or don’t want to add yet another dependency bloating the project).</p><p>The bare and simplest way to load some strings would be something like</p><pre>import React from &#39;react&#39;</pre><pre>import enMessages from &#39;../data/index/en.json&#39;<br>import ptMessages from &#39;../data/index/pt.json&#39;</pre><pre>const messages = {<br>  en: enMessages,<br>  pt: ptMessages<br>}</pre><pre>const IndexPage = ({ pathContext: { locale } }) =&gt; (<br>  &lt;div&gt;<br>    &lt;h1&gt;{messages[locale].hello}&lt;/h1&gt;<br>  &lt;/div&gt;<br>)</pre><pre>export default IndexPage</pre><p>But in this example we’ll use Gatsby’s data layer to query the content with <em>graphql</em>.</p><blockquote>Unfortunately, and even though I’m using Gatsby V2 in these examples, it appears that the new StaticQuery component <a href="https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/static-query.md#how-it-differs-from-page-query">doesn’t support query variables</a>, so there’s a big drawback with this approach: <strong>You’ll have to query everything in the pages and pass it down to components</strong>.</blockquote><p>Let’s assume we have a folder at src/data. There, we’ll organize the content per folder with JSON files inside (e.g. src/data/index/en.json).</p><p>First thing we need to do is to add two gatsby dependencies:</p><ul><li><a href="https://www.npmjs.com/package/gatsby-source-filesystem">gatsby-source-filesystem</a> to query files</li><li><a href="https://www.npmjs.com/package/gatsby-transformer-json">gatsby-transformer-json</a> to get the JSON’s content</li></ul><pre>yarn add gatsby-source-filesystem gatsby-transformer-json</pre><p>and add them to your plugin configuration in gatsby-config.js</p><pre>plugins: [<br>  // your plugins<br>  &#39;gatsby-transformer-json&#39;,<br>  {<br>    resolve: `gatsby-source-filesystem`,<br>    options: {<br>      name: `data`,<br>      path: `${__dirname}/src/data/`<br>    }<br>  }<br>]</pre><p>Page’s context data is also available as query variables, so just use that to filter graphql’s results on the page query:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19d65bb048347de89d093a5eb1ed9fc9/href">https://medium.com/media/19d65bb048347de89d093a5eb1ed9fc9/href</a></iframe><p>Now that we’re using Gatsby’s data layer, we can even take advantage of its powerful transformation features. We can, for instance, load different images per-language and still be able to use <a href="https://www.npmjs.com/package/gatsby-image">gatsby-image</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7622edc215894a836ae1ef37bdddb6ac/href">https://medium.com/media/7622edc215894a836ae1ef37bdddb6ac/href</a></iframe><p>You can also create a Layout component that accepts the locale (same as above) but then creates a React Context and exports its Consumer. Implementing a LocalizedLink with that would be trivial. Take a look at the repo in the end of the article for an example.</p><h3>Conclusion</h3><p>Even though Gatsby doesn’t support i18n out-of-the-box, its powerful lifecycle APIs make it really easy to implement it (in less than 5 minutes).</p><p>All the examples here were quickly built for the purpose of the article and should be adapted to your project’s reality. Understanding Gatsby’s nodes and the process of duplicating pages for each locale is, after all, the fundamental of this approach.</p><p>Take a look at the repo with examples built using both approaches:<br><a href="https://github.com/pbrandone/gatsby-i18n">https://github.com/pbrandone/gatsby-i18n</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=528607b4da81" width="1" height="1" alt=""><hr><p><a href="https://medium.com/significa/i18n-with-gatsby-528607b4da81">i18n with Gatsby</a> was originally published in <a href="https://medium.com/significa">Significa Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>