Custom Post-Import Processor FreeBeta
ByAwesome CrowdinVerified Author

This application allows you to process strings imported from your file with custom code.

Install

About

Copy link

This application allows you to process strings imported from the files you upload with your own JavaScript code. It can be useful if you want to edit strings or it's properties before starting the translation.

Coding

Copy link

JavaScript code is executed in a sandboxed environment with no access to I/O (file system, network) or external NPM modules.

This app will expose the following variables in the global environment:

  • strings - an array of objects containing all strings Crowdin identified as translatable. Please refer to the Developer Portal to learn more about the data structures.
  • fileName - the name of the uploaded file;
  • projectId - Crowdin project ID;
  • error - the error message you want to return. If set, the import will be aborted and the error message will be shown to the user;

Edit string properties inside the strings array to introduce changes you need.

Example application

Copy link
for(const string of strings) {
    string.text = string.text.replace('Product', 'SUPER!');
}

Screenshot

Copy link

Screenshot

Crowdin is a platform that helps you manage and translate content into different languages. Integrate Crowdin with your repo, CMS, or other systems. Source content is always up to date for your translators, and translated content is returned automatically.

Learn More
Categories
Development
File Formats
Works with
  • Crowdin Enterprise
  • crowdin.com
Details

Released on Sep 23, 2023

Updated on Jul 18, 2024

Published by Awesome Crowdin

Identifier:custom-post-import-processor