Imports Application Resource Bundle (ARB) from Google Sheets
https://github.com/googlei18n/app-resource-bundle/wiki/ApplicationResourceBundleSpecification
Setup plugin configuration
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
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
Open sample Google spreadsheet template available at:
Copy sample to your Drive account
Save DOCUMENT_ID
of the Google spreadsheet
Create Google Sheets API credentials either by using Client or Server authentication.
Add gsheet_to_arb dev dependency to the pubspec.yaml
dev_dependencies:
gsheet_to_arb: ^0.0.6
Updated dependencies
Create plugin configuration
pub run gsheet_to_arb:import --create-config gsheet_to_arb.yaml
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"
example/README.md
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
Add this to your package's pubspec.yaml file:
dependencies:
gsheet_to_arb: ^0.0.6
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.
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 |
|
|
0.0.5 | Nov 21, 2018 |
|
|
0.0.4 | Nov 21, 2018 |
|
|
0.0.2+1 | Nov 17, 2018 |
|
|
0.0.2 | Nov 16, 2018 |
|
|
0.0.1 | Nov 16, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
3
|
Health:
Code health derived from static analysis.
[more]
|
99
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
90
|
Overall:
Weighted score of the above.
[more]
|
49
|
We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
Primary library:
package:gsheet_to_arb/gsheet_to_arb.dart
with components:io
.
Fix bin/arb_to_dart.dart
. (-0.50 points)
Analysis of bin/arb_to_dart.dart
reported 1 hint:
line 26 col 7: Use isEmpty instead of length
Fix bin/import.dart
. (-0.50 points)
Analysis of bin/import.dart
reported 1 hint:
line 25 col 7: Use isEmpty instead of length
Format lib/src/arb_to_class_generator.dart
.
Run dartfmt
to format lib/src/arb_to_class_generator.dart
.
Fix additional 3 files with analysis or formatting issues.
Additional issues in the following files:
lib/src/config/plugin_config.dart
(Run dartfmt
to format lib/src/config/plugin_config.dart
.)lib/src/config/plugin_config_helper.dart
(Run dartfmt
to format lib/src/config/plugin_config_helper.dart
.)lib/src/sheet/sheet_parser.dart
(Run dartfmt
to format lib/src/sheet/sheet_parser.dart
.)Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of 0.0.*
, it might mean that the author is still experimenting with the general direction of the API.
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+1 | 0.35.1 |
args | >=0.12.1 <2.0.0 | 1.5.1 | |
code_builder | ^3.1.3 | 3.2.0 | |
dart_style | ^1.0.0 | 1.2.0 | 1.2.3 |
file_utils | ^0.1.1 | 0.1.1 | |
googleapis | ^0.52.0+1 | 0.52.0+1 | 0.53.0 |
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.3 | |
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.1 | |
Transitive dependencies | |||
_discoveryapis_commons | 0.1.8+1 | ||
async | 2.0.8 | ||
built_collection | 4.1.0 | ||
built_value | 6.3.0 | ||
charcode | 1.1.2 | ||
collection | 1.14.11 | ||
convert | 2.1.1 | ||
crypto | 2.0.6 | ||
csslib | 0.14.6 | ||
fixnum | 0.10.9 | ||
front_end | 0.1.6+9 | 0.1.11 | |
glob | 1.1.7 | ||
globbing | 0.2.0 | ||
html | 0.13.3+3 | ||
http | 0.12.0+1 | ||
http_parser | 3.1.3 | ||
kernel | 0.3.6+9 | 0.3.11 | |
matcher | 0.12.4 | ||
meta | 1.1.7 | ||
package_config | 1.0.5 | ||
petitparser | 2.1.1 | ||
plugin | 0.2.0+3 | ||
pub_semver | 1.4.2 | ||
quiver | 2.0.1 | ||
source_span | 1.5.4 | ||
stack_trace | 1.9.3 | ||
string_scanner | 1.0.4 | ||
term_glyph | 1.1.0 | ||
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 |