Devographics / StateOfJS-2019

State of JS 2019 survey report website
https://2019.stateofjs.com/
Other
143 stars 35 forks source link

Block translations not appearing #45

Closed marceloemanoel closed 4 years ago

marceloemanoel commented 4 years ago

Hey y'all,

First of all thanks for your awesome work! I'm translating the survey results to Brazilian Portuguese but the block translation isn't being presented on the page. I did a little investigation and found out that on the block_templates.yaml file the pageIntroductionTemplate is hardcoding the 'en-US' locale. Changing it to 'pt-BR' does show the translation but then I loose the original text.

pageIntroductionTemplate:
    blockType: PageIntroductionBlock
    dataPath: '${pageId}_introduction.html'
    query: >
        ${pageId}_introduction: markdownRemark(
            frontmatter: {
                type:   { eq: "introduction" }
                page:   { eq: "${pageId}" }
                locale: { eq: "en-US" }
            }
        ) {
            html
        }
SachaG commented 4 years ago

Oh good point. I guess we didn't consider how to handle translations within our sitemap templating system… It looks like it might be a little tricky to fix so I'll take a look later this week.

SachaG commented 4 years ago

OK it should work better now.