gsheet_to_arb 0.0.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new47

GSheet to ARB

pub package

Imports Application Resource Bundle (ARB) from Google Sheets

https://github.com/googlei18n/app-resource-bundle/wiki/ApplicationResourceBundleSpecification

Usage

Import ARB files from the Google Sheet

  1. Setup plugin configuration

  2. To import ARB files from Google Sheet run the gsheet_to_arb:import program.

     pub run gsheet_to_arb:import --config gsheet_to_arb.yaml
    
  3. Optionally generate Dart classes from the ARB files using gsheet_to_arb:arb_to_dart program.

     pub run gsheet_to_arb:arb_to_dart --config gsheet_to_arb.yaml
    

Setup

1. Copy Google Sheet template

  1. Open sample Google spreadsheet template available at:

  2. Copy sample to your Drive account

    • File -> Make a copy
  3. Save DOCUMENT_ID of the Google spreadsheet

2. Authenticate

Create Google Sheets API credentials either by using Client or Server authentication.

3. Configure your Dart project

  1. Add gsheet_to_arb dev dependency to the pubspec.yaml

     dev_dependencies:
       gsheet_to_arb: ^0.0.6
    
  2. Updated dependencies

  3. Create plugin configuration

     pub run gsheet_to_arb:import --create-config gsheet_to_arb.yaml
    
  4. Update plugin configuration gsheet_to_arb.yaml e.g.

     gsheet_to_arb:
       arb_file_prefix: 'intl'
       output_directory: 'lib/src/i18n'
       gsheet:
         document_id: '<DOCUMENT_ID>'
         sheet_id: '0'
         auth:
           service_account_key_path: "~/.ssh/gsheet-to-arb-server-config.json"
    

TODO

  • Support ARB plurals

0.0.6

  • Category prefix configuration

0.0.5

  • Support placeholders in ARB resources

0.0.4

  • Server-side (private key) authentication

0.0.3

  • Generate dart class from arb file

0.0.2

  • Import ARB from Google Sheets

0.0.1

  • Initial version

example/README.md

Scripts

Import from Google Sheets:

pub run gsheet_to_arb:import --config gsheet_to_arb.yaml

Generate Messages

pub run gsheet_to_arb:arb_to_dart --config gsheet_to_arb.yaml

Use this package as a library

1. Depend on it

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


dependencies:
  gsheet_to_arb: ^0.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:gsheet_to_arb/gsheet_to_arb.dart';
  
Version Uploaded Documentation Archive
0.0.6 Nov 22, 2018 Go to the documentation of gsheet_to_arb 0.0.6 Download gsheet_to_arb 0.0.6 archive
0.0.5 Nov 21, 2018 Go to the documentation of gsheet_to_arb 0.0.5 Download gsheet_to_arb 0.0.5 archive
0.0.4 Nov 21, 2018 Go to the documentation of gsheet_to_arb 0.0.4 Download gsheet_to_arb 0.0.4 archive
0.0.2+1 Nov 17, 2018 Go to the documentation of gsheet_to_arb 0.0.2+1 Download gsheet_to_arb 0.0.2+1 archive
0.0.2 Nov 16, 2018 Go to the documentation of gsheet_to_arb 0.0.2 Download gsheet_to_arb 0.0.2 archive
0.0.1 Nov 16, 2018 Go to the documentation of gsheet_to_arb 0.0.1 Download gsheet_to_arb 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
3
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
47
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

Primary library: package:gsheet_to_arb/gsheet_to_arb.dart with components: io.

Health issues and suggestions

Document public APIs (-9.03 points)

102 out of 113 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Format lib/src/arb_to_class_generator.dart.

Run dartfmt to format lib/src/arb_to_class_generator.dart.

Format lib/src/config/plugin_config.dart.

Run dartfmt to format lib/src/config/plugin_config.dart.

Format lib/src/config/plugin_config_helper.dart.

Run dartfmt to format lib/src/config/plugin_config_helper.dart.

Format lib/src/sheet/sheet_parser.dart.

Run dartfmt to format lib/src/sheet/sheet_parser.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer >=0.33.0-alpha.0 <0.34.0 0.33.6 0.34.0
args >=0.12.1 <2.0.0 1.5.1
code_builder ^3.1.3 3.1.3
dart_style ^1.0.0 1.2.0 1.2.1
file_utils ^0.1.1 0.1.1
googleapis ^0.52.0+1 0.52.0+1
googleapis_auth ^0.2.6 0.2.6
intl >=0.15.3 <0.16.0 0.15.7
intl_translation ^0.17.2 0.17.2
json_annotation ^2.0.0 2.0.0
logging ^0.11.3+2 0.11.3+2
path >=0.9.0 <2.0.0 1.6.2
recase ^2.0.0+1 2.0.0+1
Transitive dependencies
_discoveryapis_commons 0.1.8+1
async 2.0.8
built_collection 4.1.0
built_value 6.1.6
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
fixnum 0.10.9
front_end 0.1.6+8 0.1.7
glob 1.1.7
globbing 0.2.0
html 0.13.3+3
http 0.12.0
http_parser 3.1.3
kernel 0.3.6+8 0.3.7
matcher 0.12.4
meta 1.1.6
package_config 1.0.5
petitparser 2.0.2
plugin 0.2.0+3
pub_semver 1.4.2
quiver 2.0.1
source_span 1.4.1
stack_trace 1.9.3
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner ^1.0.0
json_serializable ^2.0.0
test ^1.2.0