![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@dfds-contentful/translation
Advanced tools
This package facilitates working with translations in Contentful
exportTranslations --space-id=<spaceId> --environment-id=<environment-id> --management-token=<management-token> --url-filter=<url pattern> --locale=<locale> --mode=<mode> --exact-url
The exportTranslations script is used for generating JSON from pages in Contentful (starting with a URL slug, and most commonly used on DotCom)
exportOneType --space-id=<spaceId> --environment-id=<environment-id> --management-token=management-token --type-id=<typeId> --team-id=<teamId> --locale=<locale> --mode=<mode>
The exportOneType script is used for generating JSON from entries of a specific type. If team-id
is specified, then only the entries with this team ID will be exported.
exportOneEntry --space-id=<spaceId> --environment-id=<environmentId> --management-token=management-token --entry-id=<entryId> --locale=<locale> --mode=<mode>
The exportOneEntry script is used for generating JSON from ONE Contentful entry (and everything below it). This is typically used for special cases and exceptions.
Export script arguments:
Parameter | Description | ||
---|---|---|---|
url-filter | The URL under which we want the content exported (required in the exportTranslations script only) | ||
exact-url (optional) | if specified, only content for this exact URL gets exported, otherwise ALL pages matching the pattern will be exported (exportTranslations script only) | ||
type-id | The id of the content type in Contentful whose entries we want exported (required for the exportOneType script) | ||
team-id (optional) | The ID of the TeamName entry in the ShortStrings space. If specified, only the entries with that teamID will be exported (exportOneType script) | ||
entry-id | The Contentful id of the entry to export (required for the exportOneEntry script) | ||
locale | locale to export for. For example da-DK , tr-TR (case doesn't matter). Additional supported locale aliases are listed below: | ||
all : all supported locales at DFDS | |||
all-b2b : locales used in Freight & Logistics | |||
all-pax : locales used in PAX | |||
all-app : locales used by the App team | |||
mode (optional) | determines how the export gets generated, see options below | Expected format coming back from the translation vendor | |
"all English" is the default mode, generating English content for everything under the URL. | translations for the English strings that were sent out | ||
missing : export only the strings that have no translations for that language. The result is English strings to be translated | translations for the English strings that were sent out | ||
existing : re-sends the strings that already have translations for them. This generates 2 files per language. The source English (for reference) and the existing translation for target language | corrections to existing translations | ||
space-id | The ID of the space in Contentful, usually pre-specified | ||
environment-id | The environment for that contentful space, usually export goes from master | ||
management-token | The access token for that Contentful space, usually pre-specified |
The importTranslations
script is used for importing translated JSON files into Contentful
The syntax for this script is as follows:
importTranslations --space-id=<spaceId> --environment-id=<environment-id> --management-token=management-token --filename=<filename_locale.json> [--overwrite] [--all-locales] [--all-folders]
Import script arguments:
Parameter | Description |
---|---|
filename | The filename containing translations. Specify the filename relative to package/translation/translationImport . The suffix of the file indicates which locale the translations are for, for example myfile_da-DK.json will be imported into the Danish locale, and myfile_tr-TR.json will be imported into the Turkish locale |
all-locales | import from files of all available locales. With this option, you should remove the <locale>.json postfix, leaving the name as --filename=myfile |
all-folders | import from files of subfolders, in all available locales. Note that the specified argument at --filename will be ignored, and all files in all subfolders of package/translation/translationImport will be imported |
overwrite (optional) | If false (default), any existing content in the locale being imported will be KEPT. If true, the content in the JSON file will supercede what's in Contentful |
space-id | The ID of the space in Contentful, usually pre-specified |
environment-id | The environment for the Contentful space into which we are importing, usually the import is into staging or sandbox for testing and verification, and master for going live |
management-token | The access token for that Contentful space, usually pre-specified |
Note: while you can export in different modes (all English / existing / missing), the importer doesn't have modes, everything we import is going to be either new translations or existing translations fixed up
FAQs
translation scripts
The npm package @dfds-contentful/translation receives a total of 14 weekly downloads. As such, @dfds-contentful/translation popularity was classified as not popular.
We found that @dfds-contentful/translation 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.