js snippet translation