Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
sanity-translations-tab
Advanced tools
This is the base module for implementing common translation vendor tasks from a Studio, such as sending content to be translated in some specific languages, importing content back etc. Not useful on its own, but vendor-specific plugins will use this for i
This is the base module for implementing common translation vendor tasks from a Studio, such as sending content to be translated in some specific languages, importing content back etc. Not useful on its own, but vendor-specific plugins will use this for its chrome.
plugins
directory."sanity-translations-tab"
to the plugins
key of sanity.json
translatable
import S from '@sanity/desk-tool/structure-builder'
import {
TranslationsTab,
DummyAdapter,
} from '../../plugins/sanity-translations-tab/src'
export const getDefaultDocumentNode = ({ schemaType }) => {
if (schemaType === 'translatable') {
return S.document().views([
S.view.form(),
S.view
.component(TranslationsTab)
.title('Translations')
.options({
// Vendor-specific plugins will have their own adapter, use this for dev
adapter: DummyAdapter,
// These two async functions are expected by the plugin
exportForTranslation: async props => props,
importTranslation: async props => props,
/**
* If the translation vendor has different workflow options,
* such as machine translation or human, pass them here and
* they'll be displayed as Select menu options in the tab.
* If one or more options are included, there will automatically
* be a "Default" option that will submit the form with no
* additional parameters
*/
workflowOptions: [
{
workflowUid: '123',
workflowName: 'Machine Translation (testing)',
},
],
/**
* Optional sync or async function used on translation import to
* Sanity, if the locale codes used by the translation vendor don't
* match Sanity's. Receives the vendor locale ID and returns the
* corresponding Sanity ID.
*/
localeIdAdapter: translationVendorId => sanityId,
/**
* For field-level translations, the key for the "source content"
* (e.g. "en" or "en_US").
*/
baseLanguage: 'en_US',
}),
])
}
return S.document()
}
export default S.defaults()
To work on this module locally, run
npm start
To observe changes to the code, and at the same time run
npx parcel example/index.html
to run the component in a dev server
To develop this plugin as a separate repository (outside of your studio environment) and test it locally in a studio during development, you'll need:
TranslationsTab
(see implementation of Studio Plugin for Sanity & Smartling)TranslationsTab
from this local development version.Assuming you already have a studio, the following will get you up and running with a forked repo and symlink:
npm install
to install the plugin's dependencies.npm link
from this plugin's directory (eg, ~/code/sanity-translations-tab
) to create a global symlink to this local instance of the sanity-translations-tab
dependency.npm run build
to compile an initial version.npm link sanity-translations-tab
inside the directory of the studio you want to use the plugin in (eg, ~/code/my-studio
). This will tell the studio application to use the global symlink to this instance of the dependency.import { TranslationsTab } from 'sanity-translations-tab'
to deskStructure.js
in the studio. If previously importing TranslationsTab
from an adapter library such as sanity-plugin-smartling-studio
, remove that import statement.sanity start
to run the studio locally.npm run start
from the sanity-translations-tab
directory to start a watch task.FAQs
This is the base module for implementing common translation vendor tasks from a Studio, such as sending content to be translated in some specific languages, importing content back etc. Not useful on its own, but vendor-specific plugins will use this for i
The npm package sanity-translations-tab receives a total of 1,423 weekly downloads. As such, sanity-translations-tab popularity was classified as popular.
We found that sanity-translations-tab demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.