Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the base language doesn't have __i18n_lang and __i18n_refs #78

Closed
kimvuVarner opened this issue Sep 24, 2021 · 4 comments
Closed

the base language doesn't have __i18n_lang and __i18n_refs #78

kimvuVarner opened this issue Sep 24, 2021 · 4 comments

Comments

@kimvuVarner
Copy link

kimvuVarner commented Sep 24, 2021

Hi, I'm struggeling to create a english document with norwegian and swedish translation. The english is the base but doesnt have the lang and ref attributes.

this could be related to this issue: sanity-io/sanity-plugin-content-calendar#20 which happened after installing sanity-io/sanity-plugin-content-calendar. It may have interfered with the functionality of this plugin. Reading on some issues here, it seems to be related to custom publish action (ref comment: #60 (comment)) which i think the sanity-io/sanity-plugin-content-calendar creates

querying: *[_id match "b4d654f7-2b47-4339-9a92-d9ad5d111b43"] gives:

image
where the first document should've had the __i18n_lang and __i18n_refs attributes

and my configfile intl-input.json looks like this:
{
"idStructure": "subpath",
"referenceBehavior": "hard",
"languages": [
{ "name": "en", "title": "English (UK)" },
{ "name": "no", "title": "Norwegian" },
{ "name": "se", "title": "Swedish" }
]
}

@kimvuVarner kimvuVarner changed the title the master language doesn't have __i18n_lang and __i18n_refs the base language doesn't have __i18n_lang and __i18n_refs Sep 24, 2021
@LiamMartens
Copy link
Owner

LiamMartens commented Sep 24, 2021

Yea it's probably also related to #60
It's hard when you have multiple custom publish actions -- I did publish a beta version yesterday which exposes a utility to handle the same functionality of the intl plugin for your own custom publish actions; perhaps that could help? (you'll need 5.3.0-beta.1)

This would mean having to implement your own custom publish action which handles the combined functionality of the calendar plugin and this one.

Read:
https://github.com/LiamMartens/sanity-plugin-intl-input/blob/develop/docs/usage-with-custom-publish.md

@kimvuVarner
Copy link
Author

kimvuVarner commented Sep 24, 2021

Another thing: in sanity-io/sanity-plugin-content-calendar#20 the delete and duplicate actions from this plugin gets overwritten by sanity-plugin-content-calendar. Is it possible to have them back as well? are they also exposed as utilities too? @LiamMartens

UPDATE: tried to use import DeleteWithi18nAction from 'sanity-plugin-intl-input/lib/actions/DeleteWithi18nAction'; but got Module not found: Error: Can't resolve 'sanity-plugin-intl-input/lib/actions/DuplicateWithi18nAction'

@LiamMartens
Copy link
Owner

@kimvuVarner I have published a new beta version which exports those actions as well;

import {
  PublishWithi18nAction,
  DeleteWithi18nAction,
  DuplicateWithi18nAction
} from 'sanity-plugin-intl-input/lib/actions';

@kimvuVarner
Copy link
Author

Sweet!, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants