Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
applicationId = "com.example.the_wallpaper_company"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
Expand Down Expand Up @@ -60,4 +60,4 @@ dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")

// Other dependencies for your project...
}
}
4 changes: 4 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
output-class: AppLocalizations
252 changes: 252 additions & 0 deletions lib/core/localizations/app_localizations.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
import 'package:flutter/material.dart';
import '../providers/language_provider.dart';

class AppLocalizations {
final Locale locale;

AppLocalizations(this.locale);

static AppLocalizations? of(BuildContext context) {
return Localizations.of<AppLocalizations>(context, AppLocalizations);
}

static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();

// App strings
String get appTitle {
switch (locale.languageCode) {
case 'hi':
return 'द वॉलपेपर कंपनी';
default:
return 'The Wallpaper Co.';
}
}

String get searchHint {
switch (locale.languageCode) {
case 'hi':
return 'शीर्षक या श्रेणी द्वारा वॉलपेपर खोजें...';
default:
return 'Search wallpapers by title or category...';
}
}

String get home {
switch (locale.languageCode) {
case 'hi':
return 'होम';
default:
return 'Home';
}
}

String get favorites {
switch (locale.languageCode) {
case 'hi':
return 'पसंदीदा';
default:
return 'Favorites';
}
}

String get all {
switch (locale.languageCode) {
case 'hi':
return 'सभी';
default:
return 'All';
}
}

String get nature {
switch (locale.languageCode) {
case 'hi':
return 'प्रकृति';
default:
return 'Nature';
}
}

String get abstract {
switch (locale.languageCode) {
case 'hi':
return 'अमूर्त';
default:
return 'Abstract';
}
}

String get urban {
switch (locale.languageCode) {
case 'hi':
return 'शहरी';
default:
return 'Urban';
}
}

String get minimal {
switch (locale.languageCode) {
case 'hi':
return 'न्यूनतम';
default:
return 'Minimal';
}
}

String get space {
switch (locale.languageCode) {
case 'hi':
return 'अंतरिक्ष';
default:
return 'Space';
}
}

String get animals {
switch (locale.languageCode) {
case 'hi':
return 'जानवर';
default:
return 'Animals';
}
}

String get art {
switch (locale.languageCode) {
case 'hi':
return 'कला';
default:
return 'Art';
}
}

String get cars {
switch (locale.languageCode) {
case 'hi':
return 'कारें';
default:
return 'Cars';
}
}

String get noResultsTitle {
switch (locale.languageCode) {
case 'hi':
return 'कोई वॉलपेपर नहीं मिला';
default:
return 'No wallpapers found';
}
}

String noResultsMessage(String query) {
switch (locale.languageCode) {
case 'hi':
return '"$query" के लिए कोई परिणाम नहीं';
default:
return 'No results for "$query"';
}
}

String get clearSearch {
switch (locale.languageCode) {
case 'hi':
return 'खोज साफ़ करें';
default:
return 'Clear Search';
}
}

String get download {
switch (locale.languageCode) {
case 'hi':
return 'डाउनलोड';
default:
return 'Download';
}
}

String get setWallpaper {
switch (locale.languageCode) {
case 'hi':
return 'वॉलपेपर सेट करें';
default:
return 'Set Wallpaper';
}
}

String get share {
switch (locale.languageCode) {
case 'hi':
return 'साझा करें';
default:
return 'Share';
}
}

String get loading {
switch (locale.languageCode) {
case 'hi':
return 'लोड हो रहा है...';
default:
return 'Loading...';
}
}

String get error {
switch (locale.languageCode) {
case 'hi':
return 'त्रुटि';
default:
return 'Error';
}
}

String get retry {
switch (locale.languageCode) {
case 'hi':
return 'पुनः प्रयास करें';
default:
return 'Retry';
}
}

String get noFavorites {
switch (locale.languageCode) {
case 'hi':
return 'अभी तक कोई पसंदीदा नहीं';
default:
return 'No favorites yet';
}
}

String get noFavoritesMessage {
switch (locale.languageCode) {
case 'hi':
return 'यहाँ देखने के लिए कुछ वॉलपेपर को अपने पसंदीदा में जोड़ें';
default:
return 'Add some wallpapers to your favorites to see them here';
}
}
}

class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();

@override
bool isSupported(Locale locale) {
return LanguageProvider.supportedLocales
.map((l) => l.languageCode)
.contains(locale.languageCode);
}

@override
Future<AppLocalizations> load(Locale locale) async {
return AppLocalizations(locale);
}

@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}
Loading
Loading