All Projects → fkirc → Attranslate

fkirc / Attranslate

Licence: mit
Semi-automated Text Translator for Websites and Apps

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Attranslate

I18N-Portable
Simple and cross platform internationalization/translations for Xamarin and .NET
Stars: ✭ 102 (-42.7%)
Mutual labels:  translations, internationalization, localization
Flutter translate
Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.
Stars: ✭ 245 (+37.64%)
Mutual labels:  localization, internationalization, translations
Django Translations
Django model translation for perfectionists with deadlines.
Stars: ✭ 109 (-38.76%)
Mutual labels:  localization, internationalization, translations
Mojito
An automation platform that enables continuous localization.
Stars: ✭ 256 (+43.82%)
Mutual labels:  localization, internationalization, translations
Locale2
💪 Try as hard as possible to detect the client's language tag ("locale") in node or the browser. Browserify and Webpack friendly!
Stars: ✭ 65 (-63.48%)
Mutual labels:  localization, internationalization
Formatjs
The monorepo home to all of the FormatJS related libraries, most notably react-intl.
Stars: ✭ 12,869 (+7129.78%)
Mutual labels:  localization, internationalization
React Translated
A dead simple way to add complex translations (i18n) in a React (DOM/Native) project 🌎🌍🌏
Stars: ✭ 176 (-1.12%)
Mutual labels:  localization, internationalization
Eslint Plugin I18n Json
Fully extendable eslint plugin for JSON i18n translation files.
Stars: ✭ 101 (-43.26%)
Mutual labels:  internationalization, translations
Goloc
A flexible tool for application localization using Google Sheets.
Stars: ✭ 42 (-76.4%)
Mutual labels:  localization, internationalization
Gatsby Starter Prismic I18n
Based on gatsby-starter-prismic with Internationalization (i18n) support
Stars: ✭ 77 (-56.74%)
Mutual labels:  localization, internationalization
Arbify
ARB files localization tool. Dedicated to Flutter and its intl package.
Stars: ✭ 168 (-5.62%)
Mutual labels:  localization, internationalization
Redux React I18n
An i18n solution for React/Redux and React Native projects
Stars: ✭ 64 (-64.04%)
Mutual labels:  localization, internationalization
React Intl Hooks
React hooks for internationalization without the hassle ⚛️🌍
Stars: ✭ 64 (-64.04%)
Mutual labels:  localization, internationalization
Angular I18next
angular v2.0+ integration with i18next v8.4+
Stars: ✭ 69 (-61.24%)
Mutual labels:  localization, internationalization
Preferred Languages
Choose languages for displaying WordPress in, in order of preference.
Stars: ✭ 48 (-73.03%)
Mutual labels:  localization, internationalization
Keys Translations Manager
KTM, a locale management web app built on MERN stack, lets you manage and control locales in one place. It's particularly useful for someone who needs to manage multiple internationalization/localization projects.
Stars: ✭ 81 (-54.49%)
Mutual labels:  localization, internationalization
Traduora
Ever® Traduora - Open-Source Translation Management Platform
Stars: ✭ 1,580 (+787.64%)
Mutual labels:  localization, internationalization
Phabricator zh hans
Phabricator zh-Hans Translation & Tools.
Stars: ✭ 113 (-36.52%)
Mutual labels:  localization, internationalization
Jquery.ime
jQuery based input methods library
Stars: ✭ 145 (-18.54%)
Mutual labels:  localization, internationalization
Fluent
Fluent — planning, spec and documentation
Stars: ✭ 818 (+359.55%)
Mutual labels:  localization, internationalization

attranslate - Semi-automated Text Translator for Websites and Apps

macOS/Ubuntu/Windows: Actions Status

attranslate is a semi-automated tool for "synchronizing" translation-files. attranslate is optimized for fast and smooth rollouts in hectic project environments, even if you already have many translations. Optionally, attranslate works with automated translation-services. For example, let's say that a translation-service achieves 80% correct translations. Thanks to attranslate, a quick fix of the remaining 20% may be faster than doing everything by hand. Other than that, attranslate supports purely manual translations and even file-format-conversions without changing the language.

Why attranslate?

In contrast to paid services, a single developer can integrate attranslate in a matter of minutes. In contrast to many other tools, attranslate can operate on the very same translations-files that you are already using. This is possible because attranslate operates on your file in a surgical way, with as little changes as possible. See tools comparison for an overview about translation-tools.

Features

Cross-platform Support

attranslate is designed to translate any website or app with any toolchain. attranslate works for i18n/JavaScript-frameworks/Android/iOS/Flutter/Ruby/Jekyll/Symfony/Django/WordPress and many other platforms. To make this possible, attranslate supports the following file formats:

  • Flat or nested JSON
  • Flat or nested YAML
  • PO/POT-files
  • Android-XML or any other XMLs with text-contents
  • iOS-Strings
  • Flutter-ARB
  • CSV (e.g. for Google Docs or Microsoft Excel)

Preserve Manual Translations

attranslate recognizes that automated translations are not perfect. Therefore, whenever you are unhappy with the produced results, attranslate allows you to simply overwrite texts in your target-files. attranslate will never ever overwrite a manual correction in subsequent runs.

Optionally Overwrite Outdated Translations

attranslate is capable of detecting outdated translations. Normally, overwriting outdated translations helps to ensure the freshness of translations. However, in hectic project environments, it might be easier to leave outdated translations as-is. Therefore, attranslate leaves outdated translations as-is unless you explicitly configure it to overwrite them.

Available Services

attranslate supports the following translation-services:

  • manual: Translate texts manually by entering them into attranslate.
  • Google Cloud Translate
  • sync-without-translate: Does not change the language. This can be useful for converting between file formats, or for maintaining region-specific differences.

High Performance

If some texts have already been translated, then attranslate won't translate them again. This does not only speedup your workflow, but also saves cost for paid translation-services.

Detect Common Mistakes

Although (some) humans have excellent translation-skills, humans are notoriously bad at detecting "trivial" mistakes like outdated, missing, stale or duplicate translations. In contrast, attranslate detects such "trivial" mistakes with 100% reliability.

Usage Examples

Translating a single file is as simple as the following line:

attranslate --srcFile=json-simple/en.json --srcLng=en --srcFormat=nested-json --targetFile=json-simple/de.json --targetLng=de --targetFormat=nested-json --service=manual

If you have multiple target-languages, then you will need multiple calls to attranslate. You can write something like the following script to avoid unnecessary duplication:

# This example translates an english JSON-file into spanish, chinese and german. It uses Google Cloud Translate.
BASE_DIR="json-advanced"
SERVICE_ACCOUNT_KEY="gcloud/gcloud_service_account.json"
COMMON_ARGS=( "--srcLng=en" "--srcFormat=nested-json" "--targetFormat=nested-json" "--service=google-translate" "--serviceConfig=$SERVICE_ACCOUNT_KEY" "--cacheDir=$BASE_DIR" "--matcher=i18next" )

# Run "npm install --global attranslate" before you try this example.

# Use "--overwriteOutdated=false" if you introduce attranslate into a hectic project-environment,
# or if you expect that some project collaborators won't even use attranslate because they have no time for "learning" it.
attranslate --overwriteOutdated=false --srcFile=$BASE_DIR/en/fruits.json --targetFile=$BASE_DIR/es/fruits.json --targetLng=es "${COMMON_ARGS[@]}"

# Use "--overwriteOutdated=true" if you want to prevent outdated translations.
attranslate --overwriteOutdated=true --srcFile=$BASE_DIR/en/fruits.json --targetFile=$BASE_DIR/zh/fruits.json --targetLng=zh "${COMMON_ARGS[@]}"

# Use "--overwriteOutdated=true" if you have no clue about the target-language and no capacity for manual reviews.
attranslate --overwriteOutdated=true --srcFile=$BASE_DIR/en/fruits.json --targetFile=$BASE_DIR/de/fruits.json --targetLng=de "${COMMON_ARGS[@]}"

Similarly, you can use attranslate to convert between file-formats. See sample scripts for more examples.

Usage Options

Run attranslate --help to see a list of available options:

Usage: attranslate [options]

Options:
  --srcFile <sourceFile>              The source file to be translated
  --srcLng <sourceLanguage>           A language code for the source language
  --srcFormat <sourceFileFormat>      One of "flat-json", "nested-json",
                                      "yaml", "po", "xml", "ios-strings",
                                      "arb", "csv"
  --targetFile <targetFile>           The target file for the translations
  --targetLng <targetLanguage>        A language code for the target language
  --targetFormat <targetFileFormat>   One of "flat-json", "nested-json",
                                      "yaml", "po", "xml", "ios-strings",
                                      "arb", "csv"
  --service <translationService>      One of "manual",
                                      "sync-without-translate",
                                      "google-translate"
  --serviceConfig <serviceKey>        supply configuration for a translation
                                      service (either a path to a key-file or
                                      an API-key)
  --cacheDir <cacheDir>               The directory where a translation-cache
                                      is expected to be found (default: ".")
  --matcher <matcher>                 One of "none", "icu", "i18next",
                                      "sprintf" (default: "none")
  --overwriteOutdated <true | false>  If true, overwrite outdated translations
                                      in subsequent runs (default: "false")
  --keySearch <regExp>                A regular expression to replace
                                      translation-keys (can be used for
                                      file-format conversions) (default: "x")
  --keyReplace <string>               The replacement for occurrences of
                                      keySearch (default: "x")
  -v, --version                       output the version number
  -h, --help                          display help for command

Integration Guide

Firstly, ensure that nodejs is installed on your machine. Once you have nodejs, you can install attranslate via:

npm install --global attranslate

Alternatively, if you are a JavaScript-developer, then you should install attranslate via:

npm install --save-dev attranslate

Next, you should write a project-specific script that invokes attranslate for your specific files. See sample scripts for guidance on how to translate your project-specific files.

Service Configuration

If you use attranslate with an automated translation-service, then you need to configure an API-key. API-keys can be obtained for free, but you might need to register an account. See service config for guidance on how to obtain API-keys for specific services.

Once you have an API-key, pass your API-key to attranslate via the --serviceConfig flag.

Interpolations and Matchers

⚠️ For many projects, attranslate works out of the box without configuring any matchers. Therefore, we recommend skipping this section unless you encounter unexpected problems that are hard to fix manually.

Many websites/apps use interpolations to insert dynamic values into translations. For example, an interpolation like Your name is {{name}} might be replaced with Your name is Felix.

To help with interpolations, attranslate provides so-called matchers. A matcher replaces interpolations with placeholders before they are sent to a translation service. attranslate offers the following matchers for different styles of interpolations:

  • ICU: Matches ICU interpolations like {name}.
  • i18n: Matches i18next interpolations like {{name}}.
  • sprintf: Matches sprintf-style interpolations like %s.
  • None: Doesn't match any interpolations.

You can select a matcher with the --matcher option.

Translation Cache

⚠️ If --overwriteOutdated is set to false, then attranslate does not generate any translation-cache.

The purpose of the translation-cache is to detect outdated translations, such that outdated translations can be overwritten in subsequent runs. The translation-cache consists of attranslate-cache-*-files. It is allowed to delete a translation-cache at any time. However, to make it work smoothly, you should put your attranslate-cache-*-files under version control.

Continuous Integration

To detect common mistakes like missing translations, it is advisable to run attranslate via continuous integration (CI). For example, the command git diff --exit-code can be used to trigger a CI failure whenever a file has been modified by attranslate.

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].