getTranslation method

  1. @override
Future<Translation?> getTranslation(
  1. String md5Hash,
  2. SolvroLocale translatedLangCode
)
override

Gets a translation from the local database.

The hash parameter is the hash of the original text. The translatedLangCode parameter is the language code of the translated text.

Implementation

@override
Future<Translation?> getTranslation(String md5Hash, SolvroLocale translatedLangCode) async {
  return (select(
        translations,
      )..where((t) => t.originalTextHash.equals(md5Hash) & t.translatedLanguageCode.equals(translatedLangCode.index)))
      .getSingleOrNull();
}