Code Monkey home page Code Monkey logo

Comments (9)

birkir avatar birkir commented on July 23, 2024 3

I am probably going to include this in 0.3.0 in the form argument on each field.

query {
  Blog {
    title
    titleNL: title(locale:"nl")
    body(locale:"is")
  }
}

Would this work for you? To reduce bloat this could be configurable by schema or field.

from prime.

birkir avatar birkir commented on July 23, 2024 1

Well, I doubt we will replace it completely, but we may implement them somehow. Contentful does this very well, so I may end up model it after them

from prime.

birkir avatar birkir commented on July 23, 2024 1

Ok. But how is that different from what we already have?

query {
  Blog(locale:"nl") {
    title
    body
  }
}

I am starting to think that this ticket is more about UI rather than API, am I correct?

from prime.

stvnwrgs avatar stvnwrgs commented on July 23, 2024 1

GraphCMS is also doing this on field level:

 query page($id: ID, $locale: Locale) {
      page(where: { id: $id }) {
        updatedAt
        createdAt
        id
        title
        slug(locale: $locale)
     }
 }

@birkir do you still plan to implement this in 0.3?

from prime.

mpartipilo avatar mpartipilo commented on July 23, 2024

from prime.

agustif avatar agustif commented on July 23, 2024

I don't have a strong opinion on how Localization is implemented, but I'm glad to see it will be released on 0.3.0 or soon enough

Keep up the great work, thanks for open sourcing! 👍 💯

from prime.

mpartipilo avatar mpartipilo commented on July 23, 2024

The way Cockpit CMS does it is with a URL query parameter. If the parameter is not provided the localized fields get a locale suffix. So far this is the setup that has worked best for me.

from prime.

mpartipilo avatar mpartipilo commented on July 23, 2024

That would indeed work, of course. I brought up the other approach just in case it might give you more ideas.

My concern is more towards multilingual sites using gatsbyjs.

from prime.

stereobooster avatar stereobooster commented on July 23, 2024

My only question with translated documents - how do you connect two documents?

For example, we have city tour website. We have a list of cities and a list of places for each city). So titles/descriptions suppose to be translated, but geo-location, open/closing times, price range are all the same across the languages. What I do now is that I have same entities in DB, but translate fields.

from prime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.