Class: Jekyll::L10n::TextValidator
- Inherits:
-
Object
- Object
- Jekyll::L10n::TextValidator
- Defined in:
- lib/jekyll-l10n/utils/text_validator.rb
Overview
Validates text for extraction and translation.
TextValidator checks if text meets minimum length requirements for extraction. Very short strings (< 3 characters) are typically skipped to focus on meaningful translatable content.
Key responsibilities:
-
Check minimum text length requirement
-
Validate text is not nil
Class Method Summary collapse
-
.valid?(text) ⇒ Boolean
Check if text is valid for extraction.
Class Method Details
.valid?(text) ⇒ Boolean
Check if text is valid for extraction.
Text is valid if it’s non-nil and meets the minimum length requirement (MIN_TRANSLATABLE_LENGTH, typically 3 characters).
28 29 30 31 32 |
# File 'lib/jekyll-l10n/utils/text_validator.rb', line 28 def self.valid?(text) return false if text.nil? text.length >= Jekyll::L10n::Constants::MIN_TRANSLATABLE_LENGTH end |