Fixed counter update when typing

Previous script tried to replace '$1' and '$2' even though those were already replaced with numbers.
The approach maintains system language storing original value in data attribute.