GithubHelp home page GithubHelp logo

resamsel / translatr Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 16.07 MB

I18n Translation Management

Home Page: https://translatr.repanzar.com

License: GNU General Public License v3.0

Java 36.76% HTML 6.74% Scala 0.51% Shell 0.50% CSS 0.01% JavaScript 0.51% Python 1.25% Dockerfile 0.02% Makefile 0.09% TypeScript 51.17% SCSS 2.45% Batchfile 0.01% Procfile 0.01%
translation manage-translations cli i18n java-properties play-framework gettext

translatr's Introduction

Translatr

Build Status Coverage Status PRs Welcome

A modern and intuitive i18n tool. Translatr simplifies i18n for developers and translators. It uses the Play Framework to translate other projects. Importing conf/messages.locale (Play Framework), src/main/resources/messages_locale.properties (Java properties), and i18n/locale/main.po (Gettext) files allows easy locale management.

Demo

Dashboard Example

Speeds up development

Preview, quick switching between locales, and the possibility of build system integration allows faster development.

Language Editor

User experience focused

Using the application should feel as comfortable as possible because of focusing on both main use cases - development and translation.

Project Example

Easy to work with

All elements - search, content creation, ... - follow the concepts of Material Design to allow the easiest and most intuitive usage possible.

User Settings

Command Line Interface

The Command Line Interface allows managing translations through the command line. Operations can be used in build scripts to automatically retrieve the latest translations.

Installation

Paste this at a terminal prompt:

curl -fsSL https://raw.githubusercontent.com/resamsel/translatr/main/install.sh | bash

Usage

To use Translatr CLI we need a .translatr.yml config file. Create one in any directory that you want to enable the CLI. The Translatr CLI will then use that file as configuration.

Creating a config file is easy with version 3. On the project page, scroll down to the CLI Integration card. You'll find a sample file, along with the option of choosing the file type and the access token.

CLI Integration Card

Pushing

By pushing you send the matching messages files to the given endpoint, creating locales if needed.

translatr push

This will overwrite all existing messages, if any. No existing keys/locales will be removed, this is not a sync operation.

Pulling

By pulling you download all locales into separate files into the configured files (translatr.pull.target key).

translatr pull

This will overwrite any existing files locally. All known locales will be downloaded.

Development and Contributing

Information about contributing to this project can be found on the CONTRIBUTING page.

Resources

SVG Icons from: https://www.svgrepo.com/collection/soft-colored-ui-icons/

translatr's People

Contributors

renepanzar avatar resamsel avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

steflen

translatr's Issues

Allow using the API without access_token

The API should be allowed to use if the session is OK, without giving an access_token. This would allow the GUI to use API methods, instead of copies from that methods in the Application space.

Add install instructions for translatr.py

Instructions need to be put on a separate page.

Installation

Install it like Homebrew (http://brew.sh):

sh < (curl -fsSL https://raw.githubusercontent.com/resamsel/translatr/master/install)

install file contains:

cat > /usr/local/bin/translatr <<EOF
$(contents of translatr.py)
EOF

Usage

First, create a project in the web GUI and copy the project ID (40 character UUID in the URL, i.e. http://localhost:9000/project/6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220 -> project ID: 6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220).

Then put a .translatr.yml file in any directory that you want to enable pulling/pushing. Translatr will then use that file as configuration.

Example .translatr.yml for Play messages

translatr:
  endpoint: http://localhost:9000
  project_id: 6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220
  pull:
    file_type: play_messages
    target: conf/messages.?{locale.name}
  push:
    file_type: play_messages
    target: conf/messages.?{locale.name}

Pushing

By pushing you send the matching messages files to the given endpoint, creating locales if needed.

translatr push

This will overwrite all existing messages, if any. No existing keys/locales will be removed, this is not a sync operation.

Pulling

By pulling you download all locales into separate files into the configured files (translatr.pull.target key).

translatr pull

This will overwrite any existing files locally. All known locales will be downloaded.

Analysis: Find similar keys

When pushing existing messages the possibility of similar, but not duplicate key names is quite high (human error). Calculating a similarity between key names might help find errors. Merging two keys might be an option as well, which isn't possible at the moment.

Add wizard for creating a .translatr.yml config file

In any project there should be the option to create a .translatr.yml config file. The form should prepoulate the fields for endpoint (immutable), project_id (immutable), access_token (dropdown, with create option), and project types (Play, Java, Gettext, ...).

Add user roles

Add roles for users:

  • Admin - general role, can see all projects
  • User (default) - general role
  • Owner - role within a project; is allowed to modify the project and add users; implicitly is a developer
  • Developer - role within a project, is allowed to modify locales and keys; implicitly is a translator
  • Translator - role within a project, is allowed to modify messages

"Add a new key" button not working

On clicking (+) for "Add a new key" the screen is overlayed black and there is no possibility to enter a key or to get back to the page without reloading.

Analysis: Missing messages

Show missing messages compared to other locales in a separate view. This would allow analysis why certain messages are not present in the default locale.

Remove duplicate API methods in web UI

Some methods, like creating and updating messages, are duplicated in application controllers. Those should be removed.

Basically all routes from Application.javascriptRoutes should be replaced with API versions.

Add unit tests

Introduce unit tests and produce a code coverage report.

Add install instructions for translatr.py

Instructions need to be put on a separate page.

Installation

Install it similar to Homebrew (http://brew.sh):

curl -fsSL https://raw.githubusercontent.com/resamsel/translatr/master/install.sh | bash

install file contains:

# Install location may be overridden by using the TRANSLATR_PREFIX env variable
TRANSLATR_PREFIX=${TRANSLATR_PREFIX:=/usr/local}

cat > $TRANSLATR_PREFIX/bin/translatr <<EOF
$(contents of translatr.py)
EOF

Usage

First, create a project in the web GUI and copy the project ID (40 character UUID in the URL, i.e. http://localhost:9000/project/6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220 -> project ID: 6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220).

Then put a .translatr.yml file in any directory that you want to enable pulling/pushing. Translatr will then use that file as configuration.

Example .translatr.yml for Play messages

translatr:
  endpoint: http://localhost:9000
  project_id: 6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220
  pull:
    file_type: play_messages
    target: conf/messages.?{locale.name}
  push:
    file_type: play_messages
    target: conf/messages.?{locale.name}

Pushing

By pushing you send the matching messages files to the given endpoint, creating locales if needed.

translatr push

This will overwrite all existing messages, if any. No existing keys/locales will be removed, this is not a sync operation.

Pulling

By pulling you download all locales into separate files into the configured files (translatr.pull.target key).

translatr pull

This will overwrite any existing files locally. All known locales will be downloaded.

Anyone can modify locales of a project

The button for adding/removing locales is visible for anyone in the project/locales view. Only users with role Owner or Translator should be allowed to modify locales.

Introduce users

Let users:

  • login, logout, register, join with Github
  • own projects
  • invite others to their project as developer/translator
  • see all relevant projects in own dashboard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.