mirego / accent

The first developer-oriented translation tool. True asynchronous flow between translators and your team.
https://www.accent.reviews
BSD 3-Clause "New" or "Revised" License
1.3k stars 98 forks source link

custom language wrong slug and name in graphql api #298

Closed tuxes3 closed 2 years ago

tuxes3 commented 2 years ago

Hi,

I have a project with 3 languages: German (Main) de, German - Custom de_custom, French fr

As you see I renamed a language to fit my business case. (We need to be able to provide multiple accents per language, not only the default ones)

The Graphql api still returns the original language name and slug.

Prerequisites image

Query This query should give me all files and all languages present in the project.

query Translations($projectId: ID!) {
  viewer {
    project(id: $projectId) {
      documents {
        entries {
          id
          path
          format
        }
      }
      revisions {
        isMaster
        id
        language {
          slug
          name
          id
        }
      }
    }
  }
}

Excepted Result

...
          {
            "id": "~~some id~~",
            "isMaster": false,
            "language": {
              "id": "~~some id~~",
              "name": "German, Custom",
              "slug": "de_CUSTOM"
            }
          }
...

Actual Result

...
          {
            "id": "~~some id~~",
            "isMaster": false,
            "language": {
              "id": "~~some id~~",
              "name": "German, Switzerland",
              "slug": "de-CH"
            }
          },
...
simonprev commented 2 years ago

The overwrites are not propagated in the language. We have name and slug on the revision object 😄

tuxes3 commented 2 years ago

You are right. Thanks for helping!