Add simpler to use function check_is_translatable to autotranslater

This commit is contained in:
Joshua Ramon Enslin 2022-09-12 23:51:25 +02:00
parent 59c858fb0f
commit 3246a37c63
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -37,6 +37,26 @@ final class NodaTimeAutotranslater {
* @return string
*/
/**
* Checks if a time is translatable and returns an appropriate bool for easier
* interfacing than through self::check_translatability.
*
* @param string $zeit_beginn Beginn year.
* @param string $zeit_ende End year.
* @param string $zeit_zaehlzeit_monat Counting time month.
*
* @return boolean
*/
public function check_is_translatable(string $zeit_beginn, string $zeit_ende, string $zeit_zaehlzeit_monat):bool {
if (self::check_translatability($zeit_beginn, $zeit_ende, $zeit_zaehlzeit_monat) === NodaTimeAutotranslaterStatus::NOT) {
return false;
}
return true;
}
/**
* Checks if a time is translatable.
* Translatable times have either a counting time day and month or at least a month.