Skip to content

Commit f1c917a

Browse files
committed
update copyrights
1 parent e8d4d6c commit f1c917a

27 files changed

+92
-98
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ doc/api/
1414
.idea/
1515
.iml
1616

17-
# Configuration
17+
# GSheet to ARB Configuration
1818
.gsheet_to_arb.yaml
19-
.gsheet_to_arb.yaml
19+
gsheet_to_arb.yaml

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.7
2+
3+
- Update dependencies
4+
15
## 0.0.6
26

37
- Category prefix configuration

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD License
22

3-
Copyright (c) 2018, Marcin Marek Gocał
3+
Copyright (c) 2020, Marek Gocał
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

bin/arb_to_dart.dart

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -24,25 +24,21 @@ main(List<String> args) async {
2424

2525
parser.parse(args);
2626
if (args.length == 0) {
27-
Log.i('Imports ARB file from exisiting GSheet document');
27+
Log.i('Converts ARB file to Dart i18n');
2828
Log.i('Usage: gsheet_to_arb [options]');
2929
Log.i(parser.usage);
3030
exit(0);
3131
}
3232

33-
var config = PluginConfigHelper().fromYamlFile(configFilePath);
34-
35-
var serializer = ArbSerializer();
36-
37-
var document =
33+
final config = PluginConfigHelper().fromYamlFile(configFilePath);
34+
final serializer = ArbSerializer();
35+
final document =
3836
serializer.loadArbDocument("${config.outputDirectoryPath}/intl_en.arb");
39-
40-
var localizationFileName = config.localizationFileName;
41-
42-
var generator = TranslationsGenerator();
37+
final localizationFileName = config.localizationFileName;
38+
final generator = TranslationsGenerator();
4339
generator.buildTranslations(
4440
document, config.outputDirectoryPath, localizationFileName);
4541

46-
IntlTranslationHelper helper = IntlTranslationHelper();
42+
final helper = IntlTranslationHelper();
4743
helper.aaa(config.outputDirectoryPath, config.localizationFileName);
4844
}

bin/import.dart

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -29,14 +29,11 @@ main(List<String> args) async {
2929
exit(0);
3030
}
3131

32-
var config = PluginConfigHelper().fromYamlFile(configFilePath);
33-
34-
var sheetConfig = config.sheetConfig;
35-
36-
var sheetParser = SheetParser(
32+
final config = PluginConfigHelper().fromYamlFile(configFilePath);
33+
final sheetConfig = config.sheetConfig;
34+
final sheetParser = SheetParser(
3735
auth: sheetConfig.auth, categoryPrefix: sheetConfig.categoryPrefix);
38-
var bundle = await sheetParser.parseSheet(sheetConfig.documentId);
39-
40-
var arbSerializer = ArbSerializer();
36+
final bundle = await sheetParser.parseSheet(sheetConfig.documentId);
37+
final arbSerializer = ArbSerializer();
4138
arbSerializer.saveArbBundle(bundle, config.outputDirectoryPath);
4239
}

example/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.gsheet_to_arb.yaml
2+
gsheet_to_arb.yaml

example/lib/src/i18n/_messages_all.dart

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -19,7 +19,6 @@ import '_messages_en.dart' deferred as messages_en;
1919
import '_messages_pl.dart' deferred as messages_pl;
2020
// ignore: implementation_imports
2121

22-
2322
typedef Future<dynamic> LibraryLoader();
2423
Map<String, LibraryLoader> _deferredLibraries = {
2524
'pl': () => messages_pl.loadLibrary(),
@@ -43,9 +42,8 @@ MessageLookupByLibrary _findExact(localeName) {
4342
/// User programs should call this before using [localeName] for messages.
4443
Future<bool> initializeMessages(String localeName) async {
4544
var availableLocale = Intl.verifiedLocale(
46-
localeName,
47-
(locale) => _deferredLibraries[locale] != null,
48-
onFailure: (_) => null);
45+
localeName, (locale) => _deferredLibraries[locale] != null,
46+
onFailure: (_) => null);
4947
if (availableLocale == null) {
5048
// ignore: unnecessary_new
5149
return new Future.value(false);
@@ -69,8 +67,8 @@ bool _messagesExistFor(String locale) {
6967
}
7068

7169
MessageLookupByLibrary _findGeneratedMessagesFor(locale) {
72-
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
73-
onFailure: (_) => null);
70+
var actualLocale =
71+
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
7472
if (actualLocale == null) return null;
7573
return _findExact(actualLocale);
7674
}

example/lib/src/i18n/_messages_de.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -25,10 +25,10 @@ class MessageLookup extends MessageLookupByLibrary {
2525
get localeName => 'de';
2626

2727
final messages = _notInlinedMessages(_notInlinedMessages);
28-
static _notInlinedMessages(_) => <String, Function> {
29-
"login": MessageLookupByLibrary.simpleMessage("Einloggen"),
30-
"message": MessageLookupByLibrary.simpleMessage("Nachricht"),
31-
"register": MessageLookupByLibrary.simpleMessage("Registrieren"),
32-
"title": MessageLookupByLibrary.simpleMessage("Titel")
33-
};
28+
static _notInlinedMessages(_) => <String, Function>{
29+
"login": MessageLookupByLibrary.simpleMessage("Einloggen"),
30+
"message": MessageLookupByLibrary.simpleMessage("Nachricht"),
31+
"register": MessageLookupByLibrary.simpleMessage("Registrieren"),
32+
"title": MessageLookupByLibrary.simpleMessage("Titel")
33+
};
3434
}

example/lib/src/i18n/_messages_en.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -25,10 +25,10 @@ class MessageLookup extends MessageLookupByLibrary {
2525
get localeName => 'en';
2626

2727
final messages = _notInlinedMessages(_notInlinedMessages);
28-
static _notInlinedMessages(_) => <String, Function> {
29-
"login": MessageLookupByLibrary.simpleMessage("Login"),
30-
"message": MessageLookupByLibrary.simpleMessage("Message"),
31-
"register": MessageLookupByLibrary.simpleMessage("Register"),
32-
"title": MessageLookupByLibrary.simpleMessage("Title")
33-
};
28+
static _notInlinedMessages(_) => <String, Function>{
29+
"login": MessageLookupByLibrary.simpleMessage("Login"),
30+
"message": MessageLookupByLibrary.simpleMessage("Message"),
31+
"register": MessageLookupByLibrary.simpleMessage("Register"),
32+
"title": MessageLookupByLibrary.simpleMessage("Title")
33+
};
3434
}

example/lib/src/i18n/_messages_pl.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -25,10 +25,10 @@ class MessageLookup extends MessageLookupByLibrary {
2525
get localeName => 'pl';
2626

2727
final messages = _notInlinedMessages(_notInlinedMessages);
28-
static _notInlinedMessages(_) => <String, Function> {
29-
"login": MessageLookupByLibrary.simpleMessage("Zaloguj"),
30-
"message": MessageLookupByLibrary.simpleMessage("Wiadomość"),
31-
"register": MessageLookupByLibrary.simpleMessage("Zarejestruj"),
32-
"title": MessageLookupByLibrary.simpleMessage("Tytuł")
33-
};
28+
static _notInlinedMessages(_) => <String, Function>{
29+
"login": MessageLookupByLibrary.simpleMessage("Zaloguj"),
30+
"message": MessageLookupByLibrary.simpleMessage("Wiadomość"),
31+
"register": MessageLookupByLibrary.simpleMessage("Zarejestruj"),
32+
"title": MessageLookupByLibrary.simpleMessage("Tytuł")
33+
};
3434
}

example/lib/src/i18n/s.dart

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -17,8 +17,7 @@ class S {
1717
Intl.message("Message", name: "message", desc: "contains message");
1818

1919
/// contains app name
20-
String get appName =>
21-
Intl.message("Sample Application",
20+
String get appName => Intl.message("Sample Application",
2221
name: "app_name", desc: "contains app name");
2322

2423
/// contains login
@@ -30,8 +29,7 @@ class S {
3029
Intl.message("Register", name: "register", desc: "contains registration");
3130

3231
/// Single named argument
33-
String singleArgument(String name) =>
34-
Intl.message("Single {name} argument",
32+
String singleArgument(String name) => Intl.message("Single {name} argument",
3533
name: "single_argument", args: [name], desc: "Single named argument");
3634

3735
/// Two named arguments

lib/gsheet_to_arb.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/arb/arb.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/arb/arb_generator.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/arb/arb_serializer.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/arb/arb_utils.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/arb/intl_translation_helper.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/arb_to_class_generator.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -64,8 +64,7 @@ class TranslationsGenerator {
6464
builder.returns = const Reference('String');
6565
builder.lambda = true;
6666
builder.body = Code(
67-
"""Intl.message("${value}", name: "${key}", args: [${args.join(
68-
", ")}], desc: "${description}")""");
67+
"""Intl.message("${value}", name: "${key}", args: [${args.join(", ")}], desc: "${description}")""");
6968
builder.docs.add("\t/// ${description}");
7069
});
7170
return method;

lib/src/config/plugin_config.dart

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -90,18 +90,19 @@ class Auth {
9090
@JsonKey(name: 'service_account_key_path', nullable: true)
9191
String serviceAccountKeyPath;
9292

93-
Auth({this.oauthClientId,
94-
this.oauthClientIdPath,
95-
this.serviceAccountKey,
96-
this.serviceAccountKeyPath});
93+
Auth(
94+
{this.oauthClientId,
95+
this.oauthClientIdPath,
96+
this.serviceAccountKey,
97+
this.serviceAccountKeyPath});
9798

9899
factory Auth.fromJson(Map<String, dynamic> json) => _$AuthFromJson(json);
99100

100101
Map<String, dynamic> toJson() => _$AuthToJson(this);
101102
}
102103

103104
///
104-
/// OAuthClientId
105+
/// OAuthClientId
105106
///
106107
@JsonSerializable()
107108
class OAuthClientId {
@@ -154,16 +155,17 @@ class ServiceAccountKey {
154155
@JsonKey(name: 'client_x509_cert_url', nullable: false)
155156
String clientX509CertUrl;
156157

157-
ServiceAccountKey({this.type,
158-
@required this.projectId,
159-
@required this.privateKeyId,
160-
@required this.privateKey,
161-
@required this.clientEmail,
158+
ServiceAccountKey(
159+
{this.type,
160+
@required this.projectId,
161+
@required this.privateKeyId,
162+
@required this.privateKey,
163+
@required this.clientEmail,
162164
this.clientId,
163165
this.authUri,
164166
this.tokenUri,
165167
this.authProviderX509CertUrl,
166-
this.clientX509CertUrl});
168+
this.clientX509CertUrl});
167169

168170
factory ServiceAccountKey.fromJson(Map<String, dynamic> json) =>
169171
_$ServiceAccountKeyFromJson(json);

lib/src/config/plugin_config.g.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/

lib/src/config/plugin_config_helper.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Marcin Marek Gocał
2+
* Copyright (c) 2020, Marek Gocał
33
* All rights reserved. Use of this source code is governed by a
44
* BSD-style license that can be found in the LICENSE file.
55
*/
@@ -20,7 +20,7 @@ class PluginConfigHelper {
2020
GoogleSheetConfig(
2121
auth: Auth(
2222
serviceAccountKeyPath:
23-
"~/.ssh/gsheet-to-arb-server-config.json"),
23+
"~/.ssh/gsheet-to-arb-server-config.json"),
2424
documentId: "<DOCUMENT_ID>",
2525
sheetId: "0",
2626
categoryPrefix: "#_"));

0 commit comments

Comments
 (0)