def localDigitsStrToInt(value, digitsToLocalDict, localToDigitsDict):
    """Convert digits to integer."""
    tmp = value.translate(digitsToLocalDict)
    if tmp == value:
        return int(value.translate(localToDigitsDict))
    else:
        raise ValueError('string contains regular digits')
