def _convert_localized_value(value: LocalizedValue) -> LocalizedIntegerValue:
        """Converts from :see:LocalizedValue to :see:LocalizedIntegerValue."""

        integer_values = {}
        for lang_code, _ in settings.LANGUAGES:
            local_value = value.get(lang_code, None)
            if local_value is None or local_value.strip() == '':
                local_value = None

            try:
                integer_values[lang_code] = int(local_value)
            except (ValueError, TypeError):
                integer_values[lang_code] = None

        return LocalizedIntegerValue(integer_values)
def _convert_localized_value ( value : LocalizedValue ) -> LocalizedIntegerValue : integer_values = { } for lang_code , _ in settings . LANGUAGES : local_value = value . get ( lang_code , None ) if local_value is None or local_value . strip ( ) == '' : local_value = None try : integer_values [ lang_code ] = int ( local_value ) except ( ValueError , TypeError ) : integer_values [ lang_code ] = None return LocalizedIntegerValue ( integer_values )
Converts from :see:LocalizedValue to :see:LocalizedIntegerValue.