Files
Libretranslate-app/lib/models/language.dart
T
2026-07-14 17:37:17 +03:00

30 lines
730 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
class Language {
final String code;
final String name;
final List<String> targets;
const Language({
required this.code,
required this.name,
this.targets = const [],
});
factory Language.fromJson(Map<String, dynamic> json) {
return Language(
code: json['code'] as String,
name: json['name'] as String,
targets: (json['targets'] as List?)?.map((e) => e.toString()).toList() ??
const [],
);
}
/// "Otomatik Algıla" seçeneğini temsil eden özel dil.
static const auto = Language(code: 'auto', name: 'Otomatik Algıla');
@override
bool operator ==(Object other) => other is Language && other.code == code;
@override
int get hashCode => code.hashCode;
}