feat: localization (#137)

closes #119

Co-authored-by: Rongjian Zhang <pd4d10@gmail.com>
This commit is contained in:
Shreyas Thirumalai 2021-01-05 14:55:19 +05:30 committed by GitHub
parent c6757c1548
commit 0a1da29c3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
66 changed files with 1988 additions and 168 deletions

View File

@ -61,4 +61,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.9.3
COCOAPODS: 1.10.0

View File

@ -217,25 +217,12 @@
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/launch_review/launch_review.framework",
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
"${BUILT_PRODUCTS_DIR}/share/share.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
"${BUILT_PRODUCTS_DIR}/uni_links/uni_links.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/launch_review.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/uni_links.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;

View File

@ -4,6 +4,11 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>hi</string>
</array>
<key>CFBundleDisplayName</key>
<string>GitTouch</string>
<key>CFBundleExecutable</key>

3
l10n.yaml Normal file
View File

@ -0,0 +1,3 @@
arb-dir: lib/l10n
template-arb-file: intl_en.arb
output-localization-file: S.dart

View File

@ -4,6 +4,8 @@ import 'package:git_touch/home.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/theme.dart';
import 'package:provider/provider.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'generated/l10n.dart';
class MyApp extends StatelessWidget {
Widget _buildChild(BuildContext context) {
@ -13,6 +15,20 @@ class MyApp extends StatelessWidget {
return CupertinoApp(
theme: CupertinoThemeData(brightness: theme.brightness),
home: Home(),
localeResolutionCallback:
(Locale locale, Iterable<Locale> supportedLocales) {
return locale;
},
localizationsDelegates: [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
const Locale('en', ''),
const Locale('hi', ''),
],
);
default:
return MaterialApp(
@ -29,6 +45,20 @@ class MyApp extends StatelessWidget {
),
),
home: Home(),
localeResolutionCallback:
(Locale locale, Iterable<Locale> supportedLocales) {
return locale;
},
localizationsDelegates: [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
const Locale('en', ''),
const Locale('hi', ''),
],
);
}
}

View File

@ -0,0 +1,66 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that looks up messages for specific locales by
// delegating to the appropriate library.
// Ignore issues from commonly used lints in this file.
// ignore_for_file:implementation_imports, file_names, unnecessary_new
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
// ignore_for_file:argument_type_not_assignable, invalid_assignment
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
// ignore_for_file:comment_references
import 'dart:async';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';
import 'messages_en.dart' as messages_en;
import 'messages_hi.dart' as messages_hi;
typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new Future.value(null),
'hi': () => new Future.value(null),
};
MessageLookupByLibrary _findExact(String localeName) {
switch (localeName) {
case 'en':
return messages_en.messages;
case 'hi':
return messages_hi.messages;
default:
return null;
}
}
/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) async {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new Future.value(false);
}
var lib = _deferredLibraries[availableLocale];
await (lib == null ? new Future.value(false) : lib());
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new Future.value(true);
}
bool _messagesExistFor(String locale) {
try {
return _findExact(locale) != null;
} catch (e) {
return false;
}
}
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}

View File

@ -0,0 +1,127 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a en locale. All the
// messages from the main program should be duplicated here with the same
// function name.
// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
final messages = new MessageLookup();
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'en';
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function>{
"about": MessageLookupByLibrary.simpleMessage("about"),
"actions": MessageLookupByLibrary.simpleMessage("Actions"),
"activity": MessageLookupByLibrary.simpleMessage("Activity"),
"all": MessageLookupByLibrary.simpleMessage("All"),
"bitbucketAccount":
MessageLookupByLibrary.simpleMessage("Bitbucket Account"),
"branches": MessageLookupByLibrary.simpleMessage("Branches"),
"brightness": MessageLookupByLibrary.simpleMessage("Brightness"),
"code": MessageLookupByLibrary.simpleMessage("Code"),
"codeTheme": MessageLookupByLibrary.simpleMessage("Code Theme"),
"commits": MessageLookupByLibrary.simpleMessage("Commits"),
"contributors": MessageLookupByLibrary.simpleMessage("Contributors"),
"cupertino": MessageLookupByLibrary.simpleMessage("Cupertino"),
"dark": MessageLookupByLibrary.simpleMessage("Dark"),
"developers": MessageLookupByLibrary.simpleMessage("Developers"),
"email": MessageLookupByLibrary.simpleMessage("Email"),
"events": MessageLookupByLibrary.simpleMessage("Events"),
"explore": MessageLookupByLibrary.simpleMessage("Explore"),
"feedback": MessageLookupByLibrary.simpleMessage("feedback"),
"file": MessageLookupByLibrary.simpleMessage("File"),
"files": MessageLookupByLibrary.simpleMessage("Files"),
"flutter": MessageLookupByLibrary.simpleMessage("Flutter"),
"follow": MessageLookupByLibrary.simpleMessage("Follow"),
"followSystem": MessageLookupByLibrary.simpleMessage("Follow System"),
"followers": MessageLookupByLibrary.simpleMessage("Followers"),
"following": MessageLookupByLibrary.simpleMessage("Following"),
"fontFamily": MessageLookupByLibrary.simpleMessage("Font Family"),
"fontSize": MessageLookupByLibrary.simpleMessage("Font Size"),
"fontStyle": MessageLookupByLibrary.simpleMessage("FONT STYLE"),
"forks": MessageLookupByLibrary.simpleMessage("Forks"),
"gists": MessageLookupByLibrary.simpleMessage("Gists"),
"giteaAccount": MessageLookupByLibrary.simpleMessage("Gitee Account"),
"giteaStatus": MessageLookupByLibrary.simpleMessage("Gitea status"),
"giteeAccount": MessageLookupByLibrary.simpleMessage("Gitee Account"),
"githubAccount": MessageLookupByLibrary.simpleMessage("GitHub Account"),
"githubStatus": MessageLookupByLibrary.simpleMessage("GitHub status"),
"gitlabAccount": MessageLookupByLibrary.simpleMessage("GitLab Account"),
"gitlabStatus": MessageLookupByLibrary.simpleMessage("GitLab status"),
"group": MessageLookupByLibrary.simpleMessage("Group"),
"groups": MessageLookupByLibrary.simpleMessage("Groups"),
"helloWorld": MessageLookupByLibrary.simpleMessage("Hello World!"),
"issue": MessageLookupByLibrary.simpleMessage("Issue"),
"issues": MessageLookupByLibrary.simpleMessage("Issues"),
"light": MessageLookupByLibrary.simpleMessage("Light"),
"longPressToRemoveAccount": MessageLookupByLibrary.simpleMessage(
"Long Press to remove account"),
"markdownRenderEngine":
MessageLookupByLibrary.simpleMessage("Markdown Render Engine"),
"material": MessageLookupByLibrary.simpleMessage("Material"),
"me": MessageLookupByLibrary.simpleMessage("Me"),
"members": MessageLookupByLibrary.simpleMessage("Members"),
"mergeRequests": MessageLookupByLibrary.simpleMessage("Merge Requests"),
"news": MessageLookupByLibrary.simpleMessage("News"),
"notFoundMessage": MessageLookupByLibrary.simpleMessage("Not Found"),
"notFoundTextDisplay": MessageLookupByLibrary.simpleMessage(
"Woops, This page is not implemented yet"),
"notification": MessageLookupByLibrary.simpleMessage("Notification"),
"organizations": MessageLookupByLibrary.simpleMessage("Organizations"),
"participating": MessageLookupByLibrary.simpleMessage("Participating"),
"permissionRequiredMessage": MessageLookupByLibrary.simpleMessage(
"GitTouch needs these permissions"),
"pinnedRepositories":
MessageLookupByLibrary.simpleMessage("pinned repositories"),
"popularRepositories":
MessageLookupByLibrary.simpleMessage("popular repositories"),
"project": MessageLookupByLibrary.simpleMessage("Project"),
"projectActions":
MessageLookupByLibrary.simpleMessage("Project Actions"),
"projects": MessageLookupByLibrary.simpleMessage("Projects"),
"pullRequests": MessageLookupByLibrary.simpleMessage("Pull requests"),
"rateThisApp": MessageLookupByLibrary.simpleMessage("Rate This App"),
"releases": MessageLookupByLibrary.simpleMessage("Releases"),
"removeAccount": MessageLookupByLibrary.simpleMessage("Remove account"),
"repositories": MessageLookupByLibrary.simpleMessage("Repositories"),
"repository": MessageLookupByLibrary.simpleMessage("Repository"),
"repositoryActions":
MessageLookupByLibrary.simpleMessage("Repository Actions"),
"reviewPermissions":
MessageLookupByLibrary.simpleMessage("Review Permissions"),
"scaffoldTheme": MessageLookupByLibrary.simpleMessage("Scaffold Theme"),
"search": MessageLookupByLibrary.simpleMessage("Search"),
"selectAccount": MessageLookupByLibrary.simpleMessage("Select account"),
"settings": MessageLookupByLibrary.simpleMessage("Settings"),
"somethingBadHappens":
MessageLookupByLibrary.simpleMessage("Something bad happens:"),
"sourceCode": MessageLookupByLibrary.simpleMessage("Source Code"),
"stars": MessageLookupByLibrary.simpleMessage("Stars"),
"submitAnIssue":
MessageLookupByLibrary.simpleMessage("Submit an issue"),
"switchAccounts":
MessageLookupByLibrary.simpleMessage("Switch accounts"),
"syntaxHighlighting":
MessageLookupByLibrary.simpleMessage("SYNTAX HIGHLIGHTING"),
"system": MessageLookupByLibrary.simpleMessage("system"),
"teams": MessageLookupByLibrary.simpleMessage("Teams"),
"trending": MessageLookupByLibrary.simpleMessage("Trending"),
"unfollow": MessageLookupByLibrary.simpleMessage("Unfollow"),
"unread": MessageLookupByLibrary.simpleMessage("Unread"),
"user": MessageLookupByLibrary.simpleMessage("User"),
"version": MessageLookupByLibrary.simpleMessage("Version"),
"watchers": MessageLookupByLibrary.simpleMessage("Watchers"),
"webview": MessageLookupByLibrary.simpleMessage("WebView")
};
}

View File

@ -0,0 +1,130 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a hi locale. All the
// messages from the main program should be duplicated here with the same
// function name.
// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
final messages = new MessageLookup();
typedef String MessageIfAbsent(String messageStr, List<dynamic> args);
class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'hi';
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function>{
"about": MessageLookupByLibrary.simpleMessage("एप्लिकेशन के बारे में"),
"actions": MessageLookupByLibrary.simpleMessage("कार्रवाई"),
"activity": MessageLookupByLibrary.simpleMessage("गतिविधि"),
"all": MessageLookupByLibrary.simpleMessage("सब"),
"bitbucketAccount":
MessageLookupByLibrary.simpleMessage("बीटबुकेत खाता"),
"branches": MessageLookupByLibrary.simpleMessage("ब्रांच"),
"brightness": MessageLookupByLibrary.simpleMessage("द्य्रुति"),
"code": MessageLookupByLibrary.simpleMessage("कोड"),
"codeTheme": MessageLookupByLibrary.simpleMessage("कोड थीम"),
"commits": MessageLookupByLibrary.simpleMessage("कमिटस"),
"contributors": MessageLookupByLibrary.simpleMessage("योगदानकर्ताओं"),
"cupertino": MessageLookupByLibrary.simpleMessage("क्यूपर्टिनो थीम"),
"dark": MessageLookupByLibrary.simpleMessage("अंधेरा मोड"),
"developers": MessageLookupByLibrary.simpleMessage("डेवेलपर्स"),
"email": MessageLookupByLibrary.simpleMessage("ईमेल"),
"events": MessageLookupByLibrary.simpleMessage("इवेंट्स"),
"explore": MessageLookupByLibrary.simpleMessage("अन्वेषण"),
"feedback": MessageLookupByLibrary.simpleMessage("फीडबैक"),
"file": MessageLookupByLibrary.simpleMessage("फ़ाइल"),
"files": MessageLookupByLibrary.simpleMessage("फ़ाइलें"),
"flutter": MessageLookupByLibrary.simpleMessage("फ्लटर"),
"follow": MessageLookupByLibrary.simpleMessage("फ़ोल्लोव"),
"followSystem":
MessageLookupByLibrary.simpleMessage("सिस्टम का पालन करें"),
"followers": MessageLookupByLibrary.simpleMessage("अनुयायियों"),
"following": MessageLookupByLibrary.simpleMessage("फोल्लोविंग"),
"fontFamily": MessageLookupByLibrary.simpleMessage("फॉण्ट परिवार"),
"fontSize": MessageLookupByLibrary.simpleMessage("फॉण्ट आकार"),
"fontStyle": MessageLookupByLibrary.simpleMessage("फॉण्ट प्रकार"),
"forks": MessageLookupByLibrary.simpleMessage("फोर्क्स"),
"gists": MessageLookupByLibrary.simpleMessage("गिस्ट्स"),
"giteaAccount": MessageLookupByLibrary.simpleMessage("गीते खाता"),
"giteaStatus": MessageLookupByLibrary.simpleMessage("गीते स्टेटस"),
"giteeAccount": MessageLookupByLibrary.simpleMessage("जीती खाता"),
"githubAccount": MessageLookupByLibrary.simpleMessage("गिटहब खाता"),
"githubStatus": MessageLookupByLibrary.simpleMessage("गिटहब स्टेटस"),
"gitlabAccount": MessageLookupByLibrary.simpleMessage("गितलब खाता"),
"gitlabStatus": MessageLookupByLibrary.simpleMessage("गितलब स्टेटस"),
"group": MessageLookupByLibrary.simpleMessage("समूह"),
"groups": MessageLookupByLibrary.simpleMessage("समूहों"),
"helloWorld": MessageLookupByLibrary.simpleMessage("नमस्ते दुनिया"),
"issue": MessageLookupByLibrary.simpleMessage("मुद्दा"),
"issues": MessageLookupByLibrary.simpleMessage("मुद्दे"),
"light": MessageLookupByLibrary.simpleMessage("प्रकाश मोड"),
"longPressToRemoveAccount": MessageLookupByLibrary.simpleMessage(
"खाता हटाने के लिए लंबी प्रेस"),
"markdownRenderEngine":
MessageLookupByLibrary.simpleMessage("मार्कडौं रेंडर इंजन"),
"material": MessageLookupByLibrary.simpleMessage("मटेरियल थीम"),
"me": MessageLookupByLibrary.simpleMessage("मैं"),
"members": MessageLookupByLibrary.simpleMessage("संगठन"),
"mergeRequests": MessageLookupByLibrary.simpleMessage("मर्ज निवेदन"),
"news": MessageLookupByLibrary.simpleMessage("समाचार"),
"notFoundMessage": MessageLookupByLibrary.simpleMessage("नहीं मिला"),
"notFoundTextDisplay": MessageLookupByLibrary.simpleMessage(
"यह पृष्ठ कार्यान्वित नहीं है"),
"notification": MessageLookupByLibrary.simpleMessage("अधिसूचना"),
"organizations": MessageLookupByLibrary.simpleMessage("संगठन"),
"participating": MessageLookupByLibrary.simpleMessage("भाग लेने वाले"),
"permissionRequiredMessage": MessageLookupByLibrary.simpleMessage(
"गिट्टूच के लीये इन अनुमतियों की आवश्यकता है"),
"pinnedRepositories":
MessageLookupByLibrary.simpleMessage("पिन्नेद रेपोसिटोरिएस"),
"popularRepositories":
MessageLookupByLibrary.simpleMessage("प्रसिद्ध रेपोसिटोरिएस"),
"project": MessageLookupByLibrary.simpleMessage("परियोजना"),
"projectActions":
MessageLookupByLibrary.simpleMessage("परियोजना की कार्रवाई"),
"projects": MessageLookupByLibrary.simpleMessage("परियोजनाओं"),
"pullRequests":
MessageLookupByLibrary.simpleMessage("पुल्ल रिक्वेस्ट्स"),
"rateThisApp":
MessageLookupByLibrary.simpleMessage("इस ऐप्लिकेशन को रेट करे"),
"releases": MessageLookupByLibrary.simpleMessage("रेलसेस"),
"removeAccount": MessageLookupByLibrary.simpleMessage("खाता हटाएं"),
"repositories": MessageLookupByLibrary.simpleMessage("रेपोसिटोरिएस"),
"repository": MessageLookupByLibrary.simpleMessage("रिपॉजिटरी"),
"repositoryActions":
MessageLookupByLibrary.simpleMessage("रिपॉजिटरी कार्रवाई"),
"reviewPermissions":
MessageLookupByLibrary.simpleMessage("अनुमति की समीक्षा करें"),
"scaffoldTheme": MessageLookupByLibrary.simpleMessage("स्कैफफोल्ड थीम"),
"search": MessageLookupByLibrary.simpleMessage("खोज"),
"selectAccount": MessageLookupByLibrary.simpleMessage("खाता चुनें"),
"settings": MessageLookupByLibrary.simpleMessage("सेटिंग्स"),
"somethingBadHappens":
MessageLookupByLibrary.simpleMessage("त्रुटि हुई है: "),
"sourceCode":
MessageLookupByLibrary.simpleMessage("एप्लिकेशन स्रोत कोड"),
"stars": MessageLookupByLibrary.simpleMessage("स्टार्स"),
"submitAnIssue":
MessageLookupByLibrary.simpleMessage("एक मुद्दा प्रस्तुत करें"),
"switchAccounts": MessageLookupByLibrary.simpleMessage("खाते बदलें"),
"syntaxHighlighting":
MessageLookupByLibrary.simpleMessage("सिंटेक्स हाइलाइटिंग"),
"system": MessageLookupByLibrary.simpleMessage("सिस्टम"),
"teams": MessageLookupByLibrary.simpleMessage("टीमों"),
"trending": MessageLookupByLibrary.simpleMessage("ट्रेंडिंग"),
"unfollow": MessageLookupByLibrary.simpleMessage("अनफ़ॉलो"),
"unread": MessageLookupByLibrary.simpleMessage("अपठित"),
"user": MessageLookupByLibrary.simpleMessage("उपयोगकर्ता"),
"version": MessageLookupByLibrary.simpleMessage("एप्लिकेशन वेरीज़न"),
"watchers": MessageLookupByLibrary.simpleMessage("नजर रखने वालों"),
"webview": MessageLookupByLibrary.simpleMessage("वेब्वयेव")
};
}

947
lib/generated/l10n.dart Normal file
View File

@ -0,0 +1,947 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'intl/messages_all.dart';
// **************************************************************************
// Generator: Flutter Intl IDE plugin
// Made by Localizely
// **************************************************************************
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values
class S {
S();
static S current;
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static Future<S> load(Locale locale) {
final name = (locale.countryCode?.isEmpty ?? false)
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
S.current = S();
return S.current;
});
}
static S of(BuildContext context) {
return Localizations.of<S>(context, S);
}
/// `Hello World!`
String get helloWorld {
return Intl.message(
'Hello World!',
name: 'helloWorld',
desc: 'The conventional newborn programmer greeting',
args: [],
);
}
/// `News`
String get news {
return Intl.message(
'News',
name: 'news',
desc: 'The News tab',
args: [],
);
}
/// `Notification`
String get notification {
return Intl.message(
'Notification',
name: 'notification',
desc: 'The Notification tab',
args: [],
);
}
/// `Trending`
String get trending {
return Intl.message(
'Trending',
name: 'trending',
desc: 'Trending',
args: [],
);
}
/// `Search`
String get search {
return Intl.message(
'Search',
name: 'search',
desc: 'The Search tab',
args: [],
);
}
/// `Me`
String get me {
return Intl.message(
'Me',
name: 'me',
desc: 'The Me tab',
args: [],
);
}
/// `Participating`
String get participating {
return Intl.message(
'Participating',
name: 'participating',
desc: 'The participating Tab',
args: [],
);
}
/// `Repositories`
String get repositories {
return Intl.message(
'Repositories',
name: 'repositories',
desc: 'repository text',
args: [],
);
}
/// `Unfollow`
String get unfollow {
return Intl.message(
'Unfollow',
name: 'unfollow',
desc: 'unfollow someone',
args: [],
);
}
/// `Follow`
String get follow {
return Intl.message(
'Follow',
name: 'follow',
desc: 'follow someone',
args: [],
);
}
/// `Stars`
String get stars {
return Intl.message(
'Stars',
name: 'stars',
desc: 'stars on a repo',
args: [],
);
}
/// `Followers`
String get followers {
return Intl.message(
'Followers',
name: 'followers',
desc: 'followers for a person',
args: [],
);
}
/// `Following`
String get following {
return Intl.message(
'Following',
name: 'following',
desc: 'people followed by a person',
args: [],
);
}
/// `Events`
String get events {
return Intl.message(
'Events',
name: 'events',
desc: 'events for a user',
args: [],
);
}
/// `Gists`
String get gists {
return Intl.message(
'Gists',
name: 'gists',
desc: 'gists for a user',
args: [],
);
}
/// `Organizations`
String get organizations {
return Intl.message(
'Organizations',
name: 'organizations',
desc: 'organizations for a user',
args: [],
);
}
/// `Members`
String get members {
return Intl.message(
'Members',
name: 'members',
desc: 'members of an organization',
args: [],
);
}
/// `popular repositories`
String get popularRepositories {
return Intl.message(
'popular repositories',
name: 'popularRepositories',
desc: 'popular repositories',
args: [],
);
}
/// `pinned repositories`
String get pinnedRepositories {
return Intl.message(
'pinned repositories',
name: 'pinnedRepositories',
desc: 'pinned repositories',
args: [],
);
}
/// `Settings`
String get settings {
return Intl.message(
'Settings',
name: 'settings',
desc: 'settings',
args: [],
);
}
/// `system`
String get system {
return Intl.message(
'system',
name: 'system',
desc: 'system',
args: [],
);
}
/// `GitHub status`
String get githubStatus {
return Intl.message(
'GitHub status',
name: 'githubStatus',
desc: 'github status',
args: [],
);
}
/// `Review Permissions`
String get reviewPermissions {
return Intl.message(
'Review Permissions',
name: 'reviewPermissions',
desc: 'review Permissions',
args: [],
);
}
/// `GitLab status`
String get gitlabStatus {
return Intl.message(
'GitLab status',
name: 'gitlabStatus',
desc: 'GitLab status',
args: [],
);
}
/// `Gitea status`
String get giteaStatus {
return Intl.message(
'Gitea status',
name: 'giteaStatus',
desc: 'Gitea status',
args: [],
);
}
/// `Switch accounts`
String get switchAccounts {
return Intl.message(
'Switch accounts',
name: 'switchAccounts',
desc: 'Switch accounts',
args: [],
);
}
/// `Brightness`
String get brightness {
return Intl.message(
'Brightness',
name: 'brightness',
desc: 'brightness',
args: [],
);
}
/// `Follow System`
String get followSystem {
return Intl.message(
'Follow System',
name: 'followSystem',
desc: 'follow systems setting',
args: [],
);
}
/// `Light`
String get light {
return Intl.message(
'Light',
name: 'light',
desc: 'light mode',
args: [],
);
}
/// `Dark`
String get dark {
return Intl.message(
'Dark',
name: 'dark',
desc: 'dark mode',
args: [],
);
}
/// `Scaffold Theme`
String get scaffoldTheme {
return Intl.message(
'Scaffold Theme',
name: 'scaffoldTheme',
desc: 'Kind of theme - cupertino or material',
args: [],
);
}
/// `Cupertino`
String get cupertino {
return Intl.message(
'Cupertino',
name: 'cupertino',
desc: 'Cupertino scaffold theme',
args: [],
);
}
/// `Material`
String get material {
return Intl.message(
'Material',
name: 'material',
desc: 'Material scaffold theme',
args: [],
);
}
/// `Code Theme`
String get codeTheme {
return Intl.message(
'Code Theme',
name: 'codeTheme',
desc: 'code theme',
args: [],
);
}
/// `Markdown Render Engine`
String get markdownRenderEngine {
return Intl.message(
'Markdown Render Engine',
name: 'markdownRenderEngine',
desc: 'flutter or webview rendering for markdown',
args: [],
);
}
/// `Flutter`
String get flutter {
return Intl.message(
'Flutter',
name: 'flutter',
desc: 'render flutter for markdown',
args: [],
);
}
/// `WebView`
String get webview {
return Intl.message(
'WebView',
name: 'webview',
desc: 'render webview for markdown',
args: [],
);
}
/// `feedback`
String get feedback {
return Intl.message(
'feedback',
name: 'feedback',
desc: 'provide feedback',
args: [],
);
}
/// `Submit an issue`
String get submitAnIssue {
return Intl.message(
'Submit an issue',
name: 'submitAnIssue',
desc: 'submit issue for app',
args: [],
);
}
/// `Rate This App`
String get rateThisApp {
return Intl.message(
'Rate This App',
name: 'rateThisApp',
desc: 'rate the app',
args: [],
);
}
/// `Email`
String get email {
return Intl.message(
'Email',
name: 'email',
desc: 'Email to report issues',
args: [],
);
}
/// `about`
String get about {
return Intl.message(
'about',
name: 'about',
desc: 'about section',
args: [],
);
}
/// `Version`
String get version {
return Intl.message(
'Version',
name: 'version',
desc: 'app version',
args: [],
);
}
/// `Source Code`
String get sourceCode {
return Intl.message(
'Source Code',
name: 'sourceCode',
desc: 'source code for app',
args: [],
);
}
/// `Repository`
String get repository {
return Intl.message(
'Repository',
name: 'repository',
desc: 'Repository screen title',
args: [],
);
}
/// `Repository Actions`
String get repositoryActions {
return Intl.message(
'Repository Actions',
name: 'repositoryActions',
desc: 'Repository Actions',
args: [],
);
}
/// `Projects`
String get projects {
return Intl.message(
'Projects',
name: 'projects',
desc: 'projects',
args: [],
);
}
/// `Releases`
String get releases {
return Intl.message(
'Releases',
name: 'releases',
desc: 'releases',
args: [],
);
}
/// `Watchers`
String get watchers {
return Intl.message(
'Watchers',
name: 'watchers',
desc: 'watchers',
args: [],
);
}
/// `Forks`
String get forks {
return Intl.message(
'Forks',
name: 'forks',
desc: 'forks',
args: [],
);
}
/// `Issues`
String get issues {
return Intl.message(
'Issues',
name: 'issues',
desc: 'issues',
args: [],
);
}
/// `Pull requests`
String get pullRequests {
return Intl.message(
'Pull requests',
name: 'pullRequests',
desc: 'Pull Requests',
args: [],
);
}
/// `Commits`
String get commits {
return Intl.message(
'Commits',
name: 'commits',
desc: 'Commits',
args: [],
);
}
/// `Branches`
String get branches {
return Intl.message(
'Branches',
name: 'branches',
desc: 'branches',
args: [],
);
}
/// `Contributors`
String get contributors {
return Intl.message(
'Contributors',
name: 'contributors',
desc: 'contributors',
args: [],
);
}
/// `Unread`
String get unread {
return Intl.message(
'Unread',
name: 'unread',
desc: 'unread',
args: [],
);
}
/// `All`
String get all {
return Intl.message(
'All',
name: 'all',
desc: 'all',
args: [],
);
}
/// `Developers`
String get developers {
return Intl.message(
'Developers',
name: 'developers',
desc: 'developers',
args: [],
);
}
/// `Explore`
String get explore {
return Intl.message(
'Explore',
name: 'explore',
desc: 'explore',
args: [],
);
}
/// `Teams`
String get teams {
return Intl.message(
'Teams',
name: 'teams',
desc: 'teams',
args: [],
);
}
/// `File`
String get file {
return Intl.message(
'File',
name: 'file',
desc: 'file',
args: [],
);
}
/// `Files`
String get files {
return Intl.message(
'Files',
name: 'files',
desc: 'file plural',
args: [],
);
}
/// `Actions`
String get actions {
return Intl.message(
'Actions',
name: 'actions',
desc: 'actions',
args: [],
);
}
/// `Groups`
String get groups {
return Intl.message(
'Groups',
name: 'groups',
desc: 'groups',
args: [],
);
}
/// `Merge Requests`
String get mergeRequests {
return Intl.message(
'Merge Requests',
name: 'mergeRequests',
desc: 'Merge request',
args: [],
);
}
/// `Activity`
String get activity {
return Intl.message(
'Activity',
name: 'activity',
desc: 'activity',
args: [],
);
}
/// `Project`
String get project {
return Intl.message(
'Project',
name: 'project',
desc: 'project',
args: [],
);
}
/// `Select account`
String get selectAccount {
return Intl.message(
'Select account',
name: 'selectAccount',
desc: 'select account message',
args: [],
);
}
/// `Remove account`
String get removeAccount {
return Intl.message(
'Remove account',
name: 'removeAccount',
desc: 'remove account',
args: [],
);
}
/// `Something bad happens:`
String get somethingBadHappens {
return Intl.message(
'Something bad happens:',
name: 'somethingBadHappens',
desc: 'error message',
args: [],
);
}
/// `GitHub Account`
String get githubAccount {
return Intl.message(
'GitHub Account',
name: 'githubAccount',
desc: 'Gitea Account',
args: [],
);
}
/// `GitTouch needs these permissions`
String get permissionRequiredMessage {
return Intl.message(
'GitTouch needs these permissions',
name: 'permissionRequiredMessage',
desc: 'Permission Required Message',
args: [],
);
}
/// `Not Found`
String get notFoundMessage {
return Intl.message(
'Not Found',
name: 'notFoundMessage',
desc: 'Not found page header',
args: [],
);
}
/// `Woops, This page is not implemented yet`
String get notFoundTextDisplay {
return Intl.message(
'Woops, This page is not implemented yet',
name: 'notFoundTextDisplay',
desc: 'Not found error message',
args: [],
);
}
/// `GitLab Account`
String get gitlabAccount {
return Intl.message(
'GitLab Account',
name: 'gitlabAccount',
desc: 'Gitlab Account',
args: [],
);
}
/// `Bitbucket Account`
String get bitbucketAccount {
return Intl.message(
'Bitbucket Account',
name: 'bitbucketAccount',
desc: 'Bitbucket Account',
args: [],
);
}
/// `Long Press to remove account`
String get longPressToRemoveAccount {
return Intl.message(
'Long Press to remove account',
name: 'longPressToRemoveAccount',
desc: 'Long Press to remove account',
args: [],
);
}
/// `Gitee Account`
String get giteaAccount {
return Intl.message(
'Gitee Account',
name: 'giteaAccount',
desc: 'Gitea Account',
args: [],
);
}
/// `Gitee Account`
String get giteeAccount {
return Intl.message(
'Gitee Account',
name: 'giteeAccount',
desc: 'Gitee Account',
args: [],
);
}
/// `User`
String get user {
return Intl.message(
'User',
name: 'user',
desc: 'user',
args: [],
);
}
/// `Group`
String get group {
return Intl.message(
'Group',
name: 'group',
desc: 'group',
args: [],
);
}
/// `Issue`
String get issue {
return Intl.message(
'Issue',
name: 'issue',
desc: 'issue',
args: [],
);
}
/// `Code`
String get code {
return Intl.message(
'Code',
name: 'code',
desc: 'Code',
args: [],
);
}
/// `Project Actions`
String get projectActions {
return Intl.message(
'Project Actions',
name: 'projectActions',
desc: 'Project Actions',
args: [],
);
}
/// `SYNTAX HIGHLIGHTING`
String get syntaxHighlighting {
return Intl.message(
'SYNTAX HIGHLIGHTING',
name: 'syntaxHighlighting',
desc: 'Syntax Highlighting',
args: [],
);
}
/// `Font Family`
String get fontFamily {
return Intl.message(
'Font Family',
name: 'fontFamily',
desc: 'Font Family',
args: [],
);
}
/// `Font Size`
String get fontSize {
return Intl.message(
'Font Size',
name: 'fontSize',
desc: 'font size',
args: [],
);
}
/// `FONT STYLE`
String get fontStyle {
return Intl.message(
'FONT STYLE',
name: 'fontStyle',
desc: 'font style',
args: [],
);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
const AppLocalizationDelegate();
List<Locale> get supportedLocales {
return const <Locale>[
Locale.fromSubtags(languageCode: 'en'),
Locale.fromSubtags(languageCode: 'hi'),
];
}
@override
bool isSupported(Locale locale) => _isSupported(locale);
@override
Future<S> load(Locale locale) => S.load(locale);
@override
bool shouldReload(AppLocalizationDelegate old) => false;
bool _isSupported(Locale locale) {
if (locale != null) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
}
}
}
return false;
}
}

View File

@ -22,6 +22,7 @@ import 'package:git_touch/screens/gh_news.dart';
import 'package:git_touch/screens/gh_search.dart';
import 'package:git_touch/screens/gh_trending.dart';
import 'package:git_touch/screens/ge_search.dart';
import 'generated/l10n.dart';
class Home extends StatefulWidget {
@override
@ -151,46 +152,58 @@ class _HomeState extends State<Home> {
switch (auth.activeAccount.platform) {
case PlatformType.github:
navigationItems = [
BottomNavigationBarItem(icon: Icon(Icons.rss_feed), label: 'News'),
BottomNavigationBarItem(
icon: Icon(Icons.rss_feed), label: S.of(context).news),
BottomNavigationBarItem(
icon: _buildNotificationIcon(context, false),
activeIcon: _buildNotificationIcon(context, true),
label: 'Notification'),
label: S.of(context).notification),
BottomNavigationBarItem(
icon: Icon(Icons.whatshot), label: 'Trending'),
BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
icon: Icon(Icons.whatshot), label: S.of(context).trending),
BottomNavigationBarItem(
icon: Icon(Icons.search), label: S.of(context).search),
BottomNavigationBarItem(
icon: Icon(Icons.person),
activeIcon: Icon(Icons.person),
label: 'Me'),
label: S.of(context).me),
];
break;
case PlatformType.gitlab:
navigationItems = [
BottomNavigationBarItem(icon: Icon(Icons.explore), label: 'Explore'),
BottomNavigationBarItem(icon: Icon(Icons.group), label: 'Groups'),
BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Me'),
BottomNavigationBarItem(
icon: Icon(Icons.explore), label: S.of(context).explore),
BottomNavigationBarItem(
icon: Icon(Icons.group), label: S.of(context).groups),
BottomNavigationBarItem(
icon: Icon(Icons.search), label: S.of(context).search),
BottomNavigationBarItem(
icon: Icon(Icons.person), label: S.of(context).me),
];
break;
case PlatformType.bitbucket:
navigationItems = [
BottomNavigationBarItem(icon: Icon(Icons.explore), label: 'Explore'),
BottomNavigationBarItem(icon: Icon(Icons.group), label: 'Teams'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Me'),
BottomNavigationBarItem(
icon: Icon(Icons.explore), label: S.of(context).explore),
BottomNavigationBarItem(
icon: Icon(Icons.group), label: S.of(context).teams),
BottomNavigationBarItem(
icon: Icon(Icons.person), label: S.of(context).me),
];
break;
case PlatformType.gitea:
navigationItems = [
BottomNavigationBarItem(
icon: Icon(Icons.group), label: 'Organizations'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Me'),
icon: Icon(Icons.group), label: S.of(context).organizations),
BottomNavigationBarItem(
icon: Icon(Icons.person), label: S.of(context).me),
];
break;
case PlatformType.gitee:
navigationItems = [
BottomNavigationBarItem(icon: Icon(Icons.search), label: 'Search'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Me'),
BottomNavigationBarItem(
icon: Icon(Icons.search), label: S.of(context).search),
BottomNavigationBarItem(
icon: Icon(Icons.person), label: S.of(context).me),
];
break;
}

354
lib/l10n/intl_en.arb Normal file
View File

@ -0,0 +1,354 @@
{
"helloWorld": "Hello World!",
"@helloWorld": {
"description": "The conventional newborn programmer greeting"
},
"news": "News",
"@news": {
"description": "The News tab"
},
"notification": "Notification",
"@notification": {
"description": "The Notification tab"
},
"trending": "Trending",
"@trending": {
"description": "Trending"
},
"search": "Search",
"@search": {
"description": "The Search tab"
},
"me": "Me",
"@me": {
"description": "The Me tab"
},
"participating": "Participating",
"@participating": {
"description": "The participating Tab"
},
"repositories": "Repositories",
"@repositories": {
"description": "repository text"
},
"unfollow": "Unfollow",
"@unfollow": {
"description": "unfollow someone"
},
"follow": "Follow",
"@follow": {
"description": "follow someone"
},
"stars": "Stars",
"@stars": {
"description": "stars on a repo"
},
"followers": "Followers",
"@followers": {
"description": "followers for a person"
},
"following": "Following",
"@following": {
"description": "people followed by a person"
},
"events": "Events",
"@events": {
"description": "events for a user"
},
"gists": "Gists",
"@gists": {
"description": "gists for a user"
},
"organizations": "Organizations",
"@organizations": {
"description": "organizations for a user"
},
"members": "Members",
"@members": {
"description": "members of an organization"
},
"popularRepositories": "popular repositories",
"@popularRepositories": {
"description": "popular repositories"
},
"pinnedRepositories": "pinned repositories",
"@pinnedRepositories": {
"description": "pinned repositories"
},
"settings": "Settings",
"@settings": {
"description": "settings"
},
"system": "system",
"@system": {
"description": "system"
},
"githubStatus": "GitHub status",
"@githubStatus": {
"description": "github status"
},
"reviewPermissions": "Review Permissions",
"@reviewPermissions": {
"description": "review Permissions"
},
"gitlabStatus": "GitLab status",
"@gitlabStatus": {
"description": "GitLab status"
},
"giteaStatus": "Gitea status",
"@giteaStatus": {
"description": "Gitea status"
},
"switchAccounts": "Switch accounts",
"@switchAccounts": {
"description": "Switch accounts"
},
"brightness": "Brightness",
"@brightness": {
"description": "brightness"
},
"followSystem": "Follow System",
"@followSystem": {
"description": "follow systems setting"
},
"light": "Light",
"@light": {
"description": "light mode"
},
"dark": "Dark",
"@dark": {
"description": "dark mode"
},
"scaffoldTheme": "Scaffold Theme",
"@scaffoldTheme": {
"description": "Kind of theme - cupertino or material"
},
"cupertino": "Cupertino",
"@cupertino": {
"description": "Cupertino scaffold theme"
},
"material": "Material",
"@material": {
"description": "Material scaffold theme"
},
"codeTheme": "Code Theme",
"@codeTheme": {
"description": "code theme"
},
"markdownRenderEngine": "Markdown Render Engine",
"@markdownRenderEngine": {
"description": "flutter or webview rendering for markdown"
},
"flutter": "Flutter",
"@flutter": {
"description": "render flutter for markdown"
},
"webview": "WebView",
"@webview": {
"description": "render webview for markdown"
},
"feedback": "feedback",
"@feedback": {
"description": "provide feedback"
},
"submitAnIssue": "Submit an issue",
"@submitAnIssue": {
"description": "submit issue for app"
},
"rateThisApp": "Rate This App",
"@rateThisApp": {
"description": "rate the app"
},
"email": "Email",
"@email": {
"description": "Email to report issues"
},
"about": "about",
"@about": {
"description": "about section"
},
"version": "Version",
"@version": {
"description": "app version"
},
"sourceCode": "Source Code",
"@sourceCode": {
"description": "source code for app"
},
"repository": "Repository",
"@repository": {
"description": "Repository screen title"
},
"repositoryActions": "Repository Actions",
"@repositoryActions": {
"description": "Repository Actions"
},
"projects": "Projects",
"@projects": {
"description": "projects"
},
"releases": "Releases",
"@releases": {
"description": "releases"
},
"watchers": "Watchers",
"@watchers": {
"description": "watchers"
},
"forks": "Forks",
"@forks": {
"description": "forks"
},
"issues": "Issues",
"@issues": {
"description": "issues"
},
"pullRequests": "Pull requests",
"@pullRequests": {
"description": "Pull Requests"
},
"commits": "Commits",
"@commits": {
"description": "Commits"
},
"branches": "Branches",
"@branches": {
"description": "branches"
},
"contributors": "Contributors",
"@contributors": {
"description": "contributors"
},
"unread": "Unread",
"@unread": {
"description": "unread"
},
"all": "All",
"@all": {
"description": "all"
},
"developers": "Developers",
"@developers": {
"description": "developers"
},
"explore": "Explore",
"@explore": {
"description": "explore"
},
"teams": "Teams",
"@teams": {
"description": "teams"
},
"file": "File",
"@file": {
"description": "file"
},
"files": "Files",
"@files": {
"description": "file plural"
},
"actions": "Actions",
"@actions": {
"description": "actions"
},
"groups": "Groups",
"@groups": {
"description": "groups"
},
"mergeRequests": "Merge Requests",
"@mergeRequests": {
"description": "Merge request"
},
"activity": "Activity",
"@activity": {
"description": "activity"
},
"project": "Project",
"@project": {
"description": "project"
},
"selectAccount": "Select account",
"@selectAccount": {
"description": "select account message"
},
"removeAccount": "Remove account",
"@removeAccount": {
"description": "remove account"
},
"somethingBadHappens": "Something bad happens:",
"@somethingBadHappens": {
"description": "error message"
},
"githubAccount": "GitHub Account",
"@githubAccount": {
"description": "Gitea Account"
},
"permissionRequiredMessage": "GitTouch needs these permissions",
"@permissionRequiredMessage": {
"description": "Permission Required Message"
},
"notFoundMessage": "Not Found",
"@notFoundMessage": {
"description": "Not found page header"
},
"notFoundTextDisplay": "Woops, This page is not implemented yet",
"@notFoundTextDisplay": {
"description": "Not found error message"
},
"gitlabAccount": "GitLab Account",
"@gitlabAccount": {
"description": "Gitlab Account"
},
"bitbucketAccount": "Bitbucket Account",
"@bitbucketAccount": {
"description": "Bitbucket Account"
},
"longPressToRemoveAccount": "Long Press to remove account",
"@longPressToRemoveAccount": {
"description": "Long Press to remove account"
},
"giteaAccount": "Gitee Account",
"@giteaAccount": {
"description": "Gitea Account"
},
"giteeAccount": "Gitee Account",
"@giteeAccount": {
"description": "Gitee Account"
},
"user": "User",
"@user": {
"description": "user"
},
"group": "Group",
"@group": {
"description": "group"
},
"issue": "Issue",
"@issue": {
"description": "issue"
},
"code": "Code",
"@code": {
"description": "Code"
},
"projectActions": "Project Actions",
"@projectActions": {
"description": "Project Actions"
},
"syntaxHighlighting": "SYNTAX HIGHLIGHTING",
"@syntaxHighlighting": {
"description": "Syntax Highlighting"
},
"fontFamily": "Font Family",
"@fontFamily": {
"description": "Font Family"
},
"fontSize": "Font Size",
"@fontSize": {
"description": "font size"
},
"fontStyle": "FONT STYLE",
"@fontStyle": {
"description": "font style"
}
}

91
lib/l10n/intl_hi.arb Normal file
View File

@ -0,0 +1,91 @@
{
"helloWorld": "नमस्ते दुनिया",
"news": "समाचार",
"notification": "अधिसूचना",
"trending": "ट्रेंडिंग",
"search": "खोज",
"me": "मैं",
"participating": "भाग लेने वाले",
"repositories": "रेपोसिटोरिएस",
"unfollow": "अनफ़ॉलो",
"follow": "फ़ोल्लोव",
"stars": "स्टार्स",
"followers": "अनुयायियों",
"following": "फोल्लोविंग",
"events": "इवेंट्स",
"gists": "गिस्ट्स",
"organizations": "संगठन",
"members": "संगठन",
"popularRepositories": "प्रसिद्ध रेपोसिटोरिएस",
"pinnedRepositories": "पिन्नेद रेपोसिटोरिएस",
"settings": "सेटिंग्स",
"system": "सिस्टम",
"githubStatus": "गिटहब स्टेटस",
"reviewPermissions": "अनुमति की समीक्षा करें",
"gitlabStatus": "गितलब स्टेटस",
"giteaStatus": "गीते स्टेटस",
"switchAccounts": "खाते बदलें",
"brightness": "द्य्रुति",
"followSystem": "सिस्टम का पालन करें",
"light": "प्रकाश मोड",
"dark": "अंधेरा मोड",
"scaffoldTheme": "स्कैफफोल्ड थीम",
"cupertino": "क्यूपर्टिनो थीम",
"material": "मटेरियल थीम",
"codeTheme": "कोड थीम",
"markdownRenderEngine": "मार्कडौं रेंडर इंजन",
"flutter": "फ्लटर",
"webview": "वेब्वयेव",
"feedback": "फीडबैक",
"submitAnIssue": "एक मुद्दा प्रस्तुत करें",
"rateThisApp": "इस ऐप्लिकेशन को रेट करे",
"email": "ईमेल",
"about": "एप्लिकेशन के बारे में",
"version": "एप्लिकेशन वेरीज़न",
"sourceCode": "एप्लिकेशन स्रोत कोड",
"ignoringWatchState": "अनदेखी",
"repository": "रिपॉजिटरी",
"repositoryActions": "रिपॉजिटरी कार्रवाई",
"projects": "परियोजनाओं",
"releases": "रेलसेस",
"watchers": "नजर रखने वालों",
"forks": "फोर्क्स",
"issues": "मुद्दे",
"pullRequests": "पुल्ल रिक्वेस्ट्स",
"commits": "कमिटस",
"branches": "ब्रांच",
"contributors": "योगदानकर्ताओं",
"unread": "अपठित",
"all": "सब",
"developers": "डेवेलपर्स",
"explore": "अन्वेषण",
"teams": "टीमों",
"file": "फ़ाइल",
"files": "फ़ाइलें",
"actions": "कार्रवाई",
"groups": "समूहों",
"mergeRequests": "मर्ज निवेदन",
"activity": "गतिविधि",
"project": "परियोजना",
"selectAccount": "खाता चुनें",
"removeAccount": "खाता हटाएं",
"somethingBadHappens": "त्रुटि हुई है: ",
"githubAccount": "गिटहब खाता",
"permissionRequiredMessage": "गिट्टूच के लीये इन अनुमतियों की आवश्यकता है",
"notFoundMessage": "नहीं मिला",
"notFoundTextDisplay": "यह पृष्ठ कार्यान्वित नहीं है",
"gitlabAccount": "गितलब खाता",
"bitbucketAccount": "बीटबुकेत खाता",
"giteaAccount": "गीते खाता",
"longPressToRemoveAccount": "खाता हटाने के लिए लंबी प्रेस",
"giteeAccount": "जीती खाता",
"user": "उपयोगकर्ता",
"group": "समूह",
"issue": "मुद्दा",
"code": "कोड",
"projectActions": "परियोजना की कार्रवाई",
"syntaxHighlighting": "सिंटेक्स हाइलाइटिंग",
"fontFamily": "फॉण्ट परिवार",
"fontSize": "फॉण्ट आकार",
"fontStyle": "फॉण्ट प्रकार"
}

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/commit_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class BbCommitsScreen extends StatelessWidget {
final String owner;
@ -16,7 +17,7 @@ class BbCommitsScreen extends StatelessWidget {
Widget build(BuildContext context) {
final auth = Provider.of<AuthModel>(context);
return ListStatefulScaffold<BbCommit, String>(
title: AppBarTitle('Commits'),
title: AppBarTitle(S.of(context).commits),
fetch: (nextUrl) async {
final res = await context.read<AuthModel>().fetchBbWithPage(
nextUrl ?? '/repositories/$owner/$name/commits/$ref');

View File

@ -5,12 +5,13 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/repository_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class BbExploreScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<BbRepo, String>(
title: AppBarTitle('Explore'),
title: AppBarTitle(S.of(context).explore),
fetch: (nextUrl) async {
final res = await context.read<AuthModel>().fetchBbWithPage(
nextUrl ?? '/repositories?role=member&sort=-updated_on');

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/issue_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class BbIssuesScreen extends StatelessWidget {
final String owner;
@ -16,7 +17,7 @@ class BbIssuesScreen extends StatelessWidget {
Widget build(BuildContext context) {
final auth = Provider.of<AuthModel>(context);
return ListStatefulScaffold<BbIssues, String>(
title: AppBarTitle('Issues'),
title: AppBarTitle(S.of(context).issues),
fetch: (nextUrl) async {
final res = await context
.read<AuthModel>()

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/issue_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class BbPullsScreen extends StatelessWidget {
final String owner;
@ -16,7 +17,7 @@ class BbPullsScreen extends StatelessWidget {
Widget build(BuildContext context) {
final auth = Provider.of<AuthModel>(context);
return ListStatefulScaffold<BbPulls, String>(
title: AppBarTitle('Pull requests'),
title: AppBarTitle(S.of(context).pullRequests),
fetch: (nextUrl) async {
final res = await context.read<AuthModel>().fetchBbWithPage(
nextUrl ?? '/repositories/$owner/$name/pullrequests');

View File

@ -13,6 +13,7 @@ import 'package:git_touch/widgets/repo_header.dart';
import 'package:git_touch/widgets/table_view.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import '../generated/l10n.dart';
class BbRepoScreen extends StatelessWidget {
final String owner;
@ -22,7 +23,7 @@ class BbRepoScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<Tuple2<BbRepo, String>>(
title: AppBarTitle('Repository'),
title: AppBarTitle(S.of(context).repository),
fetch: () async {
final auth = context.read<AuthModel>();
final r = await auth.fetchBbJson('/repositories/$owner/$name');

View File

@ -6,12 +6,13 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
class BbTeamsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<BbUser, String>(
title: AppBarTitle('Teams'),
title: AppBarTitle(S.of(context).teams),
fetch: (nextUrl) async {
final res = await context
.read<AuthModel>()

View File

@ -9,6 +9,7 @@ import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/table_view.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class CodeThemeScreen extends StatelessWidget {
String _getCode(bool isDark) => '''// ${isDark ? 'Dark' : 'Light'} Mode
@ -38,16 +39,16 @@ class MyApp extends StatelessWidget {
var theme = Provider.of<ThemeModel>(context);
return SingleScaffold(
title: AppBarTitle('Code theme'),
title: AppBarTitle(S.of(context).codeTheme),
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
CommonStyle.verticalGap,
TableView(
headerText: 'FONT STYLE',
headerText: S.of(context).fontStyle,
items: [
TableViewItem(
text: Text('Font Size'),
text: Text(S.of(context).fontSize),
rightWidget: Text(codeProvider.fontSize.toString()),
onTap: () {
theme.showPicker(
@ -66,7 +67,7 @@ class MyApp extends StatelessWidget {
},
),
TableViewItem(
text: Text('Font Family'),
text: Text(S.of(context).fontFamily),
rightWidget: Text(codeProvider.fontFamily),
onTap: () {
theme.showPicker(
@ -87,10 +88,10 @@ class MyApp extends StatelessWidget {
),
CommonStyle.verticalGap,
TableView(
headerText: 'SYNTAX HIGHLIGHTING',
headerText: S.of(context).syntaxHighlighting,
items: [
TableViewItem(
text: Text('Light Mode'),
text: Text(S.of(context).light),
rightWidget: Text(codeProvider.theme),
onTap: () {
theme.showPicker(
@ -108,7 +109,7 @@ class MyApp extends StatelessWidget {
},
),
TableViewItem(
text: Text('Dark Mode'),
text: Text(S.of(context).dark),
rightWidget: Text(codeProvider.themeDark),
onTap: () {
theme.showPicker(

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/action_entry.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/blob_view.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GeBlobScreen extends StatelessWidget {
final String owner;
@ -17,7 +18,7 @@ class GeBlobScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<String>(
title: AppBarTitle('File'),
title: AppBarTitle(S.of(context).file),
fetch: () async {
final auth = context.read<AuthModel>();
final res = await auth.fetchGitee('/repos/$owner/$name/git/blobs/$sha');

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/commit_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GeCommitsScreen extends StatelessWidget {
final String owner;
@ -15,7 +16,7 @@ class GeCommitsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GiteeCommit, int>(
title: AppBarTitle('Commits'),
title: AppBarTitle(S.of(context).commits),
fetch: (page) async {
final res = await context
.read<AuthModel>()

View File

@ -13,6 +13,7 @@ import 'package:git_touch/widgets/table_view.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:http/http.dart' as http;
import '../generated/l10n.dart';
class GeRepoScreen extends StatelessWidget {
final String owner;
@ -22,7 +23,7 @@ class GeRepoScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<Tuple2<GiteeRepo, MarkdownViewData>>(
title: AppBarTitle('Repository'),
title: AppBarTitle(S.of(context).repository),
fetch: () async {
final auth = context.read<AuthModel>();
final repo = await auth.fetchGitee('/repos/$owner/$name').then((v) {

View File

@ -1,12 +1,13 @@
import 'package:flutter/material.dart';
import 'package:git_touch/scaffolds/refresh_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import '../generated/l10n.dart';
class GeSearchScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<String>(
title: AppBarTitle('Search'),
title: AppBarTitle(S.of(context).search),
fetch: () async {
return '';
},

View File

@ -7,6 +7,7 @@ import 'package:git_touch/widgets/object_tree.dart';
import 'package:flutter/material.dart';
import 'package:git_touch/models/auth.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GeTreeScreen extends StatelessWidget {
final String owner;
@ -17,7 +18,7 @@ class GeTreeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<List<GiteeTreeItem>>(
title: AppBarTitle('Files'),
title: AppBarTitle(S.of(context).files),
fetch: () async {
final res = await context
.read<AuthModel>()

View File

@ -6,6 +6,7 @@ import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/commit_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GhCommitsScreen extends StatelessWidget {
final String owner;
@ -28,7 +29,7 @@ class GhCommitsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GhCommitsCommit, String>(
title: AppBarTitle('Commits'),
title: AppBarTitle(S.of(context).commits),
fetch: (cursor) async {
final res = await context.read<AuthModel>().gqlClient.execute(
GhCommitsQuery(

View File

@ -7,6 +7,7 @@ import 'package:provider/provider.dart';
import 'package:git_touch/widgets/files_item.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/widgets/action_button.dart';
import '../generated/l10n.dart';
class GhComparisonScreen extends StatelessWidget {
final String owner;
@ -17,7 +18,7 @@ class GhComparisonScreen extends StatelessWidget {
Widget build(BuildContext context) {
return RefreshStatefulScaffold(
title: AppBarTitle('Files'),
title: AppBarTitle(S.of(context).files),
fetch: () async {
final res = await context.read<AuthModel>().ghClient.getJSON(
'/repos/$owner/$name/compare/$before...$head',
@ -26,7 +27,7 @@ class GhComparisonScreen extends StatelessWidget {
},
actionBuilder: (v, _) {
return ActionButton(
title: 'Actions',
title: S.of(context).actions,
items: [
...ActionItem.getUrlActions(
'https://github.com/$owner/$name/compare/$before...$head'),

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/contributor_item.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhContributorsScreen extends StatelessWidget {
final String owner;
@ -14,7 +15,7 @@ class GhContributorsScreen extends StatelessWidget {
Widget build(BuildContext context) {
return ListStatefulScaffold<GithubContributorItem, int>(
title: AppBarTitle('Contributors'),
title: AppBarTitle(S.of(context).contributors),
fetch: (page) async {
page = page ?? 1;
final res = await context

View File

@ -7,6 +7,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/widgets/event_item.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhEventsScreen extends StatelessWidget {
final String login;
@ -15,7 +16,7 @@ class GhEventsScreen extends StatelessWidget {
@override
Widget build(context) {
return ListStatefulScaffold<GithubEvent, int>(
title: AppBarTitle('Events'),
title: AppBarTitle(S.of(context).events),
itemBuilder: (payload) => EventItem(payload),
fetch: (page) async {
page = page ?? 1;

View File

@ -7,6 +7,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/widgets/files_item.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhFilesScreen extends StatelessWidget {
final String owner;
@ -16,7 +17,7 @@ class GhFilesScreen extends StatelessWidget {
Widget build(BuildContext context) {
return ListStatefulScaffold<GithubFilesItem, int>(
title: AppBarTitle('Files'),
title: AppBarTitle(S.of(context).files),
actionBuilder: () {
return ActionButton(
title: 'Actions',

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/gists_item.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhGistsScreen extends StatelessWidget {
final String login;
@ -14,7 +15,7 @@ class GhGistsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GithubGistsItem, int>(
title: AppBarTitle('Gists'),
title: AppBarTitle(S.of(context).gists),
fetch: (page) async {
page = page ?? 1;
final res = await context

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/object_tree.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhGistsFilesScreen extends StatelessWidget {
final String id;
@ -15,7 +16,7 @@ class GhGistsFilesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<GithubGistsItem>(
title: AppBarTitle('Files'),
title: AppBarTitle(S.of(context).files),
fetch: () async {
final data = await context.read<AuthModel>().ghClient.getJSON(
'/gists/$id',

View File

@ -8,6 +8,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/issue_item.dart';
import 'package:git_touch/widgets/label.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GhIssuesScreen extends StatelessWidget {
final String owner;
@ -17,7 +18,7 @@ class GhIssuesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GhIssuesIssue, String>(
title: AppBarTitle('Issues'),
title: AppBarTitle(S.of(context).issues),
actionBuilder: () => ActionEntry(
iconData: Octicons.plus,
url: '/github/$owner/$name/issues/new',

View File

@ -8,6 +8,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/widgets/event_item.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhNewsScreen extends StatefulWidget {
@override
@ -35,7 +36,7 @@ class GhNewsScreenState extends State<GhNewsScreen> {
@override
Widget build(context) {
return ListStatefulScaffold<GithubEvent, int>(
title: AppBarTitle('News'),
title: AppBarTitle(S.of(context).news),
itemBuilder: (payload) => EventItem(payload),
fetch: (page) async {
page = page ?? 1;

View File

@ -13,6 +13,7 @@ import '../widgets/notification_item.dart';
import '../widgets/list_group.dart';
import '../widgets/empty.dart';
import '../utils/utils.dart';
import '../generated/l10n.dart';
class GhNotificationScreen extends StatefulWidget {
@override
@ -156,8 +157,12 @@ ${item.key}: pullRequest(number: ${item.subject.number}) {
@override
Widget build(context) {
return TabStatefulScaffold(
title: AppBarTitle('Notifications'),
tabs: ['Unread', 'Participating', 'All'],
title: AppBarTitle(S.of(context).notification),
tabs: [
S.of(context).unread,
S.of(context).participating,
S.of(context).all
],
fetchData: fetchNotifications,
bodyBuilder: (groupMap, activeTab) {
if (groupMap.isEmpty) return EmptyWidget();

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/repository_item.dart';
import 'package:provider/provider.dart';
import 'package:github/github.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
/// There are some restrictions of organization repos with OAuth
///
@ -19,7 +20,7 @@ class GhOrgReposScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<Repository, int>(
title: AppBarTitle('Repositories'),
title: AppBarTitle(S.of(context).repositories),
fetch: (page) async {
page = page ?? 1;
final rs = await context

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/models/auth.dart';
import '../generated/l10n.dart';
class GhUserOrganizationScreen extends StatelessWidget {
final String login;
@ -13,7 +14,7 @@ class GhUserOrganizationScreen extends StatelessWidget {
Widget build(BuildContext context) {
return ListStatefulScaffold<GithubUserOrganizationItem, int>(
title: AppBarTitle('Organizations'),
title: AppBarTitle(S.of(context).organizations),
fetch: (page) async {
page = page ?? 1;
final res = await context

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/issue_item.dart';
import 'package:git_touch/widgets/label.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GhPullsScreen extends StatelessWidget {
final String owner;
@ -15,7 +16,7 @@ class GhPullsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GhPullsPullRequest, String>(
title: AppBarTitle('Pull requests'),
title: AppBarTitle(S.of(context).pullRequests),
fetch: (cursor) async {
final res =
await context.read<AuthModel>().gqlClient.execute(GhPullsQuery(

View File

@ -19,6 +19,7 @@ import 'package:git_touch/models/theme.dart';
import 'package:tuple/tuple.dart';
import 'package:git_touch/widgets/action_button.dart';
import 'package:universal_io/prefer_universal/io.dart';
import '../generated/l10n.dart';
class GhRepoScreen extends StatelessWidget {
final String owner;
@ -54,7 +55,7 @@ class GhRepoScreen extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context);
return RefreshStatefulScaffold<
Tuple3<GhRepoRepository, Future<int>, MarkdownViewData>>(
title: AppBarTitle('Repository'),
title: AppBarTitle(S.of(context).repository),
fetch: () async {
final ghClient = context.read<AuthModel>().ghClient;
@ -89,14 +90,14 @@ class GhRepoScreen extends StatelessWidget {
actionBuilder: (data, setState) {
final repo = data.item1;
return ActionButton(
title: 'Repository Actions',
title: S.of(context).repositoryActions,
items: [
ActionItem(
text: 'Projects(${repo.projects.totalCount})',
text: S.of(context).projects + '(${repo.projects.totalCount})',
url: repo.projectsUrl,
),
ActionItem(
text: 'Releases(${repo.releases.totalCount})',
text: S.of(context).releases + '(${repo.releases.totalCount})',
url: 'https://github.com/$owner/$name/releases',
),
...ActionItem.getUrlActions(repo.url),
@ -235,17 +236,17 @@ class GhRepoScreen extends StatelessWidget {
children: <Widget>[
EntryItem(
count: repo.watchers.totalCount,
text: 'Watchers',
text: S.of(context).watchers,
url: '/github/$owner/$name/watchers',
),
EntryItem(
count: repo.stargazers.totalCount,
text: 'Stars',
text: S.of(context).stars,
url: '/github/$owner/$name/stargazers',
),
EntryItem(
count: repo.forks.totalCount,
text: 'Forks',
text: S.of(context).forks,
url: 'https://github.com/$owner/$name/network/members',
),
],
@ -277,14 +278,14 @@ class GhRepoScreen extends StatelessWidget {
if (repo.hasIssuesEnabled)
TableViewItem(
leftIconData: Octicons.issue_opened,
text: Text('Issues'),
text: Text(S.of(context).issues),
rightWidget:
Text(numberFormat.format(repo.issues.totalCount)),
url: '/github/$owner/$name/issues',
),
TableViewItem(
leftIconData: Octicons.git_pull_request,
text: Text('Pull requests'),
text: Text(S.of(context).pullRequests),
rightWidget:
Text(numberFormat.format(repo.pullRequests.totalCount)),
url: '/github/$owner/$name/pulls',
@ -292,7 +293,7 @@ class GhRepoScreen extends StatelessWidget {
if (ref != null) ...[
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
text: Text(S.of(context).commits),
rightWidget: Text(
((ref.target as GhRepoCommit).history?.totalCount ?? 0)
.toString()),
@ -301,7 +302,7 @@ class GhRepoScreen extends StatelessWidget {
if (repo.refs != null)
TableViewItem(
leftIconData: Octicons.git_branch,
text: Text('Branches'),
text: Text(S.of(context).branches),
rightWidget: Text(ref.name +
'' +
numberFormat.format(repo.refs.totalCount)),
@ -329,7 +330,7 @@ class GhRepoScreen extends StatelessWidget {
),
TableViewItem(
leftIconData: Octicons.organization,
text: Text('Contributors'),
text: Text(S.of(context).contributors),
rightWidget: FutureBuilder<int>(
future: contributionFuture,
builder: (context, snapshot) {

View File

@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/widgets/repository_item.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
class GhSearchScreen extends StatefulWidget {
@override
@ -125,7 +126,7 @@ class _GhSearchScreenState extends State<GhSearchScreen> {
Icon(Octicons.search, size: 20, color: PrimerColors.gray400),
],
),
placeholder: 'Search',
placeholder: S.of(context).search,
clearButtonMode: OverlayVisibilityMode.editing,
textInputAction: TextInputAction.go,
onSubmitted: (_) => _query(),
@ -134,7 +135,7 @@ class _GhSearchScreenState extends State<GhSearchScreen> {
);
default:
return TextField(
decoration: InputDecoration.collapsed(hintText: 'Search'),
decoration: InputDecoration.collapsed(hintText: S.of(context).search),
textInputAction: TextInputAction.go,
onSubmitted: (_) => _query(),
controller: _controller,

View File

@ -8,14 +8,15 @@ import 'package:git_touch/widgets/user_item.dart';
import 'package:github_trending/github_trending.dart';
import 'package:git_touch/widgets/repository_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GhTrendingScreen extends StatelessWidget {
static final trending = GithubTrending(prefix: 'https://gtrend.yapie.me');
Widget build(BuildContext context) {
return TabStatefulScaffold<List>(
title: AppBarTitle('Trending'),
tabs: ['Repositories', 'Developers'],
title: AppBarTitle(S.of(context).trending),
tabs: [S.of(context).repositories, S.of(context).developers],
fetchData: (tabIndex) async {
if (tabIndex == 0) {
return trending.getTrendingRepositories();

View File

@ -16,6 +16,7 @@ import 'package:git_touch/models/auth.dart';
import 'package:git_touch/widgets/user_header.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/widgets/action_button.dart';
import '../generated/l10n.dart';
class GhUserScreen extends StatelessWidget {
final String login;
@ -77,7 +78,9 @@ class GhUserScreen extends StatelessWidget {
if (p.viewerCanFollow)
MutationButton(
active: p.viewerIsFollowing,
text: p.viewerIsFollowing ? 'Unfollow' : 'Follow',
text: p.viewerIsFollowing
? S.of(context).unfollow
: S.of(context).follow,
onTap: () async {
if (p.viewerIsFollowing) {
await auth.ghClient.users.unfollowUser(p.login);
@ -95,22 +98,22 @@ class GhUserScreen extends StatelessWidget {
Row(children: [
EntryItem(
count: p.repositories.totalCount,
text: 'Repositories',
text: S.of(context).repositories,
url: '/github/$login?tab=repositories',
),
EntryItem(
count: p.starredRepositories.totalCount,
text: 'Stars',
text: S.of(context).stars,
url: '/github/$login?tab=stars',
),
EntryItem(
count: p.followers.totalCount,
text: 'Followers',
text: S.of(context).followers,
url: '/github/$login?tab=followers',
),
EntryItem(
count: p.following.totalCount,
text: 'Following',
text: S.of(context).following,
url: '/github/$login?tab=following',
),
]),
@ -132,17 +135,17 @@ class GhUserScreen extends StatelessWidget {
items: [
TableViewItem(
leftIconData: Icons.rss_feed,
text: Text('Events'),
text: Text(S.of(context).events),
url: '/github/$login?tab=events',
),
TableViewItem(
leftIconData: Octicons.book,
text: Text('Gists'),
text: Text(S.of(context).gists),
url: '/github/$login?tab=gists',
),
TableViewItem(
leftIconData: Octicons.home,
text: Text('Organizations'),
text: Text(S.of(context).organizations),
url: '/github/$login?tab=organizations',
),
if (isNotNullOrEmpty(p.company))
@ -229,12 +232,12 @@ class GhUserScreen extends StatelessWidget {
Row(children: [
EntryItem(
count: p.pinnableItems.totalCount,
text: 'Repositories',
text: S.of(context).repositories,
url: '/github/${p.login}?tab=orgrepo',
),
EntryItem(
count: p.membersWithRole.totalCount,
text: 'Members',
text: S.of(context).members,
url: '/github/${p.login}?tab=people',
),
]),
@ -243,7 +246,7 @@ class GhUserScreen extends StatelessWidget {
items: [
TableViewItem(
leftIconData: Icons.rss_feed,
text: Text('Events'),
text: Text(S.of(context).events),
url: '/github/$login?tab=events',
),
if (isNotNullOrEmpty(p.location))
@ -301,7 +304,7 @@ class GhUserScreen extends StatelessWidget {
GhUserArguments(login: login ?? '', isViewer: isViewer)));
return isViewer ? data.data.viewer : data.data.repositoryOwner;
},
title: AppBarTitle(isViewer ? 'Me' : login),
title: AppBarTitle(isViewer ? S.of(context).me : login),
action: isViewer
? ActionEntry(
iconData: Icons.settings,

View File

@ -9,6 +9,7 @@ import 'package:git_touch/scaffolds/refresh_stateful.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
// TODO:
class GlCommitScreen extends StatelessWidget {
@ -29,7 +30,7 @@ class GlCommitScreen extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context);
return RefreshStatefulScaffold<List<GitlabDiff>>(
title: AppBarTitle('Commits'),
title: AppBarTitle(S.of(context).commits),
fetch: () => _query(context),
bodyBuilder: (items, _) {
return Column(

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/commit_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GlCommitsScreen extends StatelessWidget {
final String id;
@ -15,7 +16,7 @@ class GlCommitsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabCommit, int>(
title: AppBarTitle('Commits'),
title: AppBarTitle(S.of(context).commits),
fetch: (page) async {
page = page ?? 1;
final auth = context.read<AuthModel>();

View File

@ -6,12 +6,13 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/repository_item.dart';
import 'package:provider/provider.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
class GlExploreScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabProject, int>(
title: AppBarTitle('Explore'),
title: AppBarTitle(S.of(context).explore),
fetch: (page) async {
page = page ?? 1;
final auth = context.read<AuthModel>();

View File

@ -10,6 +10,7 @@ import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
class GlGroupScreen extends StatelessWidget {
final int id;
@ -18,7 +19,7 @@ class GlGroupScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<Tuple2<GitlabGroup, int>>(
title: Text('Group'),
title: Text(S.of(context).group),
fetch: () async {
final auth = context.read<AuthModel>();
final res = await Future.wait([

View File

@ -5,12 +5,13 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GlGroupsScreenn extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabGroup, int>(
title: AppBarTitle('Groups'),
title: AppBarTitle(S.of(context).groups),
fetch: (page) async {
page = page ?? 1;
final auth = context.read<AuthModel>();

View File

@ -7,6 +7,7 @@ import 'package:git_touch/widgets/comment_item.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/models/auth.dart';
import 'package:tuple/tuple.dart';
import '../generated/l10n.dart';
class GlIssueScreen extends StatelessWidget {
final int projectId;
@ -19,7 +20,7 @@ class GlIssueScreen extends StatelessWidget {
Widget build(BuildContext context) {
return RefreshStatefulScaffold<
Tuple3<GitlabTodoTarget, Iterable<GitlabIssueNote>, List>>(
title: Text('Issue #$iid'),
title: Text(S.of(context).issue + '#$iid'),
fetch: () async {
final type = isMr ? 'merge_requests' : 'issues';
final auth = context.read<AuthModel>();

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/issue_item.dart';
import 'package:git_touch/widgets/label.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GlIssuesScreen extends StatelessWidget {
final String id;
@ -15,7 +16,7 @@ class GlIssuesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabIssue, int>(
title: AppBarTitle('Issues'),
title: AppBarTitle(S.of(context).issues),
// TODO: create issue
fetch: (page) async {
page = page ?? 1;

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GlMembersScreen extends StatelessWidget {
final int id;
@ -23,7 +24,7 @@ class GlMembersScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabUser, int>(
title: AppBarTitle('Members'),
title: AppBarTitle(S.of(context).members),
fetch: (page) async {
page = page ?? 1;
final auth = context.read<AuthModel>();

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/issue_item.dart';
import 'package:git_touch/widgets/label.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GlMergeRequestsScreen extends StatelessWidget {
final String id;
@ -15,7 +16,7 @@ class GlMergeRequestsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabIssue, int>(
title: AppBarTitle('Merge Requests'),
title: AppBarTitle(S.of(context).mergeRequests),
fetch: (page) async {
page = page ?? 1;
final res = await context.read<AuthModel>().fetchGitlabWithPage(

View File

@ -15,6 +15,7 @@ import 'package:provider/provider.dart';
import 'package:git_touch/models/theme.dart';
import 'package:git_touch/widgets/action_button.dart';
import 'package:tuple/tuple.dart';
import '../generated/l10n.dart';
class GlProjectScreen extends StatelessWidget {
final int id;
@ -25,7 +26,7 @@ class GlProjectScreen extends StatelessWidget {
return RefreshStatefulScaffold<
Tuple4<GitlabProject, Future<Map<String, double>>, Future<int>,
MarkdownViewData>>(
title: AppBarTitle('Project'),
title: AppBarTitle(S.of(context).project),
fetch: () async {
final auth = context.read<AuthModel>();
final p =
@ -67,7 +68,7 @@ class GlProjectScreen extends StatelessWidget {
},
actionBuilder: (t, setState) {
return ActionButton(
title: 'Project Actions',
title: S.of(context).projectActions,
items: [
...ActionItem.getUrlActions(t.item1.webUrl),
],
@ -111,19 +112,19 @@ class GlProjectScreen extends StatelessWidget {
builder: (context, snapshot) {
return EntryItem(
count: snapshot.data,
text: 'Members',
text: S.of(context).members,
url: '/gitlab/projects/$id/members',
);
},
),
EntryItem(
count: p.starCount,
text: 'Stars',
text: S.of(context).stars,
url: '/gitlab/projects/$id/starrers',
),
EntryItem(
count: p.forksCount,
text: 'Forks', // TODO:
text: S.of(context).forks, // TODO:
),
],
),
@ -156,7 +157,8 @@ class GlProjectScreen extends StatelessWidget {
return Text('');
} else {
final langs = snapshot.data.keys;
return Text(langs.isEmpty ? 'Code' : langs.first);
return Text(
langs.isEmpty ? S.of(context).code : langs.first);
}
},
),
@ -168,19 +170,19 @@ class GlProjectScreen extends StatelessWidget {
if (p.issuesEnabled)
TableViewItem(
leftIconData: Octicons.issue_opened,
text: Text('Issues'),
text: Text(S.of(context).issues),
rightWidget: Text(numberFormat.format(p.openIssuesCount)),
url: '/gitlab/projects/$id/issues?prefix=$prefix',
),
if (p.mergeRequestsEnabled)
TableViewItem(
leftIconData: Octicons.git_pull_request,
text: Text('Merge requests'),
text: Text(S.of(context).mergeRequests),
url: '/gitlab/projects/$id/merge_requests?prefix=$prefix',
),
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
text: Text(S.of(context).commits),
rightWidget: p.statistics == null
? null
: Text(p.statistics.commitCount.toString()),

View File

@ -8,6 +8,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/avatar.dart';
import 'package:git_touch/widgets/link.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GlProjectActivityScreen extends StatelessWidget {
final int id;
@ -17,7 +18,7 @@ class GlProjectActivityScreen extends StatelessWidget {
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
return ListStatefulScaffold<GitlabEvent, int>(
title: AppBarTitle('Activity'),
title: AppBarTitle(S.of(context).activity),
fetch: (page) async {
page = page ?? 1;
final auth = context.read<AuthModel>();

View File

@ -11,6 +11,7 @@ import 'package:git_touch/models/auth.dart';
import 'package:git_touch/widgets/repository_item.dart';
import 'package:timeago/timeago.dart' as timeago;
import 'package:git_touch/models/gitlab.dart';
import '../generated/l10n.dart';
class GlSearchScreen extends StatefulWidget {
@override
@ -74,7 +75,7 @@ class _GlSearchScreenState extends State<GlSearchScreen> {
Icon(Octicons.search, size: 20, color: PrimerColors.gray400),
],
),
placeholder: 'Search',
placeholder: S.of(context).search,
clearButtonMode: OverlayVisibilityMode.editing,
textInputAction: TextInputAction.go,
onSubmitted: (_) => _query(),
@ -83,7 +84,7 @@ class _GlSearchScreenState extends State<GlSearchScreen> {
);
default:
return TextField(
decoration: InputDecoration.collapsed(hintText: 'Search'),
decoration: InputDecoration.collapsed(hintText: S.of(context).search),
textInputAction: TextInputAction.go,
onSubmitted: (_) => _query(),
controller: _controller,

View File

@ -6,6 +6,7 @@ import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
class GlStarrersScreen extends StatelessWidget {
final int id;
@ -14,7 +15,7 @@ class GlStarrersScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GitlabStarrer, int>(
title: AppBarTitle('Members'),
title: AppBarTitle(S.of(context).members),
fetch: (page) async {
page = page ?? 1;
final res = await context

View File

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:git_touch/models/auth.dart';
import 'package:provider/provider.dart';
import 'package:git_touch/utils/utils.dart';
import '../generated/l10n.dart';
class GlTreeScreen extends StatelessWidget {
final int id;
@ -18,7 +19,7 @@ class GlTreeScreen extends StatelessWidget {
Widget build(BuildContext context) {
final auth = Provider.of<AuthModel>(context);
return RefreshStatefulScaffold<Iterable<GitlabTreeItem>>(
title: AppBarTitle(path ?? 'Files'),
title: AppBarTitle(path ?? S.of(context).files),
fetch: () async {
final uri = Uri(
path: '/projects/$id/repository/tree',

View File

@ -10,6 +10,7 @@ import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:timeago/timeago.dart' as timeago;
import '../generated/l10n.dart';
class GlUserScreen extends StatelessWidget {
final int id;
@ -19,7 +20,7 @@ class GlUserScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<Tuple2<GitlabUser, Iterable<GitlabProject>>>(
title: Text(isViewer ? 'Me' : 'User'),
title: Text(isViewer ? S.of(context).me : S.of(context).user),
fetch: () async {
final auth = context.read<AuthModel>();
final _id = id ?? auth.activeAccount.gitlabId;

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/commit_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GtCommitsScreen extends StatelessWidget {
final String owner;
@ -15,7 +16,7 @@ class GtCommitsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GiteaCommit, int>(
title: AppBarTitle('Commits'),
title: AppBarTitle(S.of(context).commits),
fetch: (page) async {
final res = await context
.read<AuthModel>()

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:git_touch/generated/l10n.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/gitea.dart';
import 'package:git_touch/scaffolds/list_stateful.dart';
@ -15,7 +16,8 @@ class GtIssuesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GiteaIssue, int>(
title: AppBarTitle(isPr ? 'Pull Requests' : 'Issues'),
title:
AppBarTitle(isPr ? S.of(context).pullRequests : S.of(context).issues),
// TODO: create issue
fetch: (page) async {
final type = isPr ? 'pulls' : 'issues';

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:git_touch/generated/l10n.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/models/gitea.dart';
import 'package:git_touch/scaffolds/refresh_stateful.dart';
@ -18,7 +19,7 @@ class GtObjectScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold(
title: AppBarTitle(path ?? 'Files'),
title: AppBarTitle(path ?? S.of(context).files),
fetch: () async {
final suffix = path == null ? '' : '/$path';
final res = await context

View File

@ -5,6 +5,7 @@ import 'package:git_touch/scaffolds/list_stateful.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import 'package:git_touch/widgets/user_item.dart';
import 'package:provider/provider.dart';
import '../generated/l10n.dart';
class GtOrgsScreen extends StatelessWidget {
final String api;
@ -14,7 +15,7 @@ class GtOrgsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListStatefulScaffold<GiteaOrg, int>(
title: AppBarTitle('Organizations'),
title: AppBarTitle(S.of(context).organizations),
fetch: (page) async {
final res =
await context.read<AuthModel>().fetchGiteaWithPage(api, page: page);

View File

@ -15,6 +15,7 @@ import 'package:git_touch/widgets/table_view.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:http/http.dart' as http;
import '../generated/l10n.dart';
class GtRepoScreen extends StatelessWidget {
final String owner;
@ -24,7 +25,7 @@ class GtRepoScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<Tuple2<GiteaRepository, MarkdownViewData>>(
title: AppBarTitle('Repository'),
title: AppBarTitle(S.of(context).repository),
fetch: () async {
final auth = context.read<AuthModel>();
final repo = await auth.fetchGitea('/repos/$owner/$name').then((v) {

View File

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:git_touch/generated/l10n.dart';
import 'package:git_touch/models/auth.dart';
import 'package:git_touch/scaffolds/refresh_stateful.dart';
import 'package:git_touch/widgets/blob_view.dart';
@ -10,7 +11,7 @@ class GtStatusScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RefreshStatefulScaffold<String>(
title: Text('Gitea status'),
title: Text(S.of(context).giteaStatus),
fetch: () async {
final auth = context.read<AuthModel>();
final res = await Future.wait([

View File

@ -12,6 +12,7 @@ import 'package:provider/provider.dart';
import '../widgets/link.dart';
import '../widgets/loading.dart';
import '../widgets/avatar.dart';
import '../generated/l10n.dart';
class LoginScreen extends StatefulWidget {
@override
@ -45,7 +46,7 @@ class _LoginScreenState extends State<LoginScreen> {
onLongPress: () {
theme.showActions(context, [
ActionItem(
text: 'Remove account',
text: S.of(context).removeAccount,
isDestructiveAction: true,
onTap: (_) {
auth.removeAccount(index);
@ -130,7 +131,7 @@ class _LoginScreenState extends State<LoginScreen> {
void showError(err) {
context
.read<ThemeModel>()
.showConfirm(context, Text('Something bad happens: $err'));
.showConfirm(context, Text(S.of(context).somethingBadHappens + '$err'));
}
@override
@ -138,7 +139,7 @@ class _LoginScreenState extends State<LoginScreen> {
final auth = Provider.of<AuthModel>(context);
final theme = Provider.of<ThemeModel>(context);
return SingleScaffold(
title: AppBarTitle('Select account'),
title: AppBarTitle(S.of(context).selectAccount),
body: auth.loading
? Center(child: Loading())
: Container(
@ -146,7 +147,7 @@ class _LoginScreenState extends State<LoginScreen> {
children: [
...List.generate(auth.accounts.length, _buildAccountItem),
_buildAddItem(
text: 'GitHub Account',
text: S.of(context).githubAccount,
brand: FontAwesome5Brands.github,
onTap: () async {
theme.showActions(context, [
@ -163,7 +164,7 @@ class _LoginScreenState extends State<LoginScreen> {
context,
_buildPopup(context, notes: [
Text(
'GitTouch needs these permissions',
S.of(context).permissionRequiredMessage,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400),
@ -192,7 +193,7 @@ class _LoginScreenState extends State<LoginScreen> {
},
),
_buildAddItem(
text: 'GitLab Account',
text: S.of(context).gitlabAccount,
brand: FontAwesome5Brands.gitlab,
onTap: () async {
_domainController.text = 'https://gitlab.com';
@ -203,7 +204,7 @@ class _LoginScreenState extends State<LoginScreen> {
showDomain: true,
notes: [
Text(
'GitTouch needs these permissions',
S.of(context).permissionRequiredMessage,
style: TextStyle(
fontSize: 14, fontWeight: FontWeight.w400),
),
@ -228,7 +229,7 @@ class _LoginScreenState extends State<LoginScreen> {
},
),
_buildAddItem(
text: 'Bitbucket Account',
text: S.of(context).bitbucketAccount,
brand: FontAwesome5Brands.bitbucket,
onTap: () async {
_domainController.text = 'https://bitbucket.org';
@ -269,7 +270,7 @@ class _LoginScreenState extends State<LoginScreen> {
),
SizedBox(height: 8),
Text(
'GitTouch needs these permissions',
S.of(context).permissionRequiredMessage,
style: TextStyle(
fontSize: 14, fontWeight: FontWeight.w400),
),
@ -295,7 +296,7 @@ class _LoginScreenState extends State<LoginScreen> {
},
),
_buildAddItem(
text: 'Gitea Account',
text: S.of(context).giteaAccount,
brand: Octicons.git_branch, // TODO: brand icon
onTap: () async {
_domainController.text = 'https://gitea.com';
@ -315,7 +316,7 @@ class _LoginScreenState extends State<LoginScreen> {
},
),
_buildAddItem(
text: 'Gitee Account(码云)',
text: S.of(context).giteeAccount + '(码云)',
brand: Octicons.git_branch, // TODO: brand icon
onTap: () async {
final result = await theme.showConfirm(
@ -335,7 +336,7 @@ class _LoginScreenState extends State<LoginScreen> {
Container(
padding: CommonStyle.padding,
child: Text(
'Note: Long press to remove account',
S.of(context).longPressToRemoveAccount,
style: TextStyle(
fontSize: 16,
color: theme.palette.secondaryText,

View File

@ -1,13 +1,14 @@
import 'package:flutter/material.dart';
import 'package:git_touch/scaffolds/single.dart';
import 'package:git_touch/widgets/app_bar_title.dart';
import '../generated/l10n.dart';
class NotFoundScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SingleScaffold(
title: AppBarTitle('Not Found'),
body: Text('Woops, This page is not implemented yet'),
title: AppBarTitle(S.of(context).notFoundMessage),
body: Text(S.of(context).notFoundTextDisplay),
);
}
}

View File

@ -12,6 +12,7 @@ import 'package:launch_review/launch_review.dart';
import 'package:package_info/package_info.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import '../generated/l10n.dart';
class SettingsScreen extends StatelessWidget {
Widget _buildRightWidget(BuildContext context, bool checked) {
@ -26,18 +27,18 @@ class SettingsScreen extends StatelessWidget {
final auth = Provider.of<AuthModel>(context);
final code = Provider.of<CodeModel>(context);
return SingleScaffold(
title: AppBarTitle('Settings'),
title: AppBarTitle(S.of(context).settings),
body: Column(
children: <Widget>[
CommonStyle.verticalGap,
TableView(headerText: 'system', items: [
TableView(headerText: S.of(context).system, items: [
if (auth.activeAccount.platform == PlatformType.github) ...[
TableViewItem(
text: Text('GitHub status'),
text: Text(S.of(context).githubStatus),
url: 'https://www.githubstatus.com/',
),
TableViewItem(
text: Text('Review Permissions'),
text: Text(S.of(context).reviewPermissions),
url:
'https://github.com/settings/connections/applications/$clientId',
rightWidget: Text(auth.activeAccount.login),
@ -45,7 +46,7 @@ class SettingsScreen extends StatelessWidget {
],
if (auth.activeAccount.platform == PlatformType.gitlab)
TableViewItem(
text: Text('GitLab status'),
text: Text(S.of(context).gitlabStatus),
url: '${auth.activeAccount.domain}/help',
rightWidget: FutureBuilder<String>(
future:
@ -58,7 +59,7 @@ class SettingsScreen extends StatelessWidget {
if (auth.activeAccount.platform == PlatformType.gitea)
TableViewItem(
leftIconData: Octicons.info,
text: Text('Gitea status'),
text: Text(S.of(context).giteaStatus),
url: '/gitea/status',
rightWidget: FutureBuilder<String>(
future: auth.fetchGitea('/version').then((v) => v['version']),
@ -68,7 +69,7 @@ class SettingsScreen extends StatelessWidget {
),
),
TableViewItem(
text: Text('Switch accounts'),
text: Text(S.of(context).switchAccounts),
url: '/login',
rightWidget: Text(auth.activeAccount.login),
),
@ -76,7 +77,7 @@ class SettingsScreen extends StatelessWidget {
CommonStyle.verticalGap,
TableView(headerText: 'theme', items: [
TableViewItem(
text: Text('Brightness'),
text: Text(S.of(context).brightness),
rightWidget: Text(theme.brighnessValue == AppBrightnessType.light
? 'Light'
: theme.brighnessValue == AppBrightnessType.dark
@ -85,9 +86,10 @@ class SettingsScreen extends StatelessWidget {
onTap: () {
theme.showActions(context, [
for (var t in [
Tuple2('Follow System', AppBrightnessType.followSystem),
Tuple2('Light', AppBrightnessType.light),
Tuple2('Dark', AppBrightnessType.dark),
Tuple2(S.of(context).followSystem,
AppBrightnessType.followSystem),
Tuple2(S.of(context).light, AppBrightnessType.light),
Tuple2(S.of(context).dark, AppBrightnessType.dark),
])
ActionItem(
text: t.item1,
@ -100,15 +102,15 @@ class SettingsScreen extends StatelessWidget {
},
),
TableViewItem(
text: Text('Scaffold Theme'),
text: Text(S.of(context).scaffoldTheme),
rightWidget: Text(theme.theme == AppThemeType.cupertino
? 'Cupertino'
: 'Material'),
? S.of(context).cupertino
: S.of(context).material),
onTap: () {
theme.showActions(context, [
for (var t in [
Tuple2('Material', AppThemeType.material),
Tuple2('Cupertino', AppThemeType.cupertino),
Tuple2(S.of(context).material, AppThemeType.material),
Tuple2(S.of(context).cupertino, AppThemeType.cupertino),
])
ActionItem(
text: t.item1,
@ -122,20 +124,20 @@ class SettingsScreen extends StatelessWidget {
},
),
TableViewItem(
text: Text('Code Theme'),
text: Text(S.of(context).codeTheme),
url: '/choose-code-theme',
rightWidget: Text('${code.fontFamily}, ${code.fontSize}pt'),
),
TableViewItem(
text: Text('Markdown Render Engine'),
text: Text(S.of(context).markdownRenderEngine),
rightWidget: Text(theme.markdown == AppMarkdownType.flutter
? 'Flutter'
: 'WebView'),
? S.of(context).flutter
: S.of(context).webview),
onTap: () {
theme.showActions(context, [
for (var t in [
Tuple2('Flutter', AppMarkdownType.flutter),
Tuple2('WebView', AppMarkdownType.webview),
Tuple2(S.of(context).flutter, AppMarkdownType.flutter),
Tuple2(S.of(context).webview, AppMarkdownType.webview),
])
ActionItem(
text: t.item1,
@ -150,9 +152,9 @@ class SettingsScreen extends StatelessWidget {
),
]),
CommonStyle.verticalGap,
TableView(headerText: 'feedback', items: [
TableView(headerText: S.of(context).feedback, items: [
TableViewItem(
text: Text('Submit an issue'),
text: Text(S.of(context).submitAnIssue),
rightWidget: Text('pd4d10/git-touch'),
url: (auth.activeAccount.platform == PlatformType.github
? ''
@ -160,7 +162,7 @@ class SettingsScreen extends StatelessWidget {
'/github/pd4d10/git-touch/issues/new',
),
TableViewItem(
text: Text('Rate This App'),
text: Text(S.of(context).rateThisApp),
onTap: () {
LaunchReview.launch(
androidAppId: 'io.github.pd4d10.gittouch',
@ -169,16 +171,16 @@ class SettingsScreen extends StatelessWidget {
},
),
TableViewItem(
text: Text('Email'),
text: Text(S.of(context).email),
rightWidget: Text('pd4d10@gmail.com'),
hideRightChevron: true,
url: 'mailto:pd4d10@gmail.com',
),
]),
CommonStyle.verticalGap,
TableView(headerText: 'about', items: [
TableView(headerText: S.of(context).about, items: [
TableViewItem(
text: Text('Version'),
text: Text(S.of(context).version),
rightWidget: FutureBuilder<String>(
future:
PackageInfo.fromPlatform().then((info) => info.version),
@ -187,7 +189,7 @@ class SettingsScreen extends StatelessWidget {
},
)),
TableViewItem(
text: Text('Source Code'),
text: Text(S.of(context).sourceCode),
rightWidget: Text('pd4d10/git-touch'),
url: (auth.activeAccount.platform == PlatformType.github
? '/github'

View File

@ -46,6 +46,8 @@ dependencies:
uri: ^0.11.3
url_launcher: ^5.4.1
webview_flutter: ^1.0.5
flutter_localizations:
sdk: flutter
dev_dependencies:
flutter_test:
@ -60,6 +62,7 @@ dev_dependencies:
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
generate: true
uses-material-design: true
assets:
- images/
@ -110,3 +113,5 @@ flutter:
- asset: fonts/JetBrainsMono-Bold-Italic.ttf
style: italic
weight: 700
flutter_intl:
enabled: true