grinder_smartling 0.1.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 49

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.

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

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
49

Platforms

Detected platforms: other

Primary library: package:grinder_smartling/grinder_smartling.dart with components: io, mirrors.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use grinder_smartling.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0
grinder ^0.8.0 0.8.1
http ^0.11.3 0.11.3+16
meta ^1.0.5 1.1.2
path ^1.4.1 1.5.1
Transitive dependencies
async 2.0.3
charcode 1.1.1
cli_util 0.1.2+1
collection 1.14.5
glob 1.1.5
http_parser 3.1.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
coverage ^0.9.2
coveralls ^1.0.0
test ^0.12.20