refactor internationalize function with semantic variables