grinder_smartling 0.1.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

Grinder-Smartling #

Runtime Release License Coverage Build

Grinder plug-in dedicated to the synchronization of translations with the Smartling service, based on the File API v2.

Getting started #

If you haven't used Grinder before, be sure to check out the related documentation, as it explains how to create a grind.dart file and to define project tasks. Once you're familiar with that process, you may install this plug-in.

Installing via Pub

1. Depend on it #

Add this to your package's pubspec.yaml file:

devDpendencies:
  grinder_smartling: *

2. Install it #

Install this package and its dependencies from a command prompt:

$ pub get

Once the plug-in has been installed, it may be enabled inside your grind.dart file.

Usage #

The plug-in lets you synchronize translations with the Smartling service. Two functions are dedicated to this feature:

  • download(): Downloads the message translations from the remote server.
  • upload(): Uploads the source messages to the remote server.

These functions require four named parameters:

  • String fileUri : A value that uniquely identifies the remote file.
  • String projectId : The project identifier.
  • String userId : The identifier used to identify the API user.
  • String userSecret : The secret used to authenticate the API user.

Download the message translations from the Smartling service #

The download() function takes a file pattern and a list of locales as inputs, indicating the path of the downloaded files and their target language. The {{locale}} placeholder will be replaced by the locale of each file.

import 'dart:async';
import 'package:grinder/grinder.dart';
import 'package:grinder_smartling/grinder_smartling.dart' as smartling;

@Task('Download the message translations from the Smartling service')
Future i18nDownload() => smartling.download(
  'path/to/i18n/{{locale}}.json', ['es-ES', 'fr-FR', 'ja-JP'],
  fileUri: '/Gulp-Smartling/messages.json',
  projectId: 'FooBar',
  userId: 'john.doe',
  userSecret: 'MyPassword'
);

The supported options are:

  • bool includeOriginalStrings = false : A value indicating whether to return the original string when no translation is available.
  • String retrievalType = "published" : The desired format for the download.

Upload the message source to the Smartling service #

The upload() function takes a file path as input, specifying the message source to be uploaded.

import 'dart:async';
import 'package:grinder/grinder.dart';
import 'package:grinder_smartling/grinder_smartling.dart' as smartling;

@Task('Upload the source messages to the Smartling service')
Future i18nUpload() => smartling.upload(
  'path/to/i18n/en-US.json',
  fileUri: '/Gulp-Smartling/messages.json',
  projectId: 'FooBar',
  userId: 'john.doe',
  userSecret: 'MyPassword'
);

The supported options are:

  • bool authorize = false : A value indicating whether content in the file is authorized in all locales.
  • dynamic callbackUrl = null : The URL of the callback called when the file is 100% published for a locale.
  • String fileType = "" : The file type. If empty, will be guessed from the extension of the input file.

See also #

License #

Grinder-Smartling is distributed under the Apache License, version 2.0.

Changelog #

This file contains highlights of what changes on each version of the Grinder-Smartling package.

Version 0.1.0 #

  • Initial release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  grinder_smartling: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:grinder_smartling/grinder_smartling.dart';
  
Version Uploaded Documentation Archive
0.1.0 Jun 3, 2017 Go to the documentation of grinder_smartling 0.1.0 Download grinder_smartling 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0