All Projects → opentable → mercury

opentable / mercury

Licence: MIT license
Mercury is a bot for handling in-code static translations.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mercury

nx-extend
Nx Workspaces builders and tools
Stars: ✭ 67 (+272.22%)
Mutual labels:  translations
watora-translations
Files which contains Watora's answers in different languages
Stars: ✭ 16 (-11.11%)
Mutual labels:  translations
deepl-api-connector
Connector library for deepl.com rest translation api
Stars: ✭ 12 (-33.33%)
Mutual labels:  translations
website
The Algorithms website providing GitHub's largest open-source algorithm library.
Stars: ✭ 616 (+3322.22%)
Mutual labels:  translations
i18n-magento2
Translations for Magento 2 (Open Source, Commerce and B2B)
Stars: ✭ 22 (+22.22%)
Mutual labels:  translations
N-Gage stuff
Some N-Gage stuff for translation and modding
Stars: ✭ 21 (+16.67%)
Mutual labels:  translations
vocascan-frontend
A highly configurable vocabulary trainer
Stars: ✭ 26 (+44.44%)
Mutual labels:  translations
django-parler-rest
Translatable model support for django-rest-framework
Stars: ✭ 48 (+166.67%)
Mutual labels:  translations
contributor covenant
Pledge your respect and appreciation for contributors of all kinds to your open source project.
Stars: ✭ 1,534 (+8422.22%)
Mutual labels:  translations
LorittaLocales
🌎 Loritta's localization files, bringing Loritta's cuteness to everyone around the world!
Stars: ✭ 21 (+16.67%)
Mutual labels:  translations
deepl-php-lib
🧠 DeepL API Client Library supporting PHP >= 7.3
Stars: ✭ 50 (+177.78%)
Mutual labels:  translations
DoctrineTranslated
Translated strings for Doctrine
Stars: ✭ 12 (-33.33%)
Mutual labels:  translations
pH7-Internationalization
🎌 pH7CMS Internationalization (I18N) package 🙊 Get new languages for your pH7CMS website!
Stars: ✭ 17 (-5.56%)
Mutual labels:  translations
kepler
Consuming NASA API to visualize exoplanets data in a Flutter app
Stars: ✭ 33 (+83.33%)
Mutual labels:  translations
www.gafam.info
Sources of the gafam.info web page
Stars: ✭ 14 (-22.22%)
Mutual labels:  translations
lfs-book-i18n
Repository for LFS book translation (currently only Simplified Chinese).
Stars: ✭ 100 (+455.56%)
Mutual labels:  translations
Domino-English-Translation
🌏 Let's translate Domino, a Japanese MIDI editor!
Stars: ✭ 29 (+61.11%)
Mutual labels:  translations
findadoc-localization
Translations for Findadoc Japan
Stars: ✭ 17 (-5.56%)
Mutual labels:  translations
laravel-localized-routes
A convenient way to set up and use localized routes in a Laravel app.
Stars: ✭ 257 (+1327.78%)
Mutual labels:  translations
mini i18n
🌐 Minimalistic I18n library for Ruby
Stars: ✭ 93 (+416.67%)
Mutual labels:  translations


Mercury

Mercury is a bot for handling in-code static translations. Developed at OpenTable, it takes care of dozens of codebases by making automated Pull Requests to keep the code up to date with our translations.


How Mercury works

The bot looks for a mercury.json manifest file in a repository's root. It then locates the source files and keeps them updated with Smartling by using its API and making Pull Requests. Please refer to the Mercury consumer integration runbook and FAQ.

Mercury screenshot

How to setup the bot in your organization

Mercury is available as npm module and needs to be configured to run with github and smartling API tokens.

Here is a code example:

const mercury = require('mercury-bot');

const config = {
  github: {
    apiTokens: [
      { operation: 'read', value: 'token-1234567890' },
      { operation: 'write', value: 'token-0987654321' }
    ],
    owner: 'mercurybot',
    branch: 'mercury'
  },
  smartling: {
    userIdentifier: 'userId-1234567890',
    userSecret: 'userSecret-0987654321'
  },
  repositories: {
    'github-org': ['repo1', 'repo2']
  }
};

const app = mercury({ config });

// Optional event handlers
app.on('error', console.log);
app.on('action', console.log);
app.on('result', console.log);

// Run
app.run(() => process.exit(0));

API

Init mercury({ config })

config is an object that requires the following structure:

name type mandatory description
github object yes Github config
github.apiTokens object yes Github API Tokens. You need at least one read token and one write token
github.apiTokens[index].operation string yes Can be either read or write
github.apiTokens[index].value string yes The token
github.owner string yes The github user associated with the token
github.branch string yes The branch that the bot will use to make Pull Requests on his fork
repositories object yes The repositories mercury needs to watch and manage
repositories[index] array of strings yes The github org that contains the repos to watch
repositories[index][item] string yes The github repo to watch
smartling object yes The smartling config
smartling.userIdentifier string yes The smartling UserId
smartling.userSecret string yes The smartling UserSecret
mercury.on(eventName, payload)

Event handler for connecting to a logger. The following events are emitted:

name payload object props description
action { message} The message contains a description of the performed action
error { error, errorType, details } The error is a javascript Error object containing the whole stacktrace. The errorType is a string identifier for the error, and the details contains all the state of the performed actions for the current repository for further investigation
result { message, resultType } The message contains a description of the performed action, the resultType is an identifier for the current action

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].