Skip to content

Commit e13a6b1

Browse files
authored
feat(ui_storage, ui_localizations): add UploadButton label (#86)
* feat(ui_storage, ui_localizations): add UploadButton label * add license header * drop stub test * drop stub test
1 parent 1e091cc commit e13a6b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+267
-65
lines changed
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright 2023, the Chromium project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'dart:convert';
6+
import 'dart:io';
7+
8+
import 'package:path/path.dart' as path;
9+
10+
String prompt(String tag) {
11+
stdout.write('$tag?: ');
12+
final answer = stdin.readLineSync();
13+
14+
if (answer == null || answer.isEmpty) {
15+
throw Exception('$tag is required');
16+
}
17+
18+
return answer;
19+
}
20+
21+
Future<void> main(List<String> args) async {
22+
final name = prompt('Label name');
23+
final description = prompt('Label description');
24+
final englishTranslation = prompt('English translation');
25+
26+
final cwd = Directory.current.path;
27+
final l10nSrc = Directory(path.join(cwd, 'lib', 'l10n'));
28+
29+
final files = l10nSrc.listSync().whereType<File>().toList();
30+
final futures = files.map((e) async {
31+
final newContent = await addLabel(e, name, description, englishTranslation);
32+
final b = StringBuffer();
33+
final string = const JsonEncoder.withIndent(' ').convert(newContent);
34+
b.write(string);
35+
b.write('\n');
36+
37+
await e.writeAsString(b.toString());
38+
});
39+
40+
await Future.wait(futures);
41+
stdout.writeln('Done!');
42+
}
43+
44+
Future<Map<String, dynamic>> addLabel(
45+
File file,
46+
String name,
47+
String description,
48+
String englishTranslation,
49+
) async {
50+
final content = jsonDecode(await file.readAsString()) as Map<String, dynamic>;
51+
return {
52+
...content,
53+
"@@last_modified": DateTime.now().toIso8601String(),
54+
name: englishTranslation,
55+
"@$name": {
56+
"description": description,
57+
"placeholders": {},
58+
},
59+
};
60+
}

Diff for: packages/firebase_ui_localizations/example/test/widget_test.dart

-34
This file was deleted.

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_ar.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "ar",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.840754",
44
"accessDisabledErrorText": "تم إيقاف إذن الوصول إلى هذا الحساب مؤقتًا.",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_de.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "de",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.835367",
44
"accessDisabledErrorText": "Der Zugriff auf dieses Konto wurde vorübergehend gesperrt",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_en.arb

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "en",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.843264",
44
"accessDisabledErrorText": "Access to this account has been temporarily disabled",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427-
}
432+
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_es.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "es",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.812582",
44
"accessDisabledErrorText": "Se ha inhabilitado temporalmente al acceso a esta cuenta",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_es_419.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "es_419",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.840098",
44
"accessDisabledErrorText": "Se inhabilitó temporalmente el acceso a la cuenta",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_fr.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "fr",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.846260",
44
"accessDisabledErrorText": "L'accès à ce compte a été temporairement désactivé",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_he.arb

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "he",
3-
"@@last_modified": "2023-03-28T13:23:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.833349",
44
"accessDisabledErrorText": "הגישה לחשבון זה הושבתה באופן זמני",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -31,7 +31,7 @@
3131
"description": "Used as an error text when provided passwords do not match.",
3232
"placeholders": {}
3333
},
34-
"confirmPasswordInputLabel": "וודא סיסמה",
34+
"confirmPasswordInputLabel": "וודא סיסמה",
3535
"@confirmPasswordInputLabel": {
3636
"description": "Used as a label of the PasswordInput that confirms a provided password.",
3737
"placeholders": {}
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_hi.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "hi",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.845305",
44
"accessDisabledErrorText": "इस खाते के ऐक्सेस पर, कुछ समय के लिए रोक लगा दी गई है",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_hu.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "hu",
3-
"@@last_modified": "2022-12-14T10:50:43",
3+
"@@last_modified": "2023-08-31T15:49:19.825507",
44
"accessDisabledErrorText": "A fiók átmenetileg le van tiltva",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_id.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "id",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.827378",
44
"accessDisabledErrorText": "Akses ke akun ini telah dinonaktifkan untuk sementara waktu",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_it.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "it",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.834393",
44
"accessDisabledErrorText": "L'accesso a questo account è stato temporaneamente disabilitato",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_ja.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "ja",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.843967",
44
"accessDisabledErrorText": "このアカウントへのアクセスが一時的に無効になっています",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_ko.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "ko",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.820707",
44
"accessDisabledErrorText": "이 계정의 액세스가 일시적으로 중지되었습니다.",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_nl.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "nl",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.842616",
44
"accessDisabledErrorText": "De toegang tot dit account is tijdelijk uitgezet",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

Diff for: packages/firebase_ui_localizations/lib/l10n/firebase_ui_pl.arb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"@@locale": "pl",
3-
"@@last_modified": "2022-09-14T18:25:39.449",
3+
"@@last_modified": "2023-08-31T15:49:19.841548",
44
"accessDisabledErrorText": "Dostęp do tego konta został tymczasowo wyłączony",
55
"@accessDisabledErrorText": {
66
"description": "Used as an error message when account is blocked and user tries to perform some actions with the account (e.g. unlinking a credential).",
@@ -423,5 +423,10 @@
423423
"@wrongOrNoPasswordErrorText": {
424424
"description": "Used as an error text of the PasswordInput when provided password is empty or is not correct.",
425425
"placeholders": {}
426+
},
427+
"uploadButtonText": "Upload file",
428+
"@uploadButtonText": {
429+
"description": "UploadButton label",
430+
"placeholders": {}
426431
}
427432
}

0 commit comments

Comments
 (0)