sendLanguage method
String
sendLanguage({
- required LanguageCodeData languageCodeData,
- required String id,
- List<
RegExpReplace> ? regexpReplaces, - String? languageCode,
Implementation
String sendLanguage({
required LanguageCodeData languageCodeData,
required String id,
List<RegExpReplace>? regexpReplaces,
String? languageCode,
}) {
languageCode ??= language_code;
regexpReplaces ??= regexp_replaces;
try {
String language_result = languageCodeData[languageCode] ??
languageCodeData["id"] ??
"Translation not found\n\n${id}: Tidak ada bahasa ${languageCode}";
if (language_result.isEmpty) {
language_result =
"Translation not found\n\n${id}: Tidak ada bahasa ${languageCode}";
}
return variableMessage(
text: language_result,
regexpReplaces: regexpReplaces,
);
} catch (e) {
return "LanguageBot error\nId: ${id}\nRes: ${e.toString()}";
}
}